diff options
author | John McCall <rjmccall@apple.com> | 2010-01-25 23:12:50 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-01-25 23:12:50 +0000 |
commit | 5cb528746786f29399f9a9db7bb89c1d0dd4f858 (patch) | |
tree | 42fd88c2fc886d18848768218f7bf69538003713 /clang/lib/Parse/Parser.cpp | |
parent | 5542c1edf9019bbdacb4701f7e87ea5b438f0d85 (diff) | |
download | bcm5719-llvm-5cb528746786f29399f9a9db7bb89c1d0dd4f858.tar.gz bcm5719-llvm-5cb528746786f29399f9a9db7bb89c1d0dd4f858.zip |
Fixit to remove 'volatile' in file-scope 'asm volatile'.
llvm-svn: 94466
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r-- | clang/lib/Parse/Parser.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index 8ae85e3c26a..63b0a27c08c 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -836,7 +836,12 @@ Parser::OwningExprResult Parser::ParseSimpleAsm(SourceLocation *EndLoc) { SourceLocation Loc = ConsumeToken(); if (Tok.is(tok::kw_volatile)) { - Diag(Tok, diag::warn_file_asm_volatile); + // Remove from the end of 'asm' to the end of 'volatile'. + SourceRange RemovalRange(PP.getLocForEndOfToken(Loc), + PP.getLocForEndOfToken(Tok.getLocation())); + + Diag(Tok, diag::warn_file_asm_volatile) + << CodeModificationHint::CreateRemoval(RemovalRange); ConsumeToken(); } |