mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-04 22:28:27 +00:00
[ms-inline asm] Add support for creating AsmRewrites in the target specific
AsmParser logic. To be used/tested in a subsequent commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166714 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -21,6 +21,39 @@ class MCParsedAsmOperand;
|
||||
class MCInst;
|
||||
template <typename T> class SmallVectorImpl;
|
||||
|
||||
namespace {
|
||||
enum AsmRewriteKind {
|
||||
AOK_Imm,
|
||||
AOK_Input,
|
||||
AOK_Output,
|
||||
AOK_SizeDirective,
|
||||
AOK_Emit,
|
||||
AOK_Skip,
|
||||
AOK_DotOperator
|
||||
};
|
||||
|
||||
struct AsmRewrite {
|
||||
AsmRewriteKind Kind;
|
||||
SMLoc Loc;
|
||||
unsigned Len;
|
||||
unsigned Val;
|
||||
public:
|
||||
AsmRewrite(AsmRewriteKind kind, SMLoc loc, unsigned len, unsigned val = 0)
|
||||
: Kind(kind), Loc(loc), Len(len), Val(val) {}
|
||||
};
|
||||
}
|
||||
|
||||
struct ParseInstructionInfo {
|
||||
|
||||
SmallVectorImpl<AsmRewrite> *AsmRewrites;
|
||||
|
||||
ParseInstructionInfo() : AsmRewrites(0) {}
|
||||
ParseInstructionInfo(SmallVectorImpl<AsmRewrite> *rewrites)
|
||||
: AsmRewrites(rewrites) {}
|
||||
|
||||
~ParseInstructionInfo() {}
|
||||
};
|
||||
|
||||
/// MCTargetAsmParser - Generic interface to target specific assembly parsers.
|
||||
class MCTargetAsmParser : public MCAsmParserExtension {
|
||||
public:
|
||||
@@ -77,7 +110,8 @@ public:
|
||||
/// \param Operands [out] - The list of parsed operands, this returns
|
||||
/// ownership of them to the caller.
|
||||
/// \return True on failure.
|
||||
virtual bool ParseInstruction(StringRef Name, SMLoc NameLoc,
|
||||
virtual bool ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
||||
SMLoc NameLoc,
|
||||
SmallVectorImpl<MCParsedAsmOperand*> &Operands) = 0;
|
||||
|
||||
/// ParseDirective - Parse a target specific assembler directive
|
||||
|
Reference in New Issue
Block a user