diff options
author | Mike Stump <mrs@apple.com> | 2010-01-04 23:01:10 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2010-01-04 23:01:10 +0000 |
commit | 28d89bd652e59441adbb8f68e3e9ac3ea621cbfa (patch) | |
tree | e09aa4b453293ad878d66b78788e56616d07be32 | |
parent | 1a51a211c6f3faba5718b22c3482b310417121b9 (diff) | |
download | bcm5719-llvm-28d89bd652e59441adbb8f68e3e9ac3ea621cbfa.tar.gz bcm5719-llvm-28d89bd652e59441adbb8f68e3e9ac3ea621cbfa.zip |
Avoid warnings for functions that return a value using MS-style inline
assembly code. This avoids changing the bahvior when normal asm("")
statements are used.
The type of code affected would be:
void* t4(void) { __asm mov eax, fs:[0x10] }
I hope people like this version, if not, let me know.
llvm-svn: 92531
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 8 | ||||
-rw-r--r-- | clang/test/Sema/ms-fuzzy-asm.c | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 30f90400007..a15c5fea213 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -1345,6 +1345,14 @@ Sema::ControlFlowKind Sema::CheckFallThrough(Stmt *Root) { HasFakeEdge = true; continue; } + if (const AsmStmt *AS = dyn_cast<AsmStmt>(S)) { + if (AS->isMSAsm()) { + HasFakeEdge = true; + HasLiveReturn = true; + continue; + } + } + bool NoReturnEdge = false; if (CallExpr *C = dyn_cast<CallExpr>(S)) { Expr *CEE = C->getCallee()->IgnoreParenCasts(); diff --git a/clang/test/Sema/ms-fuzzy-asm.c b/clang/test/Sema/ms-fuzzy-asm.c index 9ace6569348..250e3222564 100644 --- a/clang/test/Sema/ms-fuzzy-asm.c +++ b/clang/test/Sema/ms-fuzzy-asm.c @@ -1,5 +1,4 @@ // RUN: %clang_cc1 %s -verify -fms-extensions -// XFAIL: * #define M __asm int 0x2c #define M2 int |