mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-04 22:28:27 +00:00
Convert analyses to new pass structure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1603 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -19,6 +19,9 @@
|
||||
#include "Support/STLExtras.h"
|
||||
#include <algorithm>
|
||||
|
||||
AnalysisID cfg::CallGraph::ID(AnalysisID::create<cfg::CallGraph>());
|
||||
//AnalysisID cfg::CallGraph::ID(AnalysisID::template AnalysisID<cfg::CallGraph>());
|
||||
|
||||
// getNodeFor - Return the node for the specified method or create one if it
|
||||
// does not already exist.
|
||||
//
|
||||
@@ -53,7 +56,9 @@ void cfg::CallGraph::addToCallGraph(Method *M) {
|
||||
}
|
||||
}
|
||||
|
||||
cfg::CallGraph::CallGraph(Module *TheModule) {
|
||||
bool cfg::CallGraph::run(Module *TheModule) {
|
||||
destroy();
|
||||
|
||||
Mod = TheModule;
|
||||
|
||||
// Create the root node of the module...
|
||||
@@ -61,13 +66,16 @@ cfg::CallGraph::CallGraph(Module *TheModule) {
|
||||
|
||||
// Add every method to the call graph...
|
||||
for_each(Mod->begin(), Mod->end(), bind_obj(this,&CallGraph::addToCallGraph));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
cfg::CallGraph::~CallGraph() {
|
||||
void cfg::CallGraph::destroy() {
|
||||
for (MethodMapTy::iterator I = MethodMap.begin(), E = MethodMap.end();
|
||||
I != E; ++I) {
|
||||
delete I->second;
|
||||
}
|
||||
MethodMap.clear();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user