[llvm-branch-commits] [llvm-branch] r104500 - /llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp
Daniel Dunbar
daniel at zuster.org
Mon May 24 08:17:35 PDT 2010
Author: ddunbar
Date: Mon May 24 10:17:35 2010
New Revision: 104500
URL: http://llvm.org/viewvc/llvm-project?rev=104500&view=rev
Log:
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.
Modified:
llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp
Modified: llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp?rev=104500&r1=104499&r2=104500&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp Mon May 24 10:17:35 2010
@@ -432,6 +432,7 @@
/// ::= Label* Identifier OperandList* EndOfStatement
bool AsmParser::ParseStatement() {
if (Lexer.is(AsmToken::EndOfStatement)) {
+ Out.AddBlankLine();
Lex();
return false;
}
@@ -506,6 +507,14 @@
// 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();
}
More information about the llvm-branch-commits
mailing list