1 //===-- Transform/Utils/FunctionUtils.h - Function Utils --------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This family of transformations manipulate LLVM functions.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_TRANSFORMS_UTILS_FUNCTION_H
15 #define LLVM_TRANSFORMS_UTILS_FUNCTION_H
17 #include "llvm/Analysis/LoopInfo.h"
25 /// ExtractCodeRegion - rip out a sequence of basic blocks into a new function
27 Function* ExtractCodeRegion(DominatorTree& DT,
28 const std::vector<BasicBlock*> &code,
29 bool AggregateArgs = false);
31 /// ExtractLoop - rip out a natural loop into a new function
33 Function* ExtractLoop(DominatorTree& DT, Loop *L,
34 bool AggregateArgs = false);
36 /// ExtractBasicBlock - rip out a basic block into a new function
38 Function* ExtractBasicBlock(BasicBlock *BB, bool AggregateArgs = false);