summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorctopper <ctopper@91177308-0d34-0410-b5e6-96231b3b80d8>2012-09-15 01:22:42 +0000
committerctopper <ctopper@91177308-0d34-0410-b5e6-96231b3b80d8>2012-09-15 01:22:42 +0000
commit04f46ad12089f9a049f66a8523b78da6d27f0a1f (patch)
tree15b85d48e246ae3f2252195d933302465207ccfd /utils
parentaedd9dca7541c63b8c35451ae04d35a0845c4ab7 (diff)
Revert r163878 as it breaks on targets with alternate register names. Such targets do not exist in the main tree so this was not noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163959 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/AsmWriterEmitter.cpp7
-rw-r--r--utils/TableGen/SequenceToOffsetTable.h3
2 files changed, 4 insertions, 6 deletions
diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp
index 8c492887c8..d0cd057cd3 100644
--- a/utils/TableGen/AsmWriterEmitter.cpp
+++ b/utils/TableGen/AsmWriterEmitter.cpp
@@ -575,13 +575,12 @@ emitRegisterNameString(raw_ostream &O, StringRef AltName,
StringTable.add(AsmName);
}
- unsigned Entries = StringTable.layout();
+ StringTable.layout();
O << " static const char AsmStrs" << AltName << "[] = {\n";
StringTable.emit(O, printChar);
O << " };\n\n";
- O << " static const uint" << ((Entries > 0xffff) ? "32" : "16")
- << "_t RegAsmOffset" << AltName << "[] = {";
+ O << " static const uint32_t RegAsmOffset" << AltName << "[] = {";
for (unsigned i = 0, e = Registers.size(); i != e; ++i) {
if ((i % 14) == 0)
O << "\n ";
@@ -620,7 +619,7 @@ void AsmWriterEmitter::EmitGetRegisterName(raw_ostream &O) {
emitRegisterNameString(O, "", Registers);
if (hasAltNames) {
- O << " const unsigned *RegAsmOffset;\n"
+ O << " const uint32_t *RegAsmOffset;\n"
<< " const char *AsmStrs;\n"
<< " switch(AltIdx) {\n"
<< " default: llvm_unreachable(\"Invalid register alt name index!\");\n";
diff --git a/utils/TableGen/SequenceToOffsetTable.h b/utils/TableGen/SequenceToOffsetTable.h
index a4f16ca9a6..d4db152a96 100644
--- a/utils/TableGen/SequenceToOffsetTable.h
+++ b/utils/TableGen/SequenceToOffsetTable.h
@@ -84,7 +84,7 @@ public:
bool empty() const { return Seqs.empty(); }
/// layout - Computes the final table layout.
- unsigned layout() {
+ void layout() {
assert(Entries == 0 && "Can only call layout() once");
// Lay out the table in Seqs iteration order.
for (typename SeqMap::iterator I = Seqs.begin(), E = Seqs.end(); I != E;
@@ -93,7 +93,6 @@ public:
// Include space for a terminator.
Entries += I->first.size() + 1;
}
- return Entries;
}
/// get - Returns the offset of Seq in the final table.