OSDN Git Service

[MC] Fix handling of end-of-line preprocessor comments
authorNirav Dave <niravd@google.com>
Tue, 2 Aug 2016 14:25:49 +0000 (14:25 +0000)
committerNirav Dave <niravd@google.com>
Tue, 2 Aug 2016 14:25:49 +0000 (14:25 +0000)
commit22973d396cebaa1a4fcecea949cd1f2ebc9e0a26
tree8791d3b4e40afb0b6678b7af2bd7e195ee1b5550
parent0712e11c30bc7818944c62e84fd3f702cc0677c3
[MC] Fix handling of end-of-line preprocessor comments

Recommitting after fixing test.

When parsing assembly where the line comment syntax is not hash, the
lexer cannot distinguish between hash's that start a hash line comment
and one that is part of an assembly statement and must be distinguished
during parsing. Previously, this was incompletely handled by not checking
for EndOfStatement at the end of statements and interpreting hash
prefixed statements as comments.

Change EndOfStatement Parsing to check for Hash comments and reintroduce
Hash statement parsing to catch previously handled cases.

Reviewers: rnk, majnemer

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23017

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277459 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/MCParser/AsmParser.cpp
test/MC/ARM/preserve-comments-arm.s [new file with mode: 0644]