1 //===-- Transform/Utils/FunctionUtils.h - Function Utils --------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This family of transformations manipulate LLVM functions. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef LLVM_TRANSFORMS_UTILS_FUNCTION_H 15 #define LLVM_TRANSFORMS_UTILS_FUNCTION_H 16 17 #include "llvm/ADT/ArrayRef.h" 18 #include <vector> 19 20 namespace llvm { 21 class BasicBlock; 22 class DominatorTree; 23 class Function; 24 class Loop; 25 26 /// ExtractCodeRegion - Rip out a sequence of basic blocks into a new 27 /// function. 28 /// 29 Function* ExtractCodeRegion(DominatorTree& DT, 30 ArrayRef<BasicBlock*> code, 31 bool AggregateArgs = false); 32 33 /// ExtractLoop - Rip out a natural loop into a new function. 34 /// 35 Function* ExtractLoop(DominatorTree& DT, Loop *L, 36 bool AggregateArgs = false); 37 38 /// ExtractBasicBlock - Rip out a basic block (and the associated landing pad) 39 /// into a new function. 40 /// 41 Function* ExtractBasicBlock(ArrayRef<BasicBlock*> BBs, 42 bool AggregateArgs = false); 43 } 44 45 #endif 46