[llvm-commits] [llvm] r163118 - /llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Chad Rosier
mcrosier at apple.com
Mon Sep 3 10:33:50 PDT 2012
Author: mcrosier
Date: Mon Sep 3 12:33:50 2012
New Revision: 163118
URL: http://llvm.org/viewvc/llvm-project?rev=163118&view=rev
Log:
[ms-inline asm] Return the MCOperandNum instead of passing a reference.
Modified:
llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=163118&r1=163117&r2=163118&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Mon Sep 3 12:33:50 2012
@@ -1700,12 +1700,12 @@
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 @@
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 @@
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"
More information about the llvm-commits
mailing list