X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FCallGraphSCCPass.h;h=fc9feda5bd8c26422aa64c002bed24e218279982;hb=c5ea263a23f4f15587e35c9cb07cf72a9fba7613;hp=af5cb849a38afa3782ee434148a953f6c19d13e7;hpb=8f93b7fc36dbeba428c6dd122c07fe0777baa664;p=oota-llvm.git diff --git a/include/llvm/CallGraphSCCPass.h b/include/llvm/CallGraphSCCPass.h index af5cb849a38..fc9feda5bd8 100644 --- a/include/llvm/CallGraphSCCPass.h +++ b/include/llvm/CallGraphSCCPass.h @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -22,6 +22,7 @@ #define LLVM_CALL_GRAPH_SCC_PASS_H #include "llvm/Pass.h" +#include "llvm/Analysis/CallGraph.h" namespace llvm { @@ -31,6 +32,9 @@ class PMStack; struct CallGraphSCCPass : public Pass { + explicit CallGraphSCCPass(intptr_t pid) : Pass(pid) {} + explicit CallGraphSCCPass(void *pid) : Pass(pid) {} + /// doInitialization - This method is called before the SCC's of the program /// has been processed, allowing the pass to do initialization as necessary. virtual bool doInitialization(CallGraph &CG) { @@ -42,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 &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 &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.