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 | 841d5e607f81bf5627e47d0c62ead29f28b5b0c2 (patch) | |
tree | 26dd88cd0a795aad248a402a5c230250a9e73e2c /lib/Parse/Parser.cpp | |
parent | 82b51cce8cea6b6bb6175c406c2ab425c91d9dc8 (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.cpp | 7 |
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(); } |