diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-05-23 18:36:34 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-05-23 18:36:34 +0000 |
commit | 01777ff0941cad56f8b5efca0b5cdd27f5df176c (patch) | |
tree | 77070a5963754df34822ea9a1b0e3dafe3412009 /lib/MC | |
parent | fdb5a8617996a20370756962e34c2e80176d6e87 (diff) | |
download | external_llvm-01777ff0941cad56f8b5efca0b5cdd27f5df176c.zip external_llvm-01777ff0941cad56f8b5efca0b5cdd27f5df176c.tar.gz external_llvm-01777ff0941cad56f8b5efca0b5cdd27f5df176c.tar.bz2 |
llvm-mc: Use AddBlankLine in asm parser. This makes transliteration match the input much more closely, and also makes the API calls from the AsmParser and CodeGen line up better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104466 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/MCParser/AsmParser.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index 0134519..0d6eaec 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -432,6 +432,7 @@ bool AsmParser::ParseBinOpRHS(unsigned Precedence, const MCExpr *&Res, /// ::= Label* Identifier OperandList* EndOfStatement bool AsmParser::ParseStatement() { if (Lexer.is(AsmToken::EndOfStatement)) { + Out.AddBlankLine(); Lex(); return false; } @@ -506,6 +507,14 @@ bool AsmParser::ParseStatement() { // Emit the label. Out.EmitLabel(Sym); + // Consume any end of statement token, if present, to avoid spurious + // AddBlankLine calls(). + if (Lexer.is(AsmToken::EndOfStatement)) { + Lex(); + if (Lexer.is(AsmToken::Eof)) + return false; + } + return ParseStatement(); } |