Implement ExtractCodeRegion()
authorMisha Brukman <brukman+llvm@gmail.com>
Tue, 2 Mar 2004 00:20:57 +0000 (00:20 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Tue, 2 Mar 2004 00:20:57 +0000 (00:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12070 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/CodeExtractor.cpp

index 530d2f66b731ddad41850a01f29ed75ed0d573a9..7de300668069cbca1dd5ef9cfd35c667d9851a22 100644 (file)
@@ -443,7 +443,7 @@ CodeExtractor::emitCallAndSwitchStatement(Function *newFunction,
                       brInst);
       }
 
-      // Rewrite branches into exists which return a value based on which
+      // Rewrite branches into exits which return a value based on which
       // exit we take from this function
       if (brInst->isUnconditional()) {
         if (!contains(code, brInst->getSuccessor(0))) {
@@ -566,6 +566,14 @@ Function *CodeExtractor::ExtractCodeRegion(const std::vector<BasicBlock*> &code)
   return newFunction;
 }
 
+/// ExtractCodeRegion - slurp a sequence of basic blocks into a brand new
+/// function
+///
+Function* llvm::ExtractCodeRegion(const std::vector<BasicBlock*> &code) {
+  CodeExtractor CE;
+  return CE.ExtractCodeRegion(code);
+}
+
 /// ExtractBasicBlock - slurp a natural loop into a brand new function
 ///
 Function* llvm::ExtractLoop(Loop *L) {