diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-10-25 20:41:34 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-10-25 20:41:34 +0000 |
commit | 6a020a71173a3ea7738a9df69982e85ddbfe0303 (patch) | |
tree | fb7b62a0e688224d0cc04d755bc382f190956b56 /include/llvm | |
parent | 61131ab15fd593a2e295d79fe2714e7bc21f2ec8 (diff) | |
download | external_llvm-6a020a71173a3ea7738a9df69982e85ddbfe0303.zip external_llvm-6a020a71173a3ea7738a9df69982e85ddbfe0303.tar.gz external_llvm-6a020a71173a3ea7738a9df69982e85ddbfe0303.tar.bz2 |
[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
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/MC/MCTargetAsmParser.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/include/llvm/MC/MCTargetAsmParser.h b/include/llvm/MC/MCTargetAsmParser.h index 05537f9..97ca785 100644 --- a/include/llvm/MC/MCTargetAsmParser.h +++ b/include/llvm/MC/MCTargetAsmParser.h @@ -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 |