diff options
author | Mike Stump <mrs@apple.com> | 2010-01-21 15:20:48 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2010-01-21 15:20:48 +0000 |
commit | 4c45aa1b00b91847acfb082acfaced3ffa294d1d (patch) | |
tree | cf3499d654511dd44c6e12ee59701ba59dd98b31 /include/clang/Analysis/PathSensitive | |
parent | 21c57918f45ac0d192d2202e907969fda22fa612 (diff) |
Speed up compilation by avoiding generating exceptional edges from
CallExprs as those edges help cause a n^2 explosion in the number of
destructor calls. Other consumers, such as static analysis, that
would like to have more a more complete CFG can select the inclusion
of those edges as CFG build time.
This also fixes up the two compilation users of CFGs to be tolerant of
having or not having those edges. All catch code is assumed be to
live if we didn't generate the exceptional edges for CallExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/PathSensitive')
-rw-r--r-- | include/clang/Analysis/PathSensitive/AnalysisContext.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/clang/Analysis/PathSensitive/AnalysisContext.h b/include/clang/Analysis/PathSensitive/AnalysisContext.h index 63ba558e3d..c82bb962fd 100644 --- a/include/clang/Analysis/PathSensitive/AnalysisContext.h +++ b/include/clang/Analysis/PathSensitive/AnalysisContext.h @@ -46,14 +46,21 @@ class AnalysisContext { ParentMap *PM; llvm::DenseMap<const BlockDecl*,void*> *ReferencedBlockVars; llvm::BumpPtrAllocator A; + bool AddEHEdges; public: - AnalysisContext(const Decl *d) : D(d), cfg(0), liveness(0), PM(0), - ReferencedBlockVars(0) {} + AnalysisContext(const Decl *d, bool addehedges = false) + : D(d), cfg(0), liveness(0), PM(0), ReferencedBlockVars(0), + AddEHEdges(addehedges) {} ~AnalysisContext(); ASTContext &getASTContext() { return D->getASTContext(); } const Decl *getDecl() { return D; } + /// getAddEHEdges - Return true iff we are adding exceptional edges from + /// callExprs. If this is false, then try/catch statements and blocks + /// reachable from them can appear to be dead in the CFG, analysis passes must + /// cope with that. + bool getAddEHEdges() const { return AddEHEdges; } Stmt *getBody(); CFG *getCFG(); ParentMap &getParentMap(); |