Clean up some code.

llvm-svn: 31451
This commit is contained in:
Evan Cheng 2006-11-04 09:40:23 +00:00
parent 2959789c92
commit 3cb5bf721c
2 changed files with 5 additions and 2 deletions

View 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,

View 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;
}