diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-07-21 05:22:47 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-07-21 05:22:47 +0000 |
commit | bc5cb8a5fe2b88f917d47ceb58b53696a121e57e (patch) | |
tree | 35f9fd4260fb6e779ec96ca365367b1dbd777c31 /lib/Sema/AnalysisBasedWarnings.cpp | |
parent | 697d05d579d9f668ac29ab9d2a1bf9a0a45ee5d0 (diff) |
Simplify passing of CFGBuildOptions around for AnalysisContext. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135666 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/AnalysisBasedWarnings.cpp')
-rw-r--r-- | lib/Sema/AnalysisBasedWarnings.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp index c0e271590d..06e42b7728 100644 --- a/lib/Sema/AnalysisBasedWarnings.cpp +++ b/lib/Sema/AnalysisBasedWarnings.cpp @@ -656,10 +656,14 @@ AnalysisBasedWarnings::IssueWarnings(sema::AnalysisBasedWarnings::Policy P, const Stmt *Body = D->getBody(); assert(Body); + AnalysisContext AC(D, 0); + // Don't generate EH edges for CallExprs as we'd like to avoid the n^2 // explosion for destrutors that can result and the compile time hit. - AnalysisContext AC(D, 0, /*useUnoptimizedCFG=*/false, /*addehedges=*/false, - /*addImplicitDtors=*/true, /*addInitializers=*/true); + AC.getCFGBuildOptions().PruneTriviallyFalseEdges = true; + AC.getCFGBuildOptions().AddEHEdges = false; + AC.getCFGBuildOptions().AddInitializers = true; + AC.getCFGBuildOptions().AddImplicitDtors = true; // Force that certain expressions appear as CFGElements in the CFG. This // is used to speed up various analyses. @@ -667,14 +671,16 @@ AnalysisBasedWarnings::IssueWarnings(sema::AnalysisBasedWarnings::Policy P, // prototyping, but we need a way for analyses to say what expressions they // expect to always be CFGElements and then fill in the BuildOptions // appropriately. This is essentially a layering violation. - CFG::BuildOptions &buildOptions = AC.getCFGBuildOptions(); - buildOptions.setAlwaysAdd(Stmt::BinaryOperatorClass); - buildOptions.setAlwaysAdd(Stmt::BlockExprClass); - buildOptions.setAlwaysAdd(Stmt::CStyleCastExprClass); - buildOptions.setAlwaysAdd(Stmt::DeclRefExprClass); - buildOptions.setAlwaysAdd(Stmt::ImplicitCastExprClass); - buildOptions.setAlwaysAdd(Stmt::UnaryOperatorClass); - + AC.getCFGBuildOptions() + .setAlwaysAdd(Stmt::BinaryOperatorClass) + .setAlwaysAdd(Stmt::BlockExprClass) + .setAlwaysAdd(Stmt::CStyleCastExprClass) + .setAlwaysAdd(Stmt::DeclRefExprClass) + .setAlwaysAdd(Stmt::ImplicitCastExprClass) + .setAlwaysAdd(Stmt::UnaryOperatorClass); + + // Construct the analysis context with the specified CFG build options. + // Emit delayed diagnostics. if (!fscope->PossiblyUnreachableDiags.empty()) { bool analyzed = false; |