diff options
| author | Nirav Dave <niravd@google.com> | 2016-08-02 15:08:52 +0000 |
|---|---|---|
| committer | Nirav Dave <niravd@google.com> | 2016-08-02 15:08:52 +0000 |
| commit | f94cd9df0f88b113fa3a3b7461847621f36734ca (patch) | |
| tree | bd0b4b47d149556a2869ed61e4b0ac55eb0235b2 /llvm/lib | |
| parent | c558fe203f8787ca1f7290305ce5596b0dd4b00f (diff) | |
| download | bcm5719-llvm-f94cd9df0f88b113fa3a3b7461847621f36734ca.tar.gz bcm5719-llvm-f94cd9df0f88b113fa3a3b7461847621f36734ca.zip | |
Revert "[MC] Fix handling of end-of-line preprocessor comments"
Causes TSan failure on PPC64
This reverts commit r277459.
llvm-svn: 277468
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 6d3240a3e11..d85f1c613c7 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -262,23 +262,9 @@ public: return false; } - bool parseEOL(const Twine &ErrMsg) { - if (getTok().getKind() == AsmToken::Hash) { - StringRef CommentStr = parseStringToEndOfStatement(); - Lexer.Lex(); - Lexer.UnLex(AsmToken(AsmToken::EndOfStatement, CommentStr)); - } - if (getTok().getKind() != AsmToken::EndOfStatement) - return TokError(ErrMsg); - Lex(); - return false; - } - /// parseToken - If current token has the specified kind, eat it and /// return success. Otherwise, emit the specified error and return failure. bool parseToken(AsmToken::TokenKind T, const Twine &ErrMsg) { - if (T == AsmToken::EndOfStatement) - return parseEOL(ErrMsg); if (getTok().getKind() != T) return TokError(ErrMsg); Lex(); @@ -1423,16 +1409,6 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info, Lex(); return false; } - if (Lexer.is(AsmToken::Hash)) { - // Seeing a hash here means that it was an end-of-line comment in - // an asm syntax where hash's are not comment and the previous - // statement parser did not check the end of statement. Relex as - // EndOfStatement. - StringRef CommentStr = parseStringToEndOfStatement(); - Lexer.Lex(); - Lexer.UnLex(AsmToken(AsmToken::EndOfStatement, CommentStr)); - return false; - } // Statements always start with an identifier. AsmToken ID = getTok(); SMLoc IDLoc = ID.getLoc(); @@ -1566,16 +1542,6 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info, if (!Sym->isUndefined() || Sym->isVariable()) return Error(IDLoc, "invalid symbol redefinition"); - // End of Labels should be treated as end of line for lexing - // purposes but that information is not available to the Lexer who - // does not understand Labels. This may cause us to see a Hash - // here instead of a preprocessor line comment. - if (getTok().is(AsmToken::Hash)) { - StringRef CommentStr = parseStringToEndOfStatement(); - Lexer.Lex(); - Lexer.UnLex(AsmToken(AsmToken::EndOfStatement, CommentStr)); - } - // Consume any end of statement token, if present, to avoid spurious // AddBlankLine calls(). if (getTok().is(AsmToken::EndOfStatement)) { |

