summaryrefslogtreecommitdiff
path: root/utils/TableGen/RegisterInfoEmitter.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-02-24 00:56:13 +0000
committerBill Wendling <isanbard@gmail.com>2008-02-24 00:56:13 +0000
commit181eb737b28628adc4376b973610a02039385026 (patch)
tree6cb16c395d181478325ad525e0d1cc03077278fb /utils/TableGen/RegisterInfoEmitter.cpp
parent1df439773cc771be634cc04cc6c5cbca2a8e5f38 (diff)
downloadllvm-181eb737b28628adc4376b973610a02039385026.tar.gz
llvm-181eb737b28628adc4376b973610a02039385026.tar.bz2
llvm-181eb737b28628adc4376b973610a02039385026.tar.xz
Some platforms use the same name for 32-bit and 64-bit registers (like
%r3 on PPC) in their ASM files. However, it's hard for humans to read during debugging. Adding a new field to the register data that lets you specify a different name to be printed than the one that goes into the ASM file -- %x3 instead of %r3, for instance. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/RegisterInfoEmitter.cpp')
-rw-r--r--utils/TableGen/RegisterInfoEmitter.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/utils/TableGen/RegisterInfoEmitter.cpp b/utils/TableGen/RegisterInfoEmitter.cpp
index 2552965ac9..abfb5d79d3 100644
--- a/utils/TableGen/RegisterInfoEmitter.cpp
+++ b/utils/TableGen/RegisterInfoEmitter.cpp
@@ -512,7 +512,7 @@ void RegisterInfoEmitter::run(std::ostream &OS) {
}
OS<<"\n const TargetRegisterDesc RegisterDescriptors[] = { // Descriptors\n";
- OS << " { \"NOREG\",\t0,\t0,\t0,\t0 },\n";
+ OS << " { \"NOREG\",\t\"NOREG\",\t0,\t0,\t0,\t0 },\n";
// Now that register alias and sub-registers sets have been emitted, emit the
// register descriptors now.
@@ -524,6 +524,16 @@ void RegisterInfoEmitter::run(std::ostream &OS) {
OS << Reg.TheDef->getValueAsString("Name");
else
OS << Reg.getName();
+ OS << "\",\t\"";
+ if (!Reg.TheDef->getValueAsString("PrintableName").empty()) {
+ OS << Reg.TheDef->getValueAsString("PrintableName");
+ } else {
+ // Default to "name".
+ if (!Reg.TheDef->getValueAsString("Name").empty())
+ OS << Reg.TheDef->getValueAsString("Name");
+ else
+ OS << Reg.getName();
+ }
OS << "\",\t";
if (RegisterAliases.count(Reg.TheDef))
OS << Reg.getName() << "_AliasSet,\t";