aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-01-25 23:12:50 +0000
committerJohn McCall <rjmccall@apple.com>2010-01-25 23:12:50 +0000
commit841d5e607f81bf5627e47d0c62ead29f28b5b0c2 (patch)
tree26dd88cd0a795aad248a402a5c230250a9e73e2c /lib/Parse/Parser.cpp
parent82b51cce8cea6b6bb6175c406c2ab425c91d9dc8 (diff)
Fixit to remove 'volatile' in file-scope 'asm volatile'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94466 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r--lib/Parse/Parser.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index 8ae85e3c26..63b0a27c08 100644
--- a/lib/Parse/Parser.cpp
+++ b/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();
}