diff options
author | Chris Lattner <sabre@nondot.org> | 2002-05-07 18:51:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-05-07 18:51:25 +0000 |
commit | b444a1fff47162591933e00197375bbbd255f595 (patch) | |
tree | e3b4e314c69e270e7ea9c44f9258f37176cbfe9b /lib/Transforms/Utils/UnifyFunctionExitNodes.cpp | |
parent | fbfa18ce6c7018a6118c10a91ef76a5ec8f9461e (diff) |
Cleanup implementation a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2526 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/UnifyFunctionExitNodes.cpp')
-rw-r--r-- | lib/Transforms/Utils/UnifyFunctionExitNodes.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp b/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp index 37dc4ab954..061cf3cc2f 100644 --- a/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp +++ b/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp @@ -1,7 +1,9 @@ //===- UnifyFunctionExitNodes.cpp - Make all functions have a single exit -===// // -// This file provides several routines that are useful for simplifying CFGs in -// various ways... +// This pass is used to ensure that functions have at most one return +// instruction in them. Additionally, it keeps track of which node is the new +// exit node of the CFG. If there are no exit nodes in the CFG, the getExitNode +// method will return a null pointer. // //===----------------------------------------------------------------------===// @@ -22,7 +24,7 @@ AnalysisID UnifyFunctionExitNodes::ID(AnalysisID::create<UnifyFunctionExitNodes> // // If there are no return stmts in the Function, a null pointer is returned. // -bool UnifyFunctionExitNodes::doit(Function *M, BasicBlock *&ExitNode) { +bool UnifyFunctionExitNodes::runOnFunction(Function *M) { // Loop over all of the blocks in a function, tracking all of the blocks that // return. // @@ -33,7 +35,7 @@ bool UnifyFunctionExitNodes::doit(Function *M, BasicBlock *&ExitNode) { if (ReturningBlocks.empty()) { ExitNode = 0; - return false; // No blocks return + return false; // No blocks return } else if (ReturningBlocks.size() == 1) { ExitNode = ReturningBlocks.front(); // Already has a single return block return false; |