[llvm-commits] CVS: llvm/lib/Transforms/Utils/CodeExtractor.cpp

Misha Brukman brukman at cs.uiuc.edu
Mon Mar 1 12:29:01 PST 2004


Changes in directory llvm/lib/Transforms/Utils:

CodeExtractor.cpp updated: 1.1 -> 1.2

---
Log message:

* Add implementation of ExtractBasicBlock()
* Add comments to ExtractLoop()


---
Diffs of the changes:  (+10 -0)

Index: llvm/lib/Transforms/Utils/CodeExtractor.cpp
diff -u llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.1 llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.2
--- llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.1	Fri Feb 27 21:26:20 2004
+++ llvm/lib/Transforms/Utils/CodeExtractor.cpp	Mon Mar  1 12:28:34 2004
@@ -566,8 +566,18 @@
   return newFunction;
 }
 
+/// ExtractBasicBlock - slurp a natural loop into a brand new function
+///
 Function* llvm::ExtractLoop(Loop *L) {
   CodeExtractor CE;
   return CE.ExtractCodeRegion(L->getBlocks());
 }
 
+/// ExtractBasicBlock - slurp a basic block into a brand new function
+///
+Function* llvm::ExtractBasicBlock(BasicBlock *BB) {
+  CodeExtractor CE;
+  std::vector<BasicBlock*> Blocks;
+  Blocks.push_back(BB);
+  return CE.ExtractCodeRegion(Blocks);  
+}





More information about the llvm-commits mailing list