From 841d5e607f81bf5627e47d0c62ead29f28b5b0c2 Mon Sep 17 00:00:00 2001 From: John McCall Date: Mon, 25 Jan 2010 23:12:50 +0000 Subject: [PATCH] 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 --- lib/Parse/Parser.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(); }