Fix warning
[oota-llvm.git] / lib / Transforms / Instrumentation / ProfilePaths / GraphAuxillary.cpp
index 45ceadaa930763b650fdfb6aed96dc86f0580c2f..3a34131c88954aeafba86cb51e7c4f6df0c48e02 100644 (file)
@@ -8,18 +8,11 @@
 
 #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
 #include "llvm/Transforms/Instrumentation/Graph.h"
-#include "llvm/Function.h"
 #include "llvm/Pass.h"
 #include "llvm/Module.h"
-#include "llvm/Function.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/InstrTypes.h"
 #include "llvm/iTerminators.h"
+#include "Support/Statistic.h"
 #include <algorithm>
-#include <iostream>
-#include <sstream>
-#include <vector>
-#include <string>
 
 //using std::list;
 using std::map;
@@ -490,7 +483,8 @@ void processGraph(Graph &g,
                  vector<Edge >& be, 
                  vector<Edge >& stDummy, 
                  vector<Edge >& exDummy, 
-                 int numPaths, int MethNo){
+                 int numPaths, int MethNo, 
+                  Value *threshold){
 
   //Given a graph: with exit->root edge, do the following in seq:
   //1. get back edges
@@ -511,7 +505,7 @@ void processGraph(Graph &g,
   //This would hold all 
   //right as long as number of paths in the graph
   //is less than this
-  const int INFINITY=99999999;
+  const int Infinity=99999999;
 
 
   //step 1-3 are already done on the graph when this function is called
@@ -521,14 +515,14 @@ void processGraph(Graph &g,
 
   //now insert exit to root edge
   //if its there earlier, remove it!
-  //assign it weight INFINITY
+  //assign it weight Infinity
   //so that this edge IS ALWAYS IN spanning tree
   //Note than edges in spanning tree do not get 
   //instrumented: and we do not want the
   //edge exit->root to get instrumented
   //as it MAY BE a dummy edge
-  Edge ed(g.getExit(),g.getRoot(),INFINITY);
-  g.addEdge(ed,INFINITY);
+  Edge ed(g.getExit(),g.getRoot(),Infinity);
+  g.addEdge(ed,Infinity);
   Graph g2=g;
 
   //make g2 undirectional: this gives a better
@@ -652,7 +646,7 @@ void processGraph(Graph &g,
   for(map<Edge, getEdgeCode *>::iterator MI=codeInsertions.begin(), 
        ME=codeInsertions.end(); MI!=ME; ++MI){
     Edge ed=MI->first;
-    insertBB(ed, MI->second, rInst, countInst, numPaths, MethNo);
+    insertBB(ed, MI->second, rInst, countInst, numPaths, MethNo, threshold);
   } 
 }