diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-11-01 23:03:11 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-11-01 23:03:11 +0000 |
commit | 4c2b7a380830d783e7df4c2c3418b8921ed0684f (patch) | |
tree | cb06be6c45bae1e95b905f73496e74b0441b3f4f /utils/TableGen/CodeGenTarget.cpp | |
parent | 981b5bd7080db6dbbac6931863d8a2e6d1fc5a0c (diff) |
Tied-to constraint must be op_with_larger_idx = op_with_smaller_idx or else throw an exception.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31361 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenTarget.cpp')
-rw-r--r-- | utils/TableGen/CodeGenTarget.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp index 489aba9814..753651d950 100644 --- a/utils/TableGen/CodeGenTarget.cpp +++ b/utils/TableGen/CodeGenTarget.cpp @@ -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); } |