aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Analysis/AnalysisDeclContext.cpp
diff options
context:
space:
mode:
authorMaxim Ostapenko <chefmax7@gmail.com>2018-03-12 12:26:15 +0000
committerMaxim Ostapenko <chefmax7@gmail.com>2018-03-12 12:26:15 +0000
commitdebca45e45a13a5ffef8893f8a7cd6dbbc113a4e (patch)
tree2ce1fc015608e04fe31970103556b96e7d693610 /clang/lib/Analysis/AnalysisDeclContext.cpp
parent11a6db30279a0021e4222b4c48c35a7ec2e8b142 (diff)
downloadllvm-debca45e45a13a5ffef8893f8a7cd6dbbc113a4e.zip
llvm-debca45e45a13a5ffef8893f8a7cd6dbbc113a4e.tar.gz
llvm-debca45e45a13a5ffef8893f8a7cd6dbbc113a4e.tar.bz2
[analyzer] Add scope information to CFG
This patch adds two new CFG elements CFGScopeBegin and CFGScopeEnd that indicate when a local scope begins and ends respectively. We use first VarDecl declared in a scope to uniquely identify it and add CFGScopeBegin and CFGScopeEnd elements into corresponding basic blocks. Differential Revision: https://reviews.llvm.org/D16403 llvm-svn: 327258
Diffstat (limited to 'clang/lib/Analysis/AnalysisDeclContext.cpp')
-rw-r--r--clang/lib/Analysis/AnalysisDeclContext.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Analysis/AnalysisDeclContext.cpp b/clang/lib/Analysis/AnalysisDeclContext.cpp
index 2b8259b..463bdde 100644
--- a/clang/lib/Analysis/AnalysisDeclContext.cpp
+++ b/clang/lib/Analysis/AnalysisDeclContext.cpp
@@ -66,9 +66,9 @@ AnalysisDeclContext::AnalysisDeclContext(AnalysisDeclContextManager *Mgr,
AnalysisDeclContextManager::AnalysisDeclContextManager(
ASTContext &ASTCtx, bool useUnoptimizedCFG, bool addImplicitDtors,
bool addInitializers, bool addTemporaryDtors, bool addLifetime,
- bool addLoopExit, bool synthesizeBodies, bool addStaticInitBranch,
- bool addCXXNewAllocator, bool addRichCXXConstructors,
- CodeInjector *injector)
+ bool addLoopExit, bool addScopes, bool synthesizeBodies,
+ bool addStaticInitBranch, bool addCXXNewAllocator,
+ bool addRichCXXConstructors, CodeInjector *injector)
: Injector(injector), FunctionBodyFarm(ASTCtx, injector),
SynthesizeBodies(synthesizeBodies) {
cfgBuildOptions.PruneTriviallyFalseEdges = !useUnoptimizedCFG;
@@ -77,6 +77,7 @@ AnalysisDeclContextManager::AnalysisDeclContextManager(
cfgBuildOptions.AddTemporaryDtors = addTemporaryDtors;
cfgBuildOptions.AddLifetime = addLifetime;
cfgBuildOptions.AddLoopExit = addLoopExit;
+ cfgBuildOptions.AddScopes = addScopes;
cfgBuildOptions.AddStaticInitBranches = addStaticInitBranch;
cfgBuildOptions.AddCXXNewAllocator = addCXXNewAllocator;
cfgBuildOptions.AddRichCXXConstructors = addRichCXXConstructors;