Clean up some code.
authorEvan Cheng <evan.cheng@apple.com>
Sat, 4 Nov 2006 09:40:23 +0000 (09:40 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sat, 4 Nov 2006 09:40:23 +0000 (09:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31451 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeGenTarget.cpp
utils/TableGen/InstrInfoEmitter.cpp

index 9e45f2ea87a8b4ae2dac13ba5fd3c65034fd7c47..f8410c17ff4f57f7f139ec0a4f6d7d6cd9a63867 100644 (file)
@@ -19,6 +19,7 @@
 #include "Record.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Target/TargetInstrInfo.h"
 #include <set>
 #include <algorithm>
 using namespace llvm;
@@ -294,7 +295,8 @@ static std::pair<unsigned, unsigned> parseConstraint(const std::string &CStr,
   unsigned TIdx = I->getOperandNamed(Name);
   if (TIdx >= FIdx)
     throw "Illegal tied-to operand constraint '" + CStr + "'";
-  return std::make_pair(FIdx, (TIdx << 16) | 1);
+  return std::make_pair(FIdx, (TIdx << 16) |
+                        (1 << (unsigned)TargetInstrInfo::TIED_TO));
 }
 
 static std::vector<unsigned> parseConstraints(const std::string &CStr,
index ed932db18b3be02a90493374aee61fd255d4a2b3..bf69d08523a6873627f62737893360df8a0f2443 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "InstrInfoEmitter.h"
 #include "CodeGenTarget.h"
+#include "llvm/Target/TargetInstrInfo.h"
 #include "Record.h"
 #include <algorithm>
 using namespace llvm;
@@ -89,7 +90,7 @@ GetOperandInfo(const CodeGenInstruction &Inst) {
   // For backward compatibility: isTwoAddress means operand 1 is tied to
   // operand 0.
   if (Inst.isTwoAddress)
-    Result[1].second |= 1;
+    Result[1].second |= (0 << 16) | (1 << (unsigned)TargetInstrInfo::TIED_TO);
 
   return Result;
 }