diff options
| author | Sean Callanan <scallanan@apple.com> | 2010-02-10 02:27:43 +0000 |
|---|---|---|
| committer | Sean Callanan <scallanan@apple.com> | 2010-02-10 02:27:43 +0000 |
| commit | 515937d2eab0935d2693251a76ea807389e52629 (patch) | |
| tree | 9ef780f835aad54ae6ab8a518d7baac60cff4e89 /llvm/utils | |
| parent | 29b8f554fca14972beb6dd1c209a55f27072afe8 (diff) | |
| download | bcm5719-llvm-515937d2eab0935d2693251a76ea807389e52629.tar.gz bcm5719-llvm-515937d2eab0935d2693251a76ea807389e52629.zip | |
Changed AsmWriterOperand to also include the index of the
operand into the CodeGenInstruction's list of operands,
which is useful for EDEmitter. (Still working on PR6219)
llvm-svn: 95759
Diffstat (limited to 'llvm/utils')
| -rw-r--r-- | llvm/utils/TableGen/AsmWriterInst.cpp | 9 | ||||
| -rw-r--r-- | llvm/utils/TableGen/AsmWriterInst.h | 10 |
2 files changed, 15 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/AsmWriterInst.cpp b/llvm/utils/TableGen/AsmWriterInst.cpp index ccf39c4c9a7..508e4530d09 100644 --- a/llvm/utils/TableGen/AsmWriterInst.cpp +++ b/llvm/utils/TableGen/AsmWriterInst.cpp @@ -219,7 +219,10 @@ AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, if (VarName.empty()) { // Just a modifier, pass this into PrintSpecial. - Operands.push_back(AsmWriterOperand("PrintSpecial", ~0U, Modifier)); + Operands.push_back(AsmWriterOperand("PrintSpecial", + ~0U, + ~0U, + Modifier)); } else { // Otherwise, normal operand. unsigned OpNo = CGI.getOperandNamed(VarName); @@ -227,7 +230,9 @@ AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, if (CurVariant == Variant || CurVariant == ~0U) { unsigned MIOp = OpInfo.MIOperandNo; - Operands.push_back(AsmWriterOperand(OpInfo.PrinterMethodName, MIOp, + Operands.push_back(AsmWriterOperand(OpInfo.PrinterMethodName, + OpNo, + MIOp, Modifier)); } } diff --git a/llvm/utils/TableGen/AsmWriterInst.h b/llvm/utils/TableGen/AsmWriterInst.h index 5a8cf7708bd..20b8588862b 100644 --- a/llvm/utils/TableGen/AsmWriterInst.h +++ b/llvm/utils/TableGen/AsmWriterInst.h @@ -41,6 +41,10 @@ namespace llvm { /// into the asm writer. std::string Str; + /// CGIOpNo - For isMachineInstrOperand, this is the index of the operand in + /// the CodeGenInstruction. + unsigned CGIOpNo; + /// MiOpNo - For isMachineInstrOperand, this is the operand number of the /// machine instruction. unsigned MIOpNo; @@ -56,10 +60,12 @@ namespace llvm { OpType op = isLiteralTextOperand) : OperandType(op), Str(LitStr) {} - AsmWriterOperand(const std::string &Printer, unsigned OpNo, + AsmWriterOperand(const std::string &Printer, + unsigned _CGIOpNo, + unsigned _MIOpNo, const std::string &Modifier, OpType op = isMachineInstrOperand) - : OperandType(op), Str(Printer), MIOpNo(OpNo), + : OperandType(op), Str(Printer), CGIOpNo(_CGIOpNo), MIOpNo(_MIOpNo), MiModifier(Modifier) {} bool operator!=(const AsmWriterOperand &Other) const { |

