forked from OSchip/llvm-project
[analyzer] Remove references to idx::TranslationUnit. Index is dead, cross-TU inlining never panned out.
llvm-svn: 155751
This commit is contained in:
parent
1276c33345
commit
4f8198e788
|
@ -73,9 +73,6 @@ class AnalysisDeclContext {
|
|||
|
||||
const Decl *D;
|
||||
|
||||
// TranslationUnit is NULL if we don't have multiple translation units.
|
||||
idx::TranslationUnit *TU;
|
||||
|
||||
OwningPtr<CFG> cfg, completeCFG;
|
||||
OwningPtr<CFGStmtMap> cfgStmtMap;
|
||||
|
||||
|
@ -98,12 +95,10 @@ class AnalysisDeclContext {
|
|||
|
||||
public:
|
||||
AnalysisDeclContext(AnalysisDeclContextManager *Mgr,
|
||||
const Decl *D,
|
||||
idx::TranslationUnit *TU);
|
||||
const Decl *D);
|
||||
|
||||
AnalysisDeclContext(AnalysisDeclContextManager *Mgr,
|
||||
const Decl *D,
|
||||
idx::TranslationUnit *TU,
|
||||
const CFG::BuildOptions &BuildOptions);
|
||||
|
||||
~AnalysisDeclContext();
|
||||
|
@ -111,8 +106,6 @@ public:
|
|||
ASTContext &getASTContext() { return D->getASTContext(); }
|
||||
const Decl *getDecl() const { return D; }
|
||||
|
||||
idx::TranslationUnit *getTranslationUnit() const { return TU; }
|
||||
|
||||
/// Return the build options used to construct the CFG.
|
||||
CFG::BuildOptions &getCFGBuildOptions() {
|
||||
return cfgBuildOptions;
|
||||
|
@ -212,10 +205,6 @@ public:
|
|||
|
||||
AnalysisDeclContext *getAnalysisDeclContext() const { return Ctx; }
|
||||
|
||||
idx::TranslationUnit *getTranslationUnit() const {
|
||||
return Ctx->getTranslationUnit();
|
||||
}
|
||||
|
||||
const LocationContext *getParent() const { return Parent; }
|
||||
|
||||
bool isParentOf(const LocationContext *LC) const;
|
||||
|
@ -383,7 +372,7 @@ public:
|
|||
|
||||
~AnalysisDeclContextManager();
|
||||
|
||||
AnalysisDeclContext *getContext(const Decl *D, idx::TranslationUnit *TU = 0);
|
||||
AnalysisDeclContext *getContext(const Decl *D);
|
||||
|
||||
bool getUseUnoptimizedCFG() const {
|
||||
return !cfgBuildOptions.PruneTriviallyFalseEdges;
|
||||
|
@ -402,9 +391,8 @@ public:
|
|||
}
|
||||
|
||||
// Get the top level stack frame.
|
||||
const StackFrameContext *getStackFrame(Decl const *D,
|
||||
idx::TranslationUnit *TU) {
|
||||
return LocContexts.getStackFrame(getContext(D, TU), 0, 0, 0, 0);
|
||||
const StackFrameContext *getStackFrame(const Decl *D) {
|
||||
return LocContexts.getStackFrame(getContext(D), 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
// Get a stack frame with parent.
|
||||
|
|
|
@ -190,10 +190,6 @@ public:
|
|||
return AnaCtxMgr.getContext(D);
|
||||
}
|
||||
|
||||
AnalysisDeclContext *getAnalysisDeclContext(const Decl *D, idx::TranslationUnit *TU) {
|
||||
return AnaCtxMgr.getContext(D, TU);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} // enAnaCtxMgrspace
|
||||
|
|
|
@ -34,11 +34,9 @@ typedef llvm::DenseMap<const void *, ManagedAnalysis *> ManagedAnalysisMap;
|
|||
|
||||
AnalysisDeclContext::AnalysisDeclContext(AnalysisDeclContextManager *Mgr,
|
||||
const Decl *d,
|
||||
idx::TranslationUnit *tu,
|
||||
const CFG::BuildOptions &buildOptions)
|
||||
: Manager(Mgr),
|
||||
D(d),
|
||||
TU(tu),
|
||||
cfgBuildOptions(buildOptions),
|
||||
forcedBlkExprs(0),
|
||||
builtCFG(false),
|
||||
|
@ -50,11 +48,9 @@ AnalysisDeclContext::AnalysisDeclContext(AnalysisDeclContextManager *Mgr,
|
|||
}
|
||||
|
||||
AnalysisDeclContext::AnalysisDeclContext(AnalysisDeclContextManager *Mgr,
|
||||
const Decl *d,
|
||||
idx::TranslationUnit *tu)
|
||||
const Decl *d)
|
||||
: Manager(Mgr),
|
||||
D(d),
|
||||
TU(tu),
|
||||
forcedBlkExprs(0),
|
||||
builtCFG(false),
|
||||
builtCompleteCFG(false),
|
||||
|
@ -195,11 +191,10 @@ PseudoConstantAnalysis *AnalysisDeclContext::getPseudoConstantAnalysis() {
|
|||
return PCA.get();
|
||||
}
|
||||
|
||||
AnalysisDeclContext *AnalysisDeclContextManager::getContext(const Decl *D,
|
||||
idx::TranslationUnit *TU) {
|
||||
AnalysisDeclContext *AnalysisDeclContextManager::getContext(const Decl *D) {
|
||||
AnalysisDeclContext *&AC = Contexts[D];
|
||||
if (!AC)
|
||||
AC = new AnalysisDeclContext(this, D, TU, cfgBuildOptions);
|
||||
AC = new AnalysisDeclContext(this, D, cfgBuildOptions);
|
||||
return AC;
|
||||
}
|
||||
|
||||
|
|
|
@ -830,7 +830,7 @@ AnalysisBasedWarnings::IssueWarnings(sema::AnalysisBasedWarnings::Policy P,
|
|||
const Stmt *Body = D->getBody();
|
||||
assert(Body);
|
||||
|
||||
AnalysisDeclContext AC(/* AnalysisDeclContextManager */ 0, D, 0);
|
||||
AnalysisDeclContext AC(/* AnalysisDeclContextManager */ 0, D);
|
||||
|
||||
// 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.
|
||||
|
|
|
@ -526,7 +526,7 @@ void AnalysisConsumer::ActionExprEngine(Decl *D, bool ObjCGCEnabled,
|
|||
}
|
||||
|
||||
// Execute the worklist algorithm.
|
||||
Eng.ExecuteWorkList(Mgr->getAnalysisDeclContextManager().getStackFrame(D, 0),
|
||||
Eng.ExecuteWorkList(Mgr->getAnalysisDeclContextManager().getStackFrame(D),
|
||||
Mgr->getMaxNodes());
|
||||
|
||||
// Release the auditor (if any) so that it doesn't monitor the graph
|
||||
|
|
Loading…
Reference in New Issue