Remove DbgNode checks in constructor. Debug descriptors are intended to be light...
[oota-llvm.git] / include / llvm / CallGraphSCCPass.h
index f2190e67211355683b5211fcf98f04fffc9834d5..feab7637969d6c14ec9d60ee20c9e312a41dfdb5 100644 (file)
@@ -22,6 +22,7 @@
 #define LLVM_CALL_GRAPH_SCC_PASS_H
 
 #include "llvm/Pass.h"
+#include "llvm/Analysis/CallGraph.h"
 
 namespace llvm {
 
@@ -31,7 +32,8 @@ class PMStack;
 
 struct CallGraphSCCPass : public Pass {
 
-  explicit CallGraphSCCPass(intptr_t pid, bool AP = false) : Pass(pid, AP) {}
+  explicit CallGraphSCCPass(intptr_t pid) : Pass(PT_CallGraphSCC, pid) {}
+  explicit CallGraphSCCPass(void *pid) : Pass(PT_CallGraphSCC, pid) {}
 
   /// doInitialization - This method is called before the SCC's of the program
   /// has been processed, allowing the pass to do initialization as necessary.
@@ -44,7 +46,10 @@ struct CallGraphSCCPass : public Pass {
   /// non-recursive (or only self-recursive) functions will have an SCC size of
   /// 1, where recursive portions of the call graph will have SCC size > 1.
   ///
-  virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC) = 0;
+  /// SCC passes that add or delete functions to the SCC are required to update
+  /// the SCC list, otherwise stale pointers may be dereferenced.
+  ///
+  virtual bool runOnSCC(std::vector<CallGraphNode *> &SCC) = 0;
 
   /// doFinalization - This method is called after the SCC's of the program has
   /// been processed, allowing the pass to do final cleanup as necessary.