1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

In llvm-mc parse a Hash token as a full line comment. Allows handling of

preprocessed .s files and matches darwin gas.  rdar://8798690
Also fix a comment on the next line of AsmParser.cpp after this new code.

llvm-svn: 122531
This commit is contained in:
Kevin Enderby 2010-12-24 00:12:02 +00:00
parent 7fc4f99084
commit ff7e68c5e7
2 changed files with 15 additions and 2 deletions

View File

@ -831,12 +831,17 @@ bool AsmParser::ParseStatement() {
return false;
}
// Statements always start with an identifier.
// Statements always start with an identifier or are a full line comment.
AsmToken ID = getTok();
SMLoc IDLoc = ID.getLoc();
StringRef IDVal;
int64_t LocalLabelVal = -1;
// GUESS allow an integer followed by a ':' as a directional local label
// A full line comment is a '#' as the first token.
if (Lexer.is(AsmToken::Hash)) {
EatToEndOfStatement();
return false;
}
// Allow an integer followed by a ':' as a directional local label.
if (Lexer.is(AsmToken::Integer)) {
LocalLabelVal = getTok().getIntVal();
if (LocalLabelVal < 0) {

View File

@ -0,0 +1,8 @@
// RUN: llvm-mc -triple arm-apple-darwin10 %s | FileCheck %s
# this is a full line comment starting at column 1
# this starting at column 2
.data
// CHECK: .long 0
.long 0
# .long 1 this line is commented out