#include "llvm/Analysis/DataStructure/DataStructure.h"
#include "llvm/Module.h"
#include "llvm/Analysis/DataStructure/DSGraph.h"
-#include "Support/Debug.h"
-#include "Support/SCCIterator.h"
-#include "Support/Statistic.h"
-#include "Support/STLExtras.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/ADT/SCCIterator.h"
+#include "llvm/ADT/Statistic.h"
+#include "llvm/ADT/STLExtras.h"
using namespace llvm;
namespace {
// run - Calculate the bottom up data structure graphs for each function in the
// program.
//
-bool CompleteBUDataStructures::run(Module &M) {
+bool CompleteBUDataStructures::runOnModule(Module &M) {
BUDataStructures &BU = getAnalysis<BUDataStructures>();
GlobalsGraph = new DSGraph(BU.getGlobalsGraph());
GlobalsGraph->setPrintAuxCalls();
for (DSGraph::ReturnNodesTy::iterator I = NG->getReturnNodes().begin();
I != NG->getReturnNodes().end(); ++I)
DSInfo[I->first] = &FG;
+
+ // Remove NG from the ValMap since the pointer may get recycled.
+ ValMap.erase(NG);
delete NG;
Stack.pop_back();