[llvm-commits] CVS: llvm/utils/TableGen/AsmWriterEmitter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Jul 18 12:27:43 PDT 2006
Changes in directory llvm/utils/TableGen:
AsmWriterEmitter.cpp updated: 1.38 -> 1.39
---
Log message:
Fix case where identical cases were not detected across case #0, because
instructions not handled would have a case value of #0, throwing things off.
This marginally shrinks the X86 asmprinter, but shrinks the sparc asmwriter
by 25 lines.
---
Diffs of the changes: (+3 -2)
AsmWriterEmitter.cpp | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
Index: llvm/utils/TableGen/AsmWriterEmitter.cpp
diff -u llvm/utils/TableGen/AsmWriterEmitter.cpp:1.38 llvm/utils/TableGen/AsmWriterEmitter.cpp:1.39
--- llvm/utils/TableGen/AsmWriterEmitter.cpp:1.38 Tue Jul 18 14:06:01 2006
+++ llvm/utils/TableGen/AsmWriterEmitter.cpp Tue Jul 18 14:27:30 2006
@@ -332,7 +332,7 @@
FindUniqueOperandCommands(std::vector<std::string> &UniqueOperandCommands,
std::vector<unsigned> &InstIdxs,
std::vector<unsigned> &InstOpsUsed) const {
- InstIdxs.assign(NumberedInstructions.size(), 0);
+ InstIdxs.assign(NumberedInstructions.size(), ~0U);
// This vector parallels UniqueOperandCommands, keeping track of which
// instructions each case are used for. It is a comma separated string of
@@ -551,7 +551,8 @@
// Otherwise, we can include this in the initial lookup table. Add it in.
BitsLeft -= NumBits;
for (unsigned i = 0, e = InstIdxs.size(); i != e; ++i)
- OpcodeInfo[i] |= InstIdxs[i] << (BitsLeft+AsmStrBits);
+ if (InstIdxs[i] != ~0U)
+ OpcodeInfo[i] |= InstIdxs[i] << (BitsLeft+AsmStrBits);
// Remove the info about this operand.
for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
More information about the llvm-commits
mailing list