summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/InstrInfoEmitter.cpp8
-rw-r--r--utils/TableGen/RegisterInfoEmitter.cpp6
2 files changed, 10 insertions, 4 deletions
diff --git a/utils/TableGen/InstrInfoEmitter.cpp b/utils/TableGen/InstrInfoEmitter.cpp
index c794cd0441..7b64f922f6 100644
--- a/utils/TableGen/InstrInfoEmitter.cpp
+++ b/utils/TableGen/InstrInfoEmitter.cpp
@@ -65,6 +65,10 @@ void InstrInfoEmitter::run(std::ostream &OS) {
std::vector<Record*> Instructions =
Records.getAllDerivedDefinitions("Instruction");
+ // Emit empty implicit uses and defs lists
+ OS << "static const unsigned EmptyImpUses[] = { 0 };\n"
+ << "static const unsigned EmptyImpDefs[] = { 0 };\n";
+
// Emit all of the instruction's implicit uses and defs...
for (unsigned i = 0, e = Instructions.size(); i != e; ++i) {
Record *Inst = Instructions[i];
@@ -113,13 +117,13 @@ void InstrInfoEmitter::emitRecord(Record *R, unsigned Num, Record *InstrInfo,
// Emit the implicit uses and defs lists...
LI = R->getValueAsListInit("Uses");
if (!LI->getSize())
- OS << "0, ";
+ OS << "EmptyImpUses, ";
else
OS << R->getName() << "ImpUses, ";
LI = R->getValueAsListInit("Defs");
if (!LI->getSize())
- OS << "0 ";
+ OS << "EmptyImpDefs ";
else
OS << R->getName() << "ImpDefs ";
diff --git a/utils/TableGen/RegisterInfoEmitter.cpp b/utils/TableGen/RegisterInfoEmitter.cpp
index af3efe3a9c..7652e67772 100644
--- a/utils/TableGen/RegisterInfoEmitter.cpp
+++ b/utils/TableGen/RegisterInfoEmitter.cpp
@@ -138,7 +138,7 @@ void RegisterInfoEmitter::run(std::ostream &OS) {
std::vector<Record*> RegisterAliasesRecs =
Records.getAllDerivedDefinitions("RegisterAliases");
std::map<Record*, std::set<Record*> > RegisterAliases;
-
+
for (unsigned i = 0, e = RegisterAliasesRecs.size(); i != e; ++i) {
Record *AS = RegisterAliasesRecs[i];
Record *R = AS->getValueAsDef("Reg");
@@ -166,6 +166,8 @@ void RegisterInfoEmitter::run(std::ostream &OS) {
if (!RegisterAliases.empty())
OS << "\n\n // Register Alias Sets...\n";
+ // Emit the empty alias list
+ OS << " const unsigned Empty_AliasSet[] = { 0 };\n";
// Loop over all of the registers which have aliases, emitting the alias list
// to memory.
for (std::map<Record*, std::set<Record*> >::iterator
@@ -192,7 +194,7 @@ void RegisterInfoEmitter::run(std::ostream &OS) {
if (RegisterAliases.count(Reg))
OS << Reg->getName() << "_AliasSet,\t";
else
- OS << "0,\t\t";
+ OS << "Empty_AliasSet,\t";
OS << "0, 0 },\n";
}
OS << " };\n"; // End of register descriptors...