diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-03-23 00:13:23 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-03-23 00:13:23 +0000 |
commit | d064fdc4b7b64ca55b40b70490c79d6f569df78e (patch) | |
tree | 07a0c6fb87b558bbfb070a1aba01717486b9fe47 /lib/Sema/SemaDecl.cpp | |
parent | 22f757b38da3fc9f17ea9e99524064fdfbca3456 (diff) |
Only perform CFG-based warnings on 'static inline' functions that
are called (transitively) by regular functions/blocks within a
translation untion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99233 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 2b1ad0af49..aaf39ef1f9 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -14,7 +14,6 @@ #include "Sema.h" #include "SemaInit.h" #include "Lookup.h" -#include "AnalysisBasedWarnings.h" #include "clang/AST/APValue.h" #include "clang/AST/ASTConsumer.h" #include "clang/AST/ASTContext.h" @@ -4276,7 +4275,7 @@ Sema::DeclPtrTy Sema::ActOnFinishFunctionBody(DeclPtrTy D, StmtArg BodyArg, else FD = dyn_cast_or_null<FunctionDecl>(dcl); - sema::AnalysisBasedWarnings W(*this); + sema::AnalysisBasedWarnings::Policy WP = AnalysisWarnings.getDefaultPolicy(); if (FD) { FD->setBody(Body); @@ -4284,7 +4283,7 @@ Sema::DeclPtrTy Sema::ActOnFinishFunctionBody(DeclPtrTy D, StmtArg BodyArg, // C and C++ allow for main to automagically return 0. // Implements C++ [basic.start.main]p5 and C99 5.1.2.2.3. FD->setHasImplicitReturnZero(true); - W.disableCheckFallThrough(); + WP.disableCheckFallThrough(); } if (!FD->isInvalidDecl()) @@ -4381,7 +4380,7 @@ Sema::DeclPtrTy Sema::ActOnFinishFunctionBody(DeclPtrTy D, StmtArg BodyArg, ObjCMethodDecl *MD = cast<ObjCMethodDecl>(dcl); ResultType = MD->getResultType(); } - W.IssueWarnings(dcl); + AnalysisWarnings.IssueWarnings(WP, dcl); } assert(ExprTemporaries.empty() && "Leftover temporaries in function"); |