[llvm-commits] [llvm] r140172 - in /llvm/trunk: include/llvm/Transforms/Utils/FunctionUtils.h lib/Transforms/Utils/CodeExtractor.cpp
Bill Wendling
isanbard at gmail.com
Tue Sep 20 12:05:04 PDT 2011
Author: void
Date: Tue Sep 20 14:05:04 2011
New Revision: 140172
URL: http://llvm.org/viewvc/llvm-project?rev=140172&view=rev
Log:
Use ArrayRef instead of an explicit 'const std::vector &'.
Modified:
llvm/trunk/include/llvm/Transforms/Utils/FunctionUtils.h
llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp
Modified: llvm/trunk/include/llvm/Transforms/Utils/FunctionUtils.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/FunctionUtils.h?rev=140172&r1=140171&r2=140172&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/FunctionUtils.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/FunctionUtils.h Tue Sep 20 14:05:04 2011
@@ -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 @@
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
Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp?rev=140172&r1=140171&r2=140172&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Tue Sep 20 14:05:04 2011
@@ -778,7 +778,7 @@
/// 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 @@
/// 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);
}
More information about the llvm-commits
mailing list