summaryrefslogtreecommitdiff
path: root/include/llvm/MC
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-10-18 15:49:34 +0000
committerChad Rosier <mcrosier@apple.com>2012-10-18 15:49:34 +0000
commitb1f8c139c5c1b1a50bf65b8141dd57434c793e54 (patch)
treed0cd5e226d025af0e98002e7912c4a7bb172c8fa /include/llvm/MC
parent6c28a7eec8d1794fb5476cd9fe14affb479ed1d9 (diff)
[ms-inline asm] Move most of the AsmParsing logic in clang back into the MC
layer. Add the ParseMSInlineAsm() function, which is the new interface to clang. Also expose the new MCAsmParserSemaCallback interface, which is used by the back-end to do name lookup in Sema. Finally, remove the now defunct APIs introduced in r165946. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166183 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC')
-rw-r--r--include/llvm/MC/MCParser/MCAsmParser.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/include/llvm/MC/MCParser/MCAsmParser.h b/include/llvm/MC/MCParser/MCAsmParser.h
index 52948f749d6..ea20c15fe18 100644
--- a/include/llvm/MC/MCParser/MCAsmParser.h
+++ b/include/llvm/MC/MCParser/MCAsmParser.h
@@ -20,6 +20,8 @@ class MCAsmLexer;
class MCAsmParserExtension;
class MCContext;
class MCExpr;
+class MCInstPrinter;
+class MCInstrInfo;
class MCParsedAsmOperand;
class MCStreamer;
class MCTargetAsmParser;
@@ -29,6 +31,13 @@ class SourceMgr;
class StringRef;
class Twine;
+/// MCAsmParserSemaCallback - Generic Sema callback for assembly parser.
+class MCAsmParserSemaCallback {
+public:
+ virtual void *LookupInlineAsmIdentifier(StringRef Name, void *Loc,
+ void **IdentifierInfoPtr) = 0;
+};
+
/// MCAsmParser - Generic assembler parser interface, for use by target specific
/// assembly parsers.
class MCAsmParser {
@@ -77,25 +86,20 @@ public:
virtual void setParsingInlineAsm(bool V) = 0;
virtual bool isParsingInlineAsm() = 0;
+ /// ParseMSInlineAsm - Parse ms-style inline assembly.
+ virtual bool ParseMSInlineAsm(void *AsmLoc, std::string &AsmString,
+ unsigned &NumOutputs, unsigned &NumInputs,
+ SmallVectorImpl<void *> &Names,
+ SmallVectorImpl<std::string> &Constraints,
+ SmallVectorImpl<void *> &Exprs,
+ SmallVectorImpl<std::string> &Clobbers,
+ const MCInstrInfo *MII,
+ const MCInstPrinter *IP,
+ MCAsmParserSemaCallback &SI) = 0;
+
/// ParseStatement - Parse the next statement.
virtual bool ParseStatement() = 0;
- /// getNumParsedOperands - Returns the number of MCAsmParsedOperands from the
- /// previously parsed statement.
- virtual unsigned getNumParsedOperands() = 0;
-
- /// getParsedOperand - Get a MCAsmParsedOperand.
- virtual MCParsedAsmOperand &getParsedOperand(unsigned OpNum) = 0;
-
- /// freeParsedOperands - Free the MCAsmParsedOperands.
- virtual void freeParsedOperands() = 0;
-
- /// isInstruction - Was the previously parsed statement an instruction?
- virtual bool isInstruction() = 0;
-
- /// getOpcode - Get the opcode from the previously parsed instruction.
- virtual unsigned getOpcode() = 0;
-
/// Warning - Emit a warning at the location \p L, with the message \p Msg.
///
/// \return The return value is true, if warnings are fatal.