mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-06 14:57:41 +00:00
[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
This commit is contained in:
parent
dfb8dbb4fd
commit
9ba9d4d76b
@ -50,6 +50,10 @@ public:
|
|||||||
virtual bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc,
|
virtual bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc,
|
||||||
SMLoc &EndLoc) = 0;
|
SMLoc &EndLoc) = 0;
|
||||||
|
|
||||||
|
typedef std::pair< unsigned, std::string > MapAndConstraint;
|
||||||
|
typedef SmallVector<MapAndConstraint, 4> MatchInstMapAndConstraints;
|
||||||
|
typedef SmallVectorImpl<MapAndConstraint> MatchInstMapAndConstraintsImpl;
|
||||||
|
|
||||||
/// ParseInstruction - Parse one assembly instruction.
|
/// ParseInstruction - Parse one assembly instruction.
|
||||||
///
|
///
|
||||||
/// The parser is positioned following the instruction name. The target
|
/// The parser is positioned following the instruction name. The target
|
||||||
@ -92,7 +96,7 @@ public:
|
|||||||
MatchInstruction(SMLoc IDLoc,
|
MatchInstruction(SMLoc IDLoc,
|
||||||
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||||
MCStreamer &Out, unsigned &Kind, unsigned &Opcode,
|
MCStreamer &Out, unsigned &Kind, unsigned &Opcode,
|
||||||
SmallVectorImpl<std::pair< unsigned, std::string > > &MapAndConstraints,
|
MatchInstMapAndConstraintsImpl &MapAndConstraints,
|
||||||
unsigned &OrigErrorInfo, bool matchingInlineAsm = false) {
|
unsigned &OrigErrorInfo, bool matchingInlineAsm = false) {
|
||||||
OrigErrorInfo = ~0x0;
|
OrigErrorInfo = ~0x0;
|
||||||
return true;
|
return true;
|
||||||
@ -117,7 +121,7 @@ public:
|
|||||||
|
|
||||||
virtual void convertToMapAndConstraints(unsigned Kind,
|
virtual void convertToMapAndConstraints(unsigned Kind,
|
||||||
const SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
const SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||||
SmallVectorImpl<std::pair< unsigned, std::string > > &MapAndConstraints) = 0;
|
MatchInstMapAndConstraintsImpl &MapAndConstraints) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
@ -7480,7 +7480,7 @@ MatchAndEmitInstruction(SMLoc IDLoc,
|
|||||||
unsigned Kind;
|
unsigned Kind;
|
||||||
unsigned ErrorInfo;
|
unsigned ErrorInfo;
|
||||||
unsigned MatchResult;
|
unsigned MatchResult;
|
||||||
SmallVector<std::pair< unsigned, std::string >, 4> MapAndConstraints;
|
MatchInstMapAndConstraints MapAndConstraints;
|
||||||
MatchResult = MatchInstructionImpl(Operands, Kind, Inst,
|
MatchResult = MatchInstructionImpl(Operands, Kind, Inst,
|
||||||
MapAndConstraints, ErrorInfo,
|
MapAndConstraints, ErrorInfo,
|
||||||
/*matchingInlineAsm*/ false);
|
/*matchingInlineAsm*/ false);
|
||||||
|
@ -318,7 +318,7 @@ MatchAndEmitInstruction(SMLoc IDLoc,
|
|||||||
MCInst Inst;
|
MCInst Inst;
|
||||||
unsigned Kind;
|
unsigned Kind;
|
||||||
unsigned ErrorInfo;
|
unsigned ErrorInfo;
|
||||||
SmallVector<std::pair< unsigned, std::string >, 4> MapAndConstraints;
|
MatchInstMapAndConstraints MapAndConstraints;
|
||||||
switch (MatchInstructionImpl(Operands, Kind, Inst, MapAndConstraints,
|
switch (MatchInstructionImpl(Operands, Kind, Inst, MapAndConstraints,
|
||||||
ErrorInfo, /*matchingInlineAsm*/ false)) {
|
ErrorInfo, /*matchingInlineAsm*/ false)) {
|
||||||
default: break;
|
default: break;
|
||||||
|
@ -371,7 +371,7 @@ MatchAndEmitInstruction(SMLoc IDLoc,
|
|||||||
MCInst Inst;
|
MCInst Inst;
|
||||||
unsigned Kind;
|
unsigned Kind;
|
||||||
unsigned ErrorInfo;
|
unsigned ErrorInfo;
|
||||||
SmallVector<std::pair< unsigned, std::string >, 4> MapAndConstraints;
|
MatchInstMapAndConstraints MapAndConstraints;
|
||||||
unsigned MatchResult = MatchInstructionImpl(Operands, Kind, Inst,
|
unsigned MatchResult = MatchInstructionImpl(Operands, Kind, Inst,
|
||||||
MapAndConstraints, ErrorInfo,
|
MapAndConstraints, ErrorInfo,
|
||||||
/*matchingInlineAsm*/ false);
|
/*matchingInlineAsm*/ false);
|
||||||
|
@ -69,7 +69,7 @@ private:
|
|||||||
bool MatchInstruction(SMLoc IDLoc,
|
bool MatchInstruction(SMLoc IDLoc,
|
||||||
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||||
MCStreamer &Out, unsigned &Kind, unsigned &Opcode,
|
MCStreamer &Out, unsigned &Kind, unsigned &Opcode,
|
||||||
SmallVectorImpl<std::pair< unsigned, std::string > > &MapAndConstraints,
|
MatchInstMapAndConstraintsImpl &MapAndConstraints,
|
||||||
unsigned &OrigErrorInfo, bool matchingInlineAsm = false);
|
unsigned &OrigErrorInfo, bool matchingInlineAsm = false);
|
||||||
|
|
||||||
/// isSrcOp - Returns true if operand is either (%rsi) or %ds:%(rsi)
|
/// isSrcOp - Returns true if operand is either (%rsi) or %ds:%(rsi)
|
||||||
@ -1526,7 +1526,7 @@ MatchAndEmitInstruction(SMLoc IDLoc,
|
|||||||
unsigned Kind;
|
unsigned Kind;
|
||||||
unsigned Opcode;
|
unsigned Opcode;
|
||||||
unsigned ErrorInfo;
|
unsigned ErrorInfo;
|
||||||
SmallVector<std::pair< unsigned, std::string >, 4> MapAndConstraints;
|
MatchInstMapAndConstraints MapAndConstraints;
|
||||||
bool Error = MatchInstruction(IDLoc, Operands, Out, Kind, Opcode,
|
bool Error = MatchInstruction(IDLoc, Operands, Out, Kind, Opcode,
|
||||||
MapAndConstraints, ErrorInfo);
|
MapAndConstraints, ErrorInfo);
|
||||||
return Error;
|
return Error;
|
||||||
@ -1631,7 +1631,7 @@ MatchInstruction(SMLoc IDLoc,
|
|||||||
unsigned Match1, Match2, Match3, Match4;
|
unsigned Match1, Match2, Match3, Match4;
|
||||||
unsigned tKind;
|
unsigned tKind;
|
||||||
|
|
||||||
SmallVector<std::pair< unsigned, std::string >, 4> tMapAndConstraints[4];
|
MatchInstMapAndConstraints tMapAndConstraints[4];
|
||||||
Match1 = MatchInstructionImpl(Operands, tKind, Inst, tMapAndConstraints[0],
|
Match1 = MatchInstructionImpl(Operands, tKind, Inst, tMapAndConstraints[0],
|
||||||
ErrorInfoIgnore, isParsingIntelSyntax());
|
ErrorInfoIgnore, isParsingIntelSyntax());
|
||||||
if (Match1 == Match_Success) Kind = tKind;
|
if (Match1 == Match_Success) Kind = tKind;
|
||||||
|
@ -1716,9 +1716,9 @@ static void emitConvertFuncs(CodeGenTarget &Target, StringRef ClassName,
|
|||||||
OpOS << "void " << Target.getName() << ClassName << "::\n"
|
OpOS << "void " << Target.getName() << ClassName << "::\n"
|
||||||
<< "convertToMapAndConstraints(unsigned Kind,\n";
|
<< "convertToMapAndConstraints(unsigned Kind,\n";
|
||||||
OpOS.indent(27);
|
OpOS.indent(27);
|
||||||
OpOS << "const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n"
|
OpOS << "const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n";
|
||||||
<< " SmallVectorImpl<std::pair< unsigned, std::string > >"
|
OpOS.indent(27);
|
||||||
<< " &MapAndConstraints) {\n"
|
OpOS << "MatchInstMapAndConstraintsImpl &MapAndConstraints) {\n"
|
||||||
<< " assert(Kind < CVT_NUM_SIGNATURES && \"Invalid signature!\");\n"
|
<< " assert(Kind < CVT_NUM_SIGNATURES && \"Invalid signature!\");\n"
|
||||||
<< " unsigned NumMCOperands = 0;\n"
|
<< " unsigned NumMCOperands = 0;\n"
|
||||||
<< " const uint8_t *Converter = ConversionTable[Kind];\n"
|
<< " const uint8_t *Converter = ConversionTable[Kind];\n"
|
||||||
@ -2606,15 +2606,16 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
|
|||||||
<< " const SmallVectorImpl<MCParsedAsmOperand*> "
|
<< " const SmallVectorImpl<MCParsedAsmOperand*> "
|
||||||
<< "&Operands);\n";
|
<< "&Operands);\n";
|
||||||
OS << " void convertToMapAndConstraints(unsigned Kind,\n ";
|
OS << " void convertToMapAndConstraints(unsigned Kind,\n ";
|
||||||
OS << " const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n"
|
OS << " const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n";
|
||||||
<< " SmallVectorImpl<std::pair< unsigned, std::string > >"
|
OS.indent(29);
|
||||||
<< " &MapAndConstraints);\n";
|
OS << "MatchInstMapAndConstraintsImpl &MapAndConstraints);\n";
|
||||||
OS << " bool mnemonicIsValid(StringRef Mnemonic);\n";
|
OS << " bool mnemonicIsValid(StringRef Mnemonic);\n";
|
||||||
OS << " unsigned MatchInstructionImpl(\n"
|
OS << " unsigned MatchInstructionImpl(\n";
|
||||||
<< " const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n"
|
OS.indent(27);
|
||||||
<< " unsigned &Kind, MCInst &Inst,\n"
|
OS << "const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n"
|
||||||
<< " SmallVectorImpl<std::pair< unsigned, std::string > > "
|
<< " unsigned &Kind, MCInst &Inst,\n";
|
||||||
<< "&MapAndConstraints,\n"
|
OS.indent(30);
|
||||||
|
OS << "MatchInstMapAndConstraintsImpl &MapAndConstraints,\n"
|
||||||
<< " unsigned &ErrorInfo,"
|
<< " unsigned &ErrorInfo,"
|
||||||
<< " bool matchingInlineAsm,\n"
|
<< " bool matchingInlineAsm,\n"
|
||||||
<< " unsigned VariantID = 0);\n";
|
<< " unsigned VariantID = 0);\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user