[cfe-commits] r92531 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/Sema/ms-fuzzy-asm.c
Mike Stump
mrs at apple.com
Mon Jan 4 15:01:10 PST 2010
Author: mrs
Date: Mon Jan 4 17:01:10 2010
New Revision: 92531
URL: http://llvm.org/viewvc/llvm-project?rev=92531&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/test/Sema/ms-fuzzy-asm.c
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=92531&r1=92530&r2=92531&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Jan 4 17:01:10 2010
@@ -1345,6 +1345,14 @@
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();
Modified: cfe/trunk/test/Sema/ms-fuzzy-asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/ms-fuzzy-asm.c?rev=92531&r1=92530&r2=92531&view=diff
==============================================================================
--- cfe/trunk/test/Sema/ms-fuzzy-asm.c (original)
+++ cfe/trunk/test/Sema/ms-fuzzy-asm.c Mon Jan 4 17:01:10 2010
@@ -1,5 +1,4 @@
// RUN: %clang_cc1 %s -verify -fms-extensions
-// XFAIL: *
#define M __asm int 0x2c
#define M2 int
More information about the cfe-commits
mailing list