llvm.org GIT mirror llvm / 9ba9d4d
[ms-inline asm] Add a few typedefs to simplify future changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165324 91177308-0d34-0410-b5e6-96231b3b80d8 Chad Rosier 7 years ago
6 changed file(s) with 24 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
4949 virtual bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc,
5050 SMLoc &EndLoc) = 0;
5151
52 typedef std::pair< unsigned, std::string > MapAndConstraint;
53 typedef SmallVector MatchInstMapAndConstraints;
54 typedef SmallVectorImpl MatchInstMapAndConstraintsImpl;
55
5256 /// ParseInstruction - Parse one assembly instruction.
5357 ///
5458 /// The parser is positioned following the instruction name. The target
9195 MatchInstruction(SMLoc IDLoc,
9296 SmallVectorImpl &Operands,
9397 MCStreamer &Out, unsigned &Kind, unsigned &Opcode,
94 SmallVectorImpl > &MapAndConstraints,
98 MatchInstMapAndConstraintsImpl &MapAndConstraints,
9599 unsigned &OrigErrorInfo, bool matchingInlineAsm = false) {
96100 OrigErrorInfo = ~0x0;
97101 return true;
116120
117121 virtual void convertToMapAndConstraints(unsigned Kind,
118122 const SmallVectorImpl &Operands,
119 SmallVectorImpl > &MapAndConstraints) = 0;
123 MatchInstMapAndConstraintsImpl &MapAndConstraints) = 0;
120124 };
121125
122126 } // End llvm namespace
74797479 unsigned Kind;
74807480 unsigned ErrorInfo;
74817481 unsigned MatchResult;
7482 SmallVector, 4> MapAndConstraints;
7482 MatchInstMapAndConstraints MapAndConstraints;
74837483 MatchResult = MatchInstructionImpl(Operands, Kind, Inst,
74847484 MapAndConstraints, ErrorInfo,
74857485 /*matchingInlineAsm*/ false);
317317 MCInst Inst;
318318 unsigned Kind;
319319 unsigned ErrorInfo;
320 SmallVector, 4> MapAndConstraints;
320 MatchInstMapAndConstraints MapAndConstraints;
321321 switch (MatchInstructionImpl(Operands, Kind, Inst, MapAndConstraints,
322322 ErrorInfo, /*matchingInlineAsm*/ false)) {
323323 default: break;
370370 MCInst Inst;
371371 unsigned Kind;
372372 unsigned ErrorInfo;
373 SmallVector, 4> MapAndConstraints;
373 MatchInstMapAndConstraints MapAndConstraints;
374374 unsigned MatchResult = MatchInstructionImpl(Operands, Kind, Inst,
375375 MapAndConstraints, ErrorInfo,
376376 /*matchingInlineAsm*/ false);
6868 bool MatchInstruction(SMLoc IDLoc,
6969 SmallVectorImpl &Operands,
7070 MCStreamer &Out, unsigned &Kind, unsigned &Opcode,
71 SmallVectorImpl > &MapAndConstraints,
71 MatchInstMapAndConstraintsImpl &MapAndConstraints,
7272 unsigned &OrigErrorInfo, bool matchingInlineAsm = false);
7373
7474 /// isSrcOp - Returns true if operand is either (%rsi) or %ds:%(rsi)
15251525 unsigned Kind;
15261526 unsigned Opcode;
15271527 unsigned ErrorInfo;
1528 SmallVector, 4> MapAndConstraints;
1528 MatchInstMapAndConstraints MapAndConstraints;
15291529 bool Error = MatchInstruction(IDLoc, Operands, Out, Kind, Opcode,
15301530 MapAndConstraints, ErrorInfo);
15311531 return Error;
16301630 unsigned Match1, Match2, Match3, Match4;
16311631 unsigned tKind;
16321632
1633 SmallVector, 4> tMapAndConstraints[4];
1633 MatchInstMapAndConstraints tMapAndConstraints[4];
16341634 Match1 = MatchInstructionImpl(Operands, tKind, Inst, tMapAndConstraints[0],
16351635 ErrorInfoIgnore, isParsingIntelSyntax());
16361636 if (Match1 == Match_Success) Kind = tKind;
17151715 OpOS << "void " << Target.getName() << ClassName << "::\n"
17161716 << "convertToMapAndConstraints(unsigned Kind,\n";
17171717 OpOS.indent(27);
1718 OpOS << "const SmallVectorImpl &Operands,\n"
1719 << " SmallVectorImpl >"
1720 << " &MapAndConstraints) {\n"
1718 OpOS << "const SmallVectorImpl &Operands,\n";
1719 OpOS.indent(27);
1720 OpOS << "MatchInstMapAndConstraintsImpl &MapAndConstraints) {\n"
17211721 << " assert(Kind < CVT_NUM_SIGNATURES && \"Invalid signature!\");\n"
17221722 << " unsigned NumMCOperands = 0;\n"
17231723 << " const uint8_t *Converter = ConversionTable[Kind];\n"
26052605 << " const SmallVectorImpl "
26062606 << "&Operands);\n";
26072607 OS << " void convertToMapAndConstraints(unsigned Kind,\n ";
2608 OS << " const SmallVectorImpl &Operands,\n"
2609 << " SmallVectorImpl >"
2610 << " &MapAndConstraints);\n";
2608 OS << " const SmallVectorImpl &Operands,\n";
2609 OS.indent(29);
2610 OS << "MatchInstMapAndConstraintsImpl &MapAndConstraints);\n";
26112611 OS << " bool mnemonicIsValid(StringRef Mnemonic);\n";
2612 OS << " unsigned MatchInstructionImpl(\n"
2613 << " const SmallVectorImpl &Operands,\n"
2614 << " unsigned &Kind, MCInst &Inst,\n"
2615 << " SmallVectorImpl > "
2616 << "&MapAndConstraints,\n"
2612 OS << " unsigned MatchInstructionImpl(\n";
2613 OS.indent(27);
2614 OS << "const SmallVectorImpl &Operands,\n"
2615 << " unsigned &Kind, MCInst &Inst,\n";
2616 OS.indent(30);
2617 OS << "MatchInstMapAndConstraintsImpl &MapAndConstraints,\n"
26172618 << " unsigned &ErrorInfo,"
26182619 << " bool matchingInlineAsm,\n"
26192620 << " unsigned VariantID = 0);\n";