1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Tied-to constraint must be op_with_larger_idx = op_with_smaller_idx or else throw an exception.

llvm-svn: 31361
This commit is contained in:
Evan Cheng 2006-11-01 23:03:11 +00:00
parent b1ac9f6c12
commit 05d73e7209

View File

@ -280,6 +280,7 @@ static std::pair<unsigned, unsigned> parseConstraint(const std::string &CStr,
assert(pos != std::string::npos && "Unrecognized constraint");
std::string Name = CStr.substr(1, pos); // Skip '$'
// TIED_TO: $src1 = $dst
const std::string delims(" \t");
std::string::size_type wpos = Name.find_first_of(delims);
if (wpos != std::string::npos)
@ -291,6 +292,8 @@ static std::pair<unsigned, unsigned> parseConstraint(const std::string &CStr,
if (wpos != std::string::npos)
Name = Name.substr(wpos+1);
unsigned TIdx = I->getOperandNamed(Name);
if (TIdx >= FIdx)
throw "Illegal tied-to operand constraint '" + CStr + "'";
return std::make_pair(FIdx, (TIdx << 16) | 1);
}