summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-08-09 22:04:55 +0000
committerChad Rosier <mcrosier@apple.com>2012-08-09 22:04:55 +0000
commit3246176838a47fa088b98772d4899063a9b7f731 (patch)
tree46d4eec488c8d6b6b6653c798f3dc598d6d712ab /include
parentf5ecf02d598ef8485f273af2c1e1122af2241198 (diff)
downloadllvm-3246176838a47fa088b98772d4899063a9b7f731.tar.gz
llvm-3246176838a47fa088b98772d4899063a9b7f731.tar.bz2
llvm-3246176838a47fa088b98772d4899063a9b7f731.tar.xz
[ms-inline asm] Extend the MC AsmParser API to match MCInsts (but not emit).
This new API will be used by clang to parse ms-style inline asms. One goal of this project is to use this style of inline asm for targets other then x86. Therefore, this API needs to be implemented for non-x86 targets at some point in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCTargetAsmParser.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/MC/MCTargetAsmParser.h b/include/llvm/MC/MCTargetAsmParser.h
index 4e3fd0d3a9..929a2042ca 100644
--- a/include/llvm/MC/MCTargetAsmParser.h
+++ b/include/llvm/MC/MCTargetAsmParser.h
@@ -79,6 +79,19 @@ public:
/// \param DirectiveID - the identifier token of the directive.
virtual bool ParseDirective(AsmToken DirectiveID) = 0;
+ /// MatchInstruction - Recognize a series of operands of a parsed instruction
+ /// as an actual MCInst. This returns false on success and returns true on
+ /// failure to match.
+ ///
+ /// On failure, the target parser is responsible for emitting a diagnostic
+ /// explaining the match failure.
+ virtual bool
+ MatchInstruction(SMLoc IDLoc,
+ SmallVectorImpl<MCParsedAsmOperand*> &Operands,
+ SmallVectorImpl<MCInst> &MCInsts) {
+ return true;
+ }
+
/// MatchAndEmitInstruction - Recognize a series of operands of a parsed
/// instruction as an actual MCInst and emit it to the specified MCStreamer.
/// This returns false on success and returns true on failure to match.