summaryrefslogtreecommitdiff
path: root/tools/llvm-mc/AsmParser.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2009-07-13 23:15:14 +0000
committerKevin Enderby <enderby@apple.com>2009-07-13 23:15:14 +0000
commit5f1f0b8f7e7087d456ddc3efdb4bed21a4ae359c (patch)
treedc9d7b87dc1fcbc62ab9711514782ee4ff11be0f /tools/llvm-mc/AsmParser.cpp
parent45f91b70c4caedc05427d48963f2664aacf45d9e (diff)
downloadllvm-5f1f0b8f7e7087d456ddc3efdb4bed21a4ae359c.tar.gz
llvm-5f1f0b8f7e7087d456ddc3efdb4bed21a4ae359c.tar.bz2
llvm-5f1f0b8f7e7087d456ddc3efdb4bed21a4ae359c.tar.xz
Added llvm-mc support for parsing the .abort directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75545 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-mc/AsmParser.cpp')
-rw-r--r--tools/llvm-mc/AsmParser.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/llvm-mc/AsmParser.cpp b/tools/llvm-mc/AsmParser.cpp
index fe9d4f3352..c105801632 100644
--- a/tools/llvm-mc/AsmParser.cpp
+++ b/tools/llvm-mc/AsmParser.cpp
@@ -529,6 +529,8 @@ bool AsmParser::ParseStatement() {
if (!strcmp(IDVal, ".subsections_via_symbols"))
return ParseDirectiveDarwinSubsectionsViaSymbols();
+ if (!strcmp(IDVal, ".abort"))
+ return ParseDirectiveAbort();
Warning(IDLoc, "ignoring directive for now");
EatToEndOfStatement();
@@ -1068,3 +1070,26 @@ bool AsmParser::ParseDirectiveDarwinSubsectionsViaSymbols() {
return false;
}
+
+/// ParseDirectiveAbort
+/// ::= .abort [ "abort_string" ]
+bool AsmParser::ParseDirectiveAbort() {
+ const char *Str = NULL;
+ if (Lexer.isNot(asmtok::EndOfStatement)) {
+ if (Lexer.isNot(asmtok::String))
+ return TokError("expected string in '.abort' directive");
+
+ Str = Lexer.getCurStrVal();
+
+ Lexer.Lex();
+ }
+
+ if (Lexer.isNot(asmtok::EndOfStatement))
+ return TokError("unexpected token in '.abort' directive");
+
+ Lexer.Lex();
+
+ Out.AbortAssembly(Str);
+
+ return false;
+}