Make ARM and Mips use TargetMachine::getTLSModel()
[oota-llvm.git] / include / llvm / Transforms / Utils / FunctionUtils.h
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   /// \brief Test whether a basic block is a viable candidate for extraction.
27   ///
28   /// This tests whether a particular basic block is viable for extraction into
29   /// a separate function. It can be used to prune code extraction eagerly
30   /// rather than waiting for one of the Extract* methods below to reject
31   /// a request.
32   bool isBlockViableForExtraction(const BasicBlock &BB);
33
34   /// ExtractCodeRegion - Rip out a sequence of basic blocks into a new
35   /// function.
36   ///
37   Function* ExtractCodeRegion(DominatorTree& DT,
38                               ArrayRef<BasicBlock*> code,
39                               bool AggregateArgs = false);
40
41   /// ExtractLoop - Rip out a natural loop into a new function.
42   ///
43   Function* ExtractLoop(DominatorTree& DT, Loop *L,
44                         bool AggregateArgs = false);
45
46   /// ExtractBasicBlock - Rip out a basic block (and the associated landing pad)
47   /// into a new function.
48   ///
49   Function* ExtractBasicBlock(ArrayRef<BasicBlock*> BBs,
50                               bool AggregateArgs = false);
51 }
52
53 #endif