From 87d910efc676d6d249dcfb054a9e3b8d97843bfc Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Mon, 3 Sep 2012 17:33:50 +0000 Subject: [PATCH] [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 --- utils/TableGen/AsmMatcherEmitter.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index 86c90db92e1..e4b3a4bf84d 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 &Operands," - << "\n unsigned OperandNum, unsigned &MCOperandNum) {\n" + << " const SmallVectorImpl " + << "&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 " + << " const SmallVectorImpl " << "&Operands);\n"; - OS << " void GetMCInstOperandNum(unsigned Kind, MCInst &Inst,\n" - << " const SmallVectorImpl " - << "&Operands,\n unsigned OperandNum, unsigned " - << "&MCOperandNum);\n"; + OS << " unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,\n " + << " const SmallVectorImpl " + << "&Operands,\n unsigned OperandNum);\n"; OS << " bool MnemonicIsValid(StringRef Mnemonic);\n"; OS << " unsigned MatchInstructionImpl(\n" << " const SmallVectorImpl &Operands,\n"