forked from OSchip/llvm-project
Change CallGraph::Prog to be a reference. idx::Program means to be a global object to the Index library.
llvm-svn: 107461
This commit is contained in:
parent
609f8c584a
commit
a74c22daec
|
@ -31,6 +31,8 @@ int main(int argc, char **argv) {
|
|||
FileManager FileMgr;
|
||||
std::vector<ASTUnit*> ASTUnits;
|
||||
|
||||
Program Prog;
|
||||
|
||||
if (InputFilenames.empty())
|
||||
return 0;
|
||||
|
||||
|
@ -47,7 +49,7 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
llvm::OwningPtr<CallGraph> CG;
|
||||
CG.reset(new CallGraph());
|
||||
CG.reset(new CallGraph(Prog));
|
||||
|
||||
for (unsigned i = 0, e = ASTUnits.size(); i != e; ++i)
|
||||
CG->addTU(ASTUnits[i]->getASTContext());
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
|
||||
class CallGraph {
|
||||
/// Program manages all Entities.
|
||||
idx::Program Prog;
|
||||
idx::Program &Prog;
|
||||
|
||||
typedef std::map<idx::Entity, CallGraphNode *> FunctionMapTy;
|
||||
|
||||
|
@ -71,7 +71,7 @@ class CallGraph {
|
|||
CallGraphNode *ExternalCallingNode;
|
||||
|
||||
public:
|
||||
CallGraph();
|
||||
CallGraph(idx::Program &P);
|
||||
~CallGraph();
|
||||
|
||||
typedef FunctionMapTy::iterator iterator;
|
||||
|
|
|
@ -55,7 +55,7 @@ void CGBuilder::VisitCallExpr(CallExpr *CE) {
|
|||
}
|
||||
}
|
||||
|
||||
CallGraph::CallGraph() : Root(0) {
|
||||
CallGraph::CallGraph(Program &P) : Prog(P), Root(0) {
|
||||
ExternalCallingNode = getOrInsertFunction(Entity());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue