diff options
author | Chris Lattner <sabre@nondot.org> | 2002-01-31 01:12:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-01-31 01:12:06 +0000 |
commit | 21801532fdd6019734e990603405a0d983266804 (patch) | |
tree | 29a51df3ccc7996d06611c6d8e73626f0bf65ca1 /include/llvm/Transforms | |
parent | 2d4fe48b17adba604740800302f19fcc11bbdf34 (diff) | |
download | external_llvm-21801532fdd6019734e990603405a0d983266804.zip external_llvm-21801532fdd6019734e990603405a0d983266804.tar.gz external_llvm-21801532fdd6019734e990603405a0d983266804.tar.bz2 |
Eliminate SimplifyCFG.h file, pull everything into the UnifyMethodExitNodes class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1613 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms')
-rw-r--r-- | include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h b/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h index 0939468..64dc03c 100644 --- a/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h +++ b/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h @@ -10,7 +10,6 @@ #define LLVM_XFORMS_UNIFY_METHOD_EXIT_NODES_H #include "llvm/Pass.h" -#include "llvm/Analysis/SimplifyCFG.h" // FIXME!! struct UnifyMethodExitNodes : public MethodPass { BasicBlock *ExitNode; @@ -18,10 +17,17 @@ public: static AnalysisID ID; // Pass ID UnifyMethodExitNodes(AnalysisID id) : ExitNode(0) { assert(ID == id); } - virtual bool runOnMethod(Method *M) { - ExitNode = cfg::UnifyAllExitNodes(M); + // UnifyAllExitNodes - Unify all exit nodes of the CFG by creating a new + // BasicBlock, and converting all returns to unconditional branches to this + // new basic block. The singular exit node is returned in ExitNode. + // + // If there are no return stmts in the Method, a null pointer is returned. + // + static bool doit(Method *M, BasicBlock *&ExitNode); + - return true; // FIXME: This should return a correct code!!! + virtual bool runOnMethod(Method *M) { + return doit(M, ExitNode); } BasicBlock *getExitNode() const { return ExitNode; } |