diff options
Diffstat (limited to 'tools/llvm-mc/AsmParser.cpp')
-rw-r--r-- | tools/llvm-mc/AsmParser.cpp | 25 |
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; +} |