Use ArrayRef instead of an explicit 'const std::vector &'.
authorBill Wendling <isanbard@gmail.com>
Tue, 20 Sep 2011 19:05:04 +0000 (19:05 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 20 Sep 2011 19:05:04 +0000 (19:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140172 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Utils/FunctionUtils.h
lib/Transforms/Utils/CodeExtractor.cpp

index 785b08f82917da54bacf41c83a1d5eaa7fd77cfc..8d71e43aa92169891ff0deadeadd07a1e9fcd173 100644 (file)
@@ -14,6 +14,7 @@
 #ifndef LLVM_TRANSFORMS_UTILS_FUNCTION_H
 #define LLVM_TRANSFORMS_UTILS_FUNCTION_H
 
+#include "llvm/ADT/ArrayRef.h"
 #include <vector>
 
 namespace llvm {
@@ -22,20 +23,23 @@ namespace llvm {
   class Function;
   class Loop;
 
-  /// ExtractCodeRegion - rip out a sequence of basic blocks into a new function
+  /// ExtractCodeRegion - Rip out a sequence of basic blocks into a new
+  /// function.
   ///
   Function* ExtractCodeRegion(DominatorTree& DT,
-                              const std::vector<BasicBlock*> &code,
+                              ArrayRef<BasicBlock*> code,
                               bool AggregateArgs = false);
 
-  /// ExtractLoop - rip out a natural loop into a new function
+  /// ExtractLoop - Rip out a natural loop into a new function.
   ///
   Function* ExtractLoop(DominatorTree& DT, Loop *L,
                         bool AggregateArgs = false);
 
-  /// ExtractBasicBlock - rip out a basic block into a new function
+  /// ExtractBasicBlock - Rip out a basic block (and the associated landing pad)
+  /// into a new function.
   ///
-  Function* ExtractBasicBlock(BasicBlock *BB, bool AggregateArgs = false);
+  Function* ExtractBasicBlock(ArrayRef<BasicBlock*> BBs,
+                              bool AggregateArgs = false);
 }
 
 #endif
index 6539977ef0867b1c2b515bea9fc7d52dec0b7839..5f47ebb782021fb65dc488fd70da2246c1e66b29 100644 (file)
@@ -778,7 +778,7 @@ bool CodeExtractor::isEligible(ArrayRef<BasicBlock*> code) {
 /// function.
 ///
 Function* llvm::ExtractCodeRegion(DominatorTree &DT,
-                                  const std::vector<BasicBlock*> &code,
+                                  ArrayRef<BasicBlock*> code,
                                   bool AggregateArgs) {
   return CodeExtractor(&DT, AggregateArgs).ExtractCodeRegion(code);
 }
@@ -791,6 +791,6 @@ Function* llvm::ExtractLoop(DominatorTree &DT, Loop *L, bool AggregateArgs) {
 
 /// ExtractBasicBlock - Slurp a basic block into a brand new function.
 ///
-Function* llvm::ExtractBasicBlock(BasicBlock *BB, bool AggregateArgs) {
-  return CodeExtractor(0, AggregateArgs).ExtractCodeRegion(BB);
+Function* llvm::ExtractBasicBlock(ArrayRef<BasicBlock*> BBs, bool AggregateArgs){
+  return CodeExtractor(0, AggregateArgs).ExtractCodeRegion(BBs);
 }