2004-02-28 04:33:30 +01:00
|
|
|
//===-- Transform/Utils/FunctionUtils.h - Function Utils --------*- C++ -*-===//
|
2005-04-21 22:59:05 +02:00
|
|
|
//
|
2004-02-28 04:33:30 +01:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:59:42 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 22:59:05 +02:00
|
|
|
//
|
2004-02-28 04:33:30 +01:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2004-03-02 01:20:32 +01:00
|
|
|
// This family of transformations manipulate LLVM functions.
|
2004-02-28 04:33:30 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_TRANSFORMS_UTILS_FUNCTION_H
|
|
|
|
#define LLVM_TRANSFORMS_UTILS_FUNCTION_H
|
|
|
|
|
2004-03-18 04:14:56 +01:00
|
|
|
#include <vector>
|
|
|
|
|
2004-02-28 04:33:30 +01:00
|
|
|
namespace llvm {
|
2004-03-18 04:14:56 +01:00
|
|
|
class BasicBlock;
|
2008-05-29 21:52:31 +02:00
|
|
|
class DominatorTree;
|
2004-03-18 04:47:46 +01:00
|
|
|
class Function;
|
2009-07-14 00:19:41 +02:00
|
|
|
class Loop;
|
2005-04-21 22:59:05 +02:00
|
|
|
|
2004-03-18 04:47:46 +01:00
|
|
|
/// ExtractCodeRegion - rip out a sequence of basic blocks into a new function
|
|
|
|
///
|
2007-06-08 00:17:16 +02:00
|
|
|
Function* ExtractCodeRegion(DominatorTree& DT,
|
2004-04-24 01:54:34 +02:00
|
|
|
const std::vector<BasicBlock*> &code,
|
|
|
|
bool AggregateArgs = false);
|
2004-03-18 04:47:46 +01:00
|
|
|
|
|
|
|
/// ExtractLoop - rip out a natural loop into a new function
|
|
|
|
///
|
2007-06-08 00:17:16 +02:00
|
|
|
Function* ExtractLoop(DominatorTree& DT, Loop *L,
|
2004-04-24 01:54:34 +02:00
|
|
|
bool AggregateArgs = false);
|
2004-03-18 04:47:46 +01:00
|
|
|
|
|
|
|
/// ExtractBasicBlock - rip out a basic block into a new function
|
|
|
|
///
|
2004-04-24 01:54:34 +02:00
|
|
|
Function* ExtractBasicBlock(BasicBlock *BB, bool AggregateArgs = false);
|
2004-02-28 04:33:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|