Fix a case where, when trying to track tied operands, we'd accidentally overwrite...
authorOwen Anderson <resistor@mac.com>
Fri, 29 Jul 2011 17:32:03 +0000 (17:32 +0000)
committerOwen Anderson <resistor@mac.com>
Fri, 29 Jul 2011 17:32:03 +0000 (17:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136467 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/FixedLenDecoderEmitter.cpp

index 4a2483b74568f3d217376b367eb0b8de20981196..206d15f0628527a6b24ef945ba444bfa8ea0cc01 100644 (file)
@@ -1228,10 +1228,8 @@ static bool populateInstruction(const CodeGenInstruction &CGI,
   std::map<Init*, std::string> TiedNames;
   for (unsigned i = 0; i < CGI.Operands.size(); ++i) {
     int tiedTo = CGI.Operands[i].getTiedRegister();
-    if (tiedTo != -1) {
+    if (tiedTo != -1)
       TiedNames[InOutOperands[i].first] = InOutOperands[tiedTo].second;
-      TiedNames[InOutOperands[tiedTo].first] = InOutOperands[i].second;
-    }
   }
 
   // For each operand, see if we can figure out where it is encoded.
@@ -1267,6 +1265,8 @@ static bool populateInstruction(const CodeGenInstruction &CGI,
     unsigned Offset = 0;
 
     for (unsigned bi = 0; bi < Bits.getNumBits(); ++bi) {
+      std::string name = NI->second;
+      std::string altname = TiedNames[NI->first];
       VarBitInit *BI = dynamic_cast<VarBitInit*>(Bits.getBit(bi));
       if (!BI) {
         if (Base != ~0U) {