diff options
author | Mike Stump <mrs@apple.com> | 2009-07-27 21:33:40 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-07-27 21:33:40 +0000 |
commit | fd350b5b4ae557d6b74899b945e77508f33149a9 (patch) | |
tree | e34bd5bf39f31802c69d9fcde2887e2833954c47 /lib/Sema/SemaDecl.cpp | |
parent | bc0a2226c7fcd18b29b6846049e2cfcb872d3593 (diff) |
Add builtin knowledge about longjmp being noreturn. Add printing for
the noreturn attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77253 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index bf2d3ccec2..d168a907a0 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -3705,7 +3705,9 @@ void Sema::AddKnownFunctionAttributes(FunctionDecl *FD) { if (!FD->getAttr<FormatAttr>()) FD->addAttr(::new (Context) FormatAttr("printf", 2, Name->isStr("vasprintf") ? 0 : 3)); - } + } else if (Name->isStr("longjmp") && + !FD->hasAttr<NoReturnAttr>()) + FD->addAttr(::new (Context) NoReturnAttr()); } TypedefDecl *Sema::ParseTypedefDecl(Scope *S, Declarator &D, QualType T) { |