[cfe-commits] r77254 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/Sema/return.c
Mike Stump
mrs at apple.com
Mon Jul 27 14:45:16 PDT 2009
Author: mrs
Date: Mon Jul 27 16:45:16 2009
New Revision: 77254
URL: http://llvm.org/viewvc/llvm-project?rev=77254&view=rev
Log:
Add knowledge about _longjmp being noreturn.
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/test/Sema/return.c
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=77254&r1=77253&r2=77254&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Jul 27 16:45:16 2009
@@ -3705,8 +3705,8 @@
if (!FD->getAttr<FormatAttr>())
FD->addAttr(::new (Context) FormatAttr("printf", 2,
Name->isStr("vasprintf") ? 0 : 3));
- } else if (Name->isStr("longjmp") &&
- !FD->hasAttr<NoReturnAttr>())
+ } else if ((Name->isStr("longjmp") || Name->isStr("_longjmp"))
+ && !FD->hasAttr<NoReturnAttr>())
FD->addAttr(::new (Context) NoReturnAttr());
}
Modified: cfe/trunk/test/Sema/return.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/return.c?rev=77254&r1=77253&r2=77254&view=diff
==============================================================================
--- cfe/trunk/test/Sema/return.c (original)
+++ cfe/trunk/test/Sema/return.c Mon Jul 27 16:45:16 2009
@@ -200,5 +200,8 @@
#include <setjmp.h>
jmp_buf test30_j;
int test30() {
- longjmp(test30_j, 1);
+ if (j)
+ longjmp(test30_j, 1);
+ else
+ _longjmp(test30_j, 1);
}
More information about the cfe-commits
mailing list