[llvm-commits] [llvm] r165324 - in /llvm/trunk: include/llvm/MC/MCTargetAsmParser.h lib/Target/ARM/AsmParser/ARMAsmParser.cpp lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp lib/Target/Mips/AsmParser/MipsAsmParser.cpp lib/Target/X86/AsmParser/X86AsmParser.cpp utils/TableGen/AsmMatcherEmitter.cpp
Chad Rosier
mcrosier at apple.com
Fri Oct 5 11:41:14 PDT 2012
Author: mcrosier
Date: Fri Oct 5 13:41:14 2012
New Revision: 165324
URL: http://llvm.org/viewvc/llvm-project?rev=165324&view=rev
Log:
[ms-inline asm] Add a few typedefs to simplify future changes.
Modified:
llvm/trunk/include/llvm/MC/MCTargetAsmParser.h
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp
llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Modified: llvm/trunk/include/llvm/MC/MCTargetAsmParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCTargetAsmParser.h?rev=165324&r1=165323&r2=165324&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCTargetAsmParser.h (original)
+++ llvm/trunk/include/llvm/MC/MCTargetAsmParser.h Fri Oct 5 13:41:14 2012
@@ -50,6 +50,10 @@
virtual bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc,
SMLoc &EndLoc) = 0;
+ typedef std::pair< unsigned, std::string > MapAndConstraint;
+ typedef SmallVector<MapAndConstraint, 4> MatchInstMapAndConstraints;
+ typedef SmallVectorImpl<MapAndConstraint> MatchInstMapAndConstraintsImpl;
+
/// ParseInstruction - Parse one assembly instruction.
///
/// The parser is positioned following the instruction name. The target
@@ -92,7 +96,7 @@
MatchInstruction(SMLoc IDLoc,
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
MCStreamer &Out, unsigned &Kind, unsigned &Opcode,
- SmallVectorImpl<std::pair< unsigned, std::string > > &MapAndConstraints,
+ MatchInstMapAndConstraintsImpl &MapAndConstraints,
unsigned &OrigErrorInfo, bool matchingInlineAsm = false) {
OrigErrorInfo = ~0x0;
return true;
@@ -117,7 +121,7 @@
virtual void convertToMapAndConstraints(unsigned Kind,
const SmallVectorImpl<MCParsedAsmOperand*> &Operands,
- SmallVectorImpl<std::pair< unsigned, std::string > > &MapAndConstraints) = 0;
+ MatchInstMapAndConstraintsImpl &MapAndConstraints) = 0;
};
} // End llvm namespace
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=165324&r1=165323&r2=165324&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Fri Oct 5 13:41:14 2012
@@ -7480,7 +7480,7 @@
unsigned Kind;
unsigned ErrorInfo;
unsigned MatchResult;
- SmallVector<std::pair< unsigned, std::string >, 4> MapAndConstraints;
+ MatchInstMapAndConstraints MapAndConstraints;
MatchResult = MatchInstructionImpl(Operands, Kind, Inst,
MapAndConstraints, ErrorInfo,
/*matchingInlineAsm*/ false);
Modified: llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp?rev=165324&r1=165323&r2=165324&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp Fri Oct 5 13:41:14 2012
@@ -318,7 +318,7 @@
MCInst Inst;
unsigned Kind;
unsigned ErrorInfo;
- SmallVector<std::pair< unsigned, std::string >, 4> MapAndConstraints;
+ MatchInstMapAndConstraints MapAndConstraints;
switch (MatchInstructionImpl(Operands, Kind, Inst, MapAndConstraints,
ErrorInfo, /*matchingInlineAsm*/ false)) {
default: break;
Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=165324&r1=165323&r2=165324&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Fri Oct 5 13:41:14 2012
@@ -371,7 +371,7 @@
MCInst Inst;
unsigned Kind;
unsigned ErrorInfo;
- SmallVector<std::pair< unsigned, std::string >, 4> MapAndConstraints;
+ MatchInstMapAndConstraints MapAndConstraints;
unsigned MatchResult = MatchInstructionImpl(Operands, Kind, Inst,
MapAndConstraints, ErrorInfo,
/*matchingInlineAsm*/ false);
Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=165324&r1=165323&r2=165324&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Fri Oct 5 13:41:14 2012
@@ -69,7 +69,7 @@
bool MatchInstruction(SMLoc IDLoc,
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
MCStreamer &Out, unsigned &Kind, unsigned &Opcode,
- SmallVectorImpl<std::pair< unsigned, std::string > > &MapAndConstraints,
+ MatchInstMapAndConstraintsImpl &MapAndConstraints,
unsigned &OrigErrorInfo, bool matchingInlineAsm = false);
/// isSrcOp - Returns true if operand is either (%rsi) or %ds:%(rsi)
@@ -1526,7 +1526,7 @@
unsigned Kind;
unsigned Opcode;
unsigned ErrorInfo;
- SmallVector<std::pair< unsigned, std::string >, 4> MapAndConstraints;
+ MatchInstMapAndConstraints MapAndConstraints;
bool Error = MatchInstruction(IDLoc, Operands, Out, Kind, Opcode,
MapAndConstraints, ErrorInfo);
return Error;
@@ -1631,7 +1631,7 @@
unsigned Match1, Match2, Match3, Match4;
unsigned tKind;
- SmallVector<std::pair< unsigned, std::string >, 4> tMapAndConstraints[4];
+ MatchInstMapAndConstraints tMapAndConstraints[4];
Match1 = MatchInstructionImpl(Operands, tKind, Inst, tMapAndConstraints[0],
ErrorInfoIgnore, isParsingIntelSyntax());
if (Match1 == Match_Success) Kind = tKind;
Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=165324&r1=165323&r2=165324&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Fri Oct 5 13:41:14 2012
@@ -1716,9 +1716,9 @@
OpOS << "void " << Target.getName() << ClassName << "::\n"
<< "convertToMapAndConstraints(unsigned Kind,\n";
OpOS.indent(27);
- OpOS << "const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n"
- << " SmallVectorImpl<std::pair< unsigned, std::string > >"
- << " &MapAndConstraints) {\n"
+ OpOS << "const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n";
+ OpOS.indent(27);
+ OpOS << "MatchInstMapAndConstraintsImpl &MapAndConstraints) {\n"
<< " assert(Kind < CVT_NUM_SIGNATURES && \"Invalid signature!\");\n"
<< " unsigned NumMCOperands = 0;\n"
<< " const uint8_t *Converter = ConversionTable[Kind];\n"
@@ -2606,15 +2606,16 @@
<< " const SmallVectorImpl<MCParsedAsmOperand*> "
<< "&Operands);\n";
OS << " void convertToMapAndConstraints(unsigned Kind,\n ";
- OS << " const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n"
- << " SmallVectorImpl<std::pair< unsigned, std::string > >"
- << " &MapAndConstraints);\n";
+ OS << " const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n";
+ OS.indent(29);
+ OS << "MatchInstMapAndConstraintsImpl &MapAndConstraints);\n";
OS << " bool mnemonicIsValid(StringRef Mnemonic);\n";
- OS << " unsigned MatchInstructionImpl(\n"
- << " const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n"
- << " unsigned &Kind, MCInst &Inst,\n"
- << " SmallVectorImpl<std::pair< unsigned, std::string > > "
- << "&MapAndConstraints,\n"
+ OS << " unsigned MatchInstructionImpl(\n";
+ OS.indent(27);
+ OS << "const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n"
+ << " unsigned &Kind, MCInst &Inst,\n";
+ OS.indent(30);
+ OS << "MatchInstMapAndConstraintsImpl &MapAndConstraints,\n"
<< " unsigned &ErrorInfo,"
<< " bool matchingInlineAsm,\n"
<< " unsigned VariantID = 0);\n";
More information about the llvm-commits
mailing list