[llvm-commits] [llvm] r163959 - in /llvm/trunk/utils/TableGen: AsmWriterEmitter.cpp SequenceToOffsetTable.h
Craig Topper
craig.topper at gmail.com
Fri Sep 14 18:22:43 PDT 2012
Author: ctopper
Date: Fri Sep 14 20:22:42 2012
New Revision: 163959
URL: http://llvm.org/viewvc/llvm-project?rev=163959&view=rev
Log:
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.
Modified:
llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
llvm/trunk/utils/TableGen/SequenceToOffsetTable.h
Modified: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=163959&r1=163958&r2=163959&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Fri Sep 14 20:22:42 2012
@@ -575,13 +575,12 @@
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 @@
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";
Modified: llvm/trunk/utils/TableGen/SequenceToOffsetTable.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/SequenceToOffsetTable.h?rev=163959&r1=163958&r2=163959&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/SequenceToOffsetTable.h (original)
+++ llvm/trunk/utils/TableGen/SequenceToOffsetTable.h Fri Sep 14 20:22:42 2012
@@ -84,7 +84,7 @@
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 @@
// Include space for a terminator.
Entries += I->first.size() + 1;
}
- return Entries;
}
/// get - Returns the offset of Seq in the final table.
More information about the llvm-commits
mailing list