diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-02 22:55:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-02 22:55:03 +0000 |
commit | 9b0d4bfca0f23d39f5f2aef6b6740267a26ee17c (patch) | |
tree | 059d57aaa57398c35c7881ddcd2465bbf87c033b /utils/TableGen/CodeGenInstruction.h | |
parent | 0800ce71896ccd7f49b37861a8cfbc21b6b10022 (diff) | |
download | llvm-9b0d4bfca0f23d39f5f2aef6b6740267a26ee17c.tar.gz llvm-9b0d4bfca0f23d39f5f2aef6b6740267a26ee17c.tar.bz2 llvm-9b0d4bfca0f23d39f5f2aef6b6740267a26ee17c.tar.xz |
rewrite EmitConvertToMCInst to iterate over the MCInst operands,
filling them in one at a time. Previously this iterated over the
asmoperands, which left the problem of "holes". The new approach
simplifies things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118104 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenInstruction.h')
-rw-r--r-- | utils/TableGen/CodeGenInstruction.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/utils/TableGen/CodeGenInstruction.h b/utils/TableGen/CodeGenInstruction.h index 78c88d797d..24bdbe2794 100644 --- a/utils/TableGen/CodeGenInstruction.h +++ b/utils/TableGen/CodeGenInstruction.h @@ -102,7 +102,18 @@ namespace llvm { const std::string &EMN, unsigned MION, unsigned MINO, DagInit *MIOI) : Rec(R), Name(N), PrinterMethodName(PMN), EncoderMethodName(EMN), - MIOperandNo(MION), MINumOperands(MINO), MIOperandInfo(MIOI) {} + MIOperandNo(MION), MINumOperands(MINO), MIOperandInfo(MIOI) {} + + + /// getTiedOperand - If this operand is tied to another one, return the + /// other operand number. Otherwise, return -1. + int getTiedRegister() const { + for (unsigned j = 0, e = Constraints.size(); j != e; ++j) { + const CGIOperandList::ConstraintInfo &CI = Constraints[j]; + if (CI.isTied()) return CI.getTiedOperand(); + } + return -1; + } }; CGIOperandList(Record *D); |