aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-mc/AsmParser.h
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2009-08-07 22:46:00 +0000
committerKevin Enderby <enderby@apple.com>2009-08-07 22:46:00 +0000
commitc114ed711eca29e735e10956883a1010c22d7942 (patch)
tree9e171faa5b534c3cc797fd27b7d40caeacc003a7 /tools/llvm-mc/AsmParser.h
parentb124be4f979acb8b3584de392bf28786fd8a5e76 (diff)
Added Mac OS X assembler style conditional assembly. I may come back and see if
I can clean this up a bit more and do way with the TheCondState and just use the top element on the TheCondStack if not empty. Also may tweak the code around ParseConditionalAssemblyDirectives() to simplify the AsmParser code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78423 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-mc/AsmParser.h')
-rw-r--r--tools/llvm-mc/AsmParser.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/llvm-mc/AsmParser.h b/tools/llvm-mc/AsmParser.h
index 7a4c8322e5..c6f6f63e48 100644
--- a/tools/llvm-mc/AsmParser.h
+++ b/tools/llvm-mc/AsmParser.h
@@ -14,12 +14,15 @@
#ifndef ASMPARSER_H
#define ASMPARSER_H
+#include <vector>
#include "AsmLexer.h"
+#include "AsmCond.h"
#include "llvm/MC/MCAsmParser.h"
#include "llvm/MC/MCStreamer.h"
namespace llvm {
class AsmExpr;
+class AsmCond;
class MCContext;
class MCInst;
class MCStreamer;
@@ -33,7 +36,10 @@ private:
MCContext &Ctx;
MCStreamer &Out;
TargetAsmParser *TargetParser;
-
+
+ AsmCond TheCondState;
+ std::vector<AsmCond> TheCondStack;
+
public:
AsmParser(SourceMgr &_SM, MCContext &_Ctx, MCStreamer &_Out)
: Lexer(_SM), Ctx(_Ctx), Out(_Out), TargetParser(0) {}
@@ -67,6 +73,8 @@ private:
bool TokError(const char *Msg);
+ bool ParseConditionalAssemblyDirectives(StringRef Directive,
+ SMLoc DirectiveLoc);
void EatToEndOfStatement();
bool ParseAssignment(const StringRef &Name, bool IsDotSet);
@@ -118,6 +126,12 @@ private:
bool ParseDirectiveAbort(); // ".abort"
bool ParseDirectiveInclude(); // ".include"
+
+ bool ParseDirectiveIf(SMLoc DirectiveLoc); // ".if"
+ bool ParseDirectiveElseIf(SMLoc DirectiveLoc); // ".elseif"
+ bool ParseDirectiveElse(SMLoc DirectiveLoc); // ".else"
+ bool ParseDirectiveEndIf(SMLoc DirectiveLoc); // .endif
+
};
} // end namespace llvm