diff options
Diffstat (limited to 'utils/TableGen/CodeGenInstruction.h')
-rw-r--r-- | utils/TableGen/CodeGenInstruction.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/utils/TableGen/CodeGenInstruction.h b/utils/TableGen/CodeGenInstruction.h index d99af1b..e0d6b98 100644 --- a/utils/TableGen/CodeGenInstruction.h +++ b/utils/TableGen/CodeGenInstruction.h @@ -57,6 +57,11 @@ namespace llvm { unsigned MIOperandNo; unsigned MINumOperands; // The number of operands. + /// DoNotEncode - Bools are set to true in this vector for each operand in + /// the DisableEncoding list. These should not be emitted by the code + /// emitter. + std::vector<bool> DoNotEncode; + /// MIOperandInfo - Default MI operand type. Note an operand may be made /// up of multiple MI operands. DagInit *MIOperandInfo; @@ -82,7 +87,6 @@ namespace llvm { bool isCall; bool isLoad; bool isStore; - bool isTwoAddress; bool isPredicated; bool isConvertibleToThreeAddress; bool isCommutable; @@ -107,6 +111,25 @@ namespace llvm { return OperandList[Op.first].MIOperandNo + Op.second; } + /// getSubOperandNumber - Unflatten a operand number into an + /// operand/suboperand pair. + std::pair<unsigned,unsigned> getSubOperandNumber(unsigned Op) const { + for (unsigned i = 0; ; ++i) { + assert(i < OperandList.size() && "Invalid flat operand #"); + if (OperandList[i].MIOperandNo+OperandList[i].MINumOperands > Op) + return std::make_pair(i, Op-OperandList[i].MIOperandNo); + } + } + + + /// isFlatOperandNotEmitted - Return true if the specified flat operand # + /// should not be emitted with the code emitter. + bool isFlatOperandNotEmitted(unsigned FlatOpNo) const { + std::pair<unsigned,unsigned> Op = getSubOperandNumber(FlatOpNo); + if (OperandList[Op.first].DoNotEncode.size() > Op.second) + return OperandList[Op.first].DoNotEncode[Op.second]; + return false; + } CodeGenInstruction(Record *R, const std::string &AsmStr); |