diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-09-03 17:33:50 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-09-03 17:33:50 +0000 |
commit | 87d910efc676d6d249dcfb054a9e3b8d97843bfc (patch) | |
tree | 47cd2b25f6e3edfa85dac38a93345fad4e8b1b17 | |
parent | 94b17f334ba28cc11b2bf89911189904d00e99f7 (diff) | |
download | external_llvm-87d910efc676d6d249dcfb054a9e3b8d97843bfc.zip external_llvm-87d910efc676d6d249dcfb054a9e3b8d97843bfc.tar.gz external_llvm-87d910efc676d6d249dcfb054a9e3b8d97843bfc.tar.bz2 |
[ms-inline asm] Return the MCOperandNum instead of passing a reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163118 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | utils/TableGen/AsmMatcherEmitter.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index 86c90db..e4b3a4b 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -1700,12 +1700,12 @@ static void emitConvertToMCInst(CodeGenTarget &Target, StringRef ClassName, std::string OperandFnBody; raw_string_ostream OpOS(OperandFnBody); // Start the operand number lookup function. - OpOS << "void " << Target.getName() << ClassName << "::\n" + OpOS << "unsigned " << Target.getName() << ClassName << "::\n" << "GetMCInstOperandNum(unsigned Kind, MCInst &Inst,\n" - << " const SmallVectorImpl<MCParsedAsmOperand*> &Operands," - << "\n unsigned OperandNum, unsigned &MCOperandNum) {\n" + << " const SmallVectorImpl<MCParsedAsmOperand*> " + << "&Operands,\n unsigned OperandNum) {\n" << " assert(Kind < CVT_NUM_SIGNATURES && \"Invalid signature!\");\n" - << " MCOperandNum = 0;\n" + << " unsigned MCOperandNum = 0;\n" << " uint8_t *Converter = ConversionTable[Kind];\n" << " for (uint8_t *p = Converter; *p; p+= 2) {\n" << " if (*(p + 1) > OperandNum) continue;\n" @@ -1902,7 +1902,7 @@ static void emitConvertToMCInst(CodeGenTarget &Target, StringRef ClassName, CvtOS << " }\n }\n return;\n}\n\n"; // Finish up the operand number lookup function. - OpOS << " }\n }\n return;\n}\n\n"; + OpOS << " }\n }\n return MCOperandNum;\n}\n\n"; OS << "namespace {\n"; @@ -2578,12 +2578,11 @@ void AsmMatcherEmitter::run(raw_ostream &OS) { OS << " unsigned ComputeAvailableFeatures(uint64_t FeatureBits) const;\n"; OS << " void ConvertToMCInst(unsigned Kind, MCInst &Inst, " << "unsigned Opcode,\n" - << " const SmallVectorImpl<MCParsedAsmOperand*> " + << " const SmallVectorImpl<MCParsedAsmOperand*> " << "&Operands);\n"; - OS << " void GetMCInstOperandNum(unsigned Kind, MCInst &Inst,\n" - << " const SmallVectorImpl<MCParsedAsmOperand*> " - << "&Operands,\n unsigned OperandNum, unsigned " - << "&MCOperandNum);\n"; + OS << " unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,\n " + << " const SmallVectorImpl<MCParsedAsmOperand*> " + << "&Operands,\n unsigned OperandNum);\n"; OS << " bool MnemonicIsValid(StringRef Mnemonic);\n"; OS << " unsigned MatchInstructionImpl(\n" << " const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n" |