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