summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/AnalysisDeclContext.cpp30
1 files changed, 8 insertions, 22 deletions
diff --git a/clang/lib/Analysis/AnalysisDeclContext.cpp b/clang/lib/Analysis/AnalysisDeclContext.cpp
index 316892ea915..5ff7842407a 100644
--- a/clang/lib/Analysis/AnalysisDeclContext.cpp
+++ b/clang/lib/Analysis/AnalysisDeclContext.cpp
@@ -212,34 +212,20 @@ void AnalysisDeclContext::dumpCFG(bool ShowColors) {
getCFG()->dump(getASTContext().getLangOpts(), ShowColors);
}
-static ParentMap *constructParentMap(bool isSemantic,
- Stmt *Body,
- const Decl *D) {
- ParentMap *PM = new ParentMap(Body, isSemantic);
- if (const CXXConstructorDecl *C = dyn_cast<CXXConstructorDecl>(D)) {
- for (CXXConstructorDecl::init_const_iterator I = C->init_begin(),
- E = C->init_end();
- I != E; ++I) {
- PM->addStmt((*I)->getInit());
- }
- }
- return PM;
-}
-
ParentMap &AnalysisDeclContext::getParentMap() {
if (!PM) {
- PM.reset(constructParentMap(false, getBody(), getDecl()));
+ PM.reset(new ParentMap(getBody()));
+ if (const CXXConstructorDecl *C = dyn_cast<CXXConstructorDecl>(getDecl())) {
+ for (CXXConstructorDecl::init_const_iterator I = C->init_begin(),
+ E = C->init_end();
+ I != E; ++I) {
+ PM->addStmt((*I)->getInit());
+ }
+ }
}
return *PM;
}
-ParentMap &AnalysisDeclContext::getSemanticParentMap() {
- if (!SemanticPM) {
- SemanticPM.reset(constructParentMap(true, getBody(), getDecl()));
- }
- return *SemanticPM;
-}
-
PseudoConstantAnalysis *AnalysisDeclContext::getPseudoConstantAnalysis() {
if (!PCA)
PCA.reset(new PseudoConstantAnalysis(getBody()));
OpenPOWER on IntegriCloud