From 28d89bd652e59441adbb8f68e3e9ac3ea621cbfa Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Mon, 4 Jan 2010 23:01:10 +0000 Subject: 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 --- clang/lib/Sema/SemaDecl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/lib') 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(S)) { + if (AS->isMSAsm()) { + HasFakeEdge = true; + HasLiveReturn = true; + continue; + } + } + bool NoReturnEdge = false; if (CallExpr *C = dyn_cast(S)) { Expr *CEE = C->getCallee()->IgnoreParenCasts(); -- cgit v1.2.3