OSDN Git Service

[MC] Fix handling of end-of-line preprocessor comments
authorNirav Dave <niravd@google.com>
Tue, 2 Aug 2016 01:05:29 +0000 (01:05 +0000)
committerNirav Dave <niravd@google.com>
Tue, 2 Aug 2016 01:05:29 +0000 (01:05 +0000)
commit6fc4119b60dfeea3eb5382c15869c94e9c81fcfd
treec2037aa3fc1c41a3c21ed839e416f88341de6cc6
parent0e6a15a292a0eda03858642e3bd7b7bdb94fd7c3
[MC] Fix handling of end-of-line preprocessor comments

Summary:
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@277407 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/MCParser/AsmParser.cpp
test/MC/ARM/preserve-comments-arm.s [new file with mode: 0644]