From: John McCall Date: Mon, 25 Jan 2010 23:12:50 +0000 (+0000) Subject: Fixit to remove 'volatile' in file-scope 'asm volatile'. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=841d5e607f81bf5627e47d0c62ead29f28b5b0c2;p=clang 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 --- 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(); }