aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-01-25 22:27:48 +0000
committerJohn McCall <rjmccall@apple.com>2010-01-25 22:27:48 +0000
commit7a6ae743b2ecfdfadadf7df53b569a9a3871a8fd (patch)
tree26efa9bf5eecfe24b3b9144f91660eeb9b8cb99c /lib/Parse/Parser.cpp
parent616c1738099ec52e1973197b8b9447df92461d3f (diff)
Warn on top-level 'asm volatile' (instead of misparsing it).
"Fixes" rdar://problem/7574870 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94458 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r--lib/Parse/Parser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index f2bc303acd..8ae85e3c26 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -835,6 +835,11 @@ Parser::OwningExprResult Parser::ParseSimpleAsm(SourceLocation *EndLoc) {
assert(Tok.is(tok::kw_asm) && "Not an asm!");
SourceLocation Loc = ConsumeToken();
+ if (Tok.is(tok::kw_volatile)) {
+ Diag(Tok, diag::warn_file_asm_volatile);
+ ConsumeToken();
+ }
+
if (Tok.isNot(tok::l_paren)) {
Diag(Tok, diag::err_expected_lparen_after) << "asm";
return ExprError();