summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitd9f952948e7f17a13b6068818238e66cf9ff7e2b (patch)
tree7cf39d7cad3e21bfee3d71ec60e3e47372d2efa8 /llvm/tools/llvm-mc/AsmParser.h
parent02bec55199b5266faed073253728c7e2c7c25e52 (diff)
downloadbcm5719-llvm-d9f952948e7f17a13b6068818238e66cf9ff7e2b.tar.gz
bcm5719-llvm-d9f952948e7f17a13b6068818238e66cf9ff7e2b.zip
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. llvm-svn: 78423
Diffstat (limited to 'llvm/tools/llvm-mc/AsmParser.h')
-rw-r--r--llvm/tools/llvm-mc/AsmParser.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/llvm/tools/llvm-mc/AsmParser.h b/llvm/tools/llvm-mc/AsmParser.h
index 7a4c8322e5c..c6f6f63e482 100644
--- a/llvm/tools/llvm-mc/AsmParser.h
+++ b/llvm/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
OpenPOWER on IntegriCloud