diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-03-14 03:17:22 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-03-14 03:17:22 +0000 |
| commit | 3684469326780e0be22b3632bae547a85575fd8f (patch) | |
| tree | 965b56f8ba13ee00360dd49c6f052c062d3cc7e4 /llvm/lib/Transforms/Utils | |
| parent | b870ca77668890f0c8d221756ca41c0bf5f08c1e (diff) | |
| download | bcm5719-llvm-3684469326780e0be22b3632bae547a85575fd8f.tar.gz bcm5719-llvm-3684469326780e0be22b3632bae547a85575fd8f.zip | |
Verify functions as they are produced if -debug is specified. Reduce
curly braceage
llvm-svn: 12378
Diffstat (limited to 'llvm/lib/Transforms/Utils')
| -rw-r--r-- | llvm/lib/Transforms/Utils/CodeExtractor.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp index 7de30066806..cbe9858aa44 100644 --- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp +++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp @@ -20,6 +20,7 @@ #include "llvm/Module.h" #include "llvm/Pass.h" #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/Verifier.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/FunctionUtils.h" #include "Support/Debug.h" @@ -324,13 +325,10 @@ Function *CodeExtractor::constructFunction(const Values &inputs, for (unsigned i = 0, e = inputs.size(); i != e; ++i) { std::vector<User*> Users(inputs[i]->use_begin(), inputs[i]->use_end()); for (std::vector<User*>::iterator use = Users.begin(), useE = Users.end(); - use != useE; ++use) { - if (Instruction* inst = dyn_cast<Instruction>(*use)) { - if (contains(code, inst->getParent())) { + use != useE; ++use) + if (Instruction* inst = dyn_cast<Instruction>(*use)) + if (contains(code, inst->getParent())) inst->replaceUsesOfWith(inputs[i], getFunctionArg(newFunction, i)); - } - } - } } // Rewrite branches to basic blocks outside of the loop to new dummy blocks @@ -563,6 +561,7 @@ Function *CodeExtractor::ExtractCodeRegion(const std::vector<BasicBlock*> &code) moveCodeToFunction(code, newFunction); + DEBUG(if (verifyFunction(*newFunction)) abort()); return newFunction; } |

