aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorSteven Wu <stevenwu@apple.com>2015-04-28 21:49:09 +0000
committerSteven Wu <stevenwu@apple.com>2015-04-28 21:49:09 +0000
commit2baa53ace9c40140f6c7eea23b971e4da42f9350 (patch)
treec5b0ed56000dda2c4f3f30806d6d3f6a36ec102e /clang/lib/Parse/Parser.cpp
parent6d69e8c00bc1c5c06488e50823bd771c6fc02ced (diff)
downloadllvm-2baa53ace9c40140f6c7eea23b971e4da42f9350.zip
llvm-2baa53ace9c40140f6c7eea23b971e4da42f9350.tar.gz
llvm-2baa53ace9c40140f6c7eea23b971e4da42f9350.tar.bz2
Fix -fno-gnu-inline-asm doesn't catch file scope asm
Summary: FileScopeAsm should be treated the same as funcion level inline asm. -fno-gnu-inline-asm should trigger an error if file scope asm is used. I missed this case from r226340. This should not affect ms-extension because it is not allowed in the file scope. Reviewers: bob.wilson, rnk Reviewed By: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9328 llvm-svn: 236044
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r--clang/lib/Parse/Parser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index 3b56102..81adbfb 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -1253,6 +1253,10 @@ ExprResult Parser::ParseSimpleAsm(SourceLocation *EndLoc) {
assert(Tok.is(tok::kw_asm) && "Not an asm!");
SourceLocation Loc = ConsumeToken();
+ // Check if GNU-styple InlineAsm is disabled.
+ if (!getLangOpts().GNUAsm)
+ Diag(Loc, diag::err_gnu_inline_asm_disabled);
+
if (Tok.is(tok::kw_volatile)) {
// Remove from the end of 'asm' to the end of 'volatile'.
SourceRange RemovalRange(PP.getLocForEndOfToken(Loc),