Lefted out a fix in the previous check in.
authorEvan Cheng <evan.cheng@apple.com>
Tue, 20 Dec 2005 00:06:17 +0000 (00:06 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 20 Dec 2005 00:06:17 +0000 (00:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24873 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/DAGISelEmitter.cpp

index e14ab6d3942151ba8a121ee929b67e38eb55e165..155dfad3730538ee587b00ad38f95fca77e8c6a0 100644 (file)
@@ -2134,7 +2134,13 @@ public:
           }
         }
 
-        OS << "      return Result.getValue(N.ResNo);\n";
+        // FIXME: this only works because (for now) an instruction can either
+        // produce a single result or a single flag.
+        if (II.hasCtrlDep && NumImpResults > 0)
+          OS << "      return (N.ResNo) ? Chain : Result.getValue(1);"
+             << "   // Chain comes before flag.\n";
+        else
+          OS << "      return Result.getValue(N.ResNo);\n";
       } else {
         // If this instruction is the root, and if there is only one use of it,
         // use SelectNodeTo instead of getTargetNode to avoid an allocation.