Replace fix with one less disruptive to the original code.
authorJeff Cohen <jeffc@jolt-lang.org>
Wed, 4 Jan 2006 03:23:30 +0000 (03:23 +0000)
committerJeff Cohen <jeffc@jolt-lang.org>
Wed, 4 Jan 2006 03:23:30 +0000 (03:23 +0000)
Also note that GCC 4.1 also correctly flags the syntax error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25076 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/DAGISelEmitter.cpp

index 1fbb7c6946eb1cd1994bcfa19cd0fd3a36dffa89..645392eb708347b4cc52f821b79532bc626730bd 100644 (file)
@@ -2030,13 +2030,12 @@ public:
         std::string Fn = CP->getSelectFunc();
         NumRes = CP->getNumOperands();
         OS << "      SDOperand ";
-        unsigned i;
-        for (i = 0; i < NumRes - 1; ++i)
+        for (unsigned i = 0; i < NumRes - 1; ++i)
           OS << "Tmp" << (i+ResNo) << ",";
-        OS << "Tmp" << (i+ResNo) << ";\n";
+        OS << "Tmp" << (NumRes - 1 + ResNo) << ";\n";
         
         OS << "      if (!" << Fn << "(" << Val;
-        for (i = 0; i < NumRes; i++)
+        for (unsigned i = 0; i < NumRes; i++)
           OS << ", Tmp" << i + ResNo;
         OS << ")) goto P" << PatternNo << "Fail;\n";
         TmpNo = ResNo + NumRes;