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
|
|
|
|
//
|
2007-12-29 19:59:42 +00:00
|
|
|
// This file 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-11-14 02:33:58 +00:00
|
|
|
#include "llvm/Analysis/Dominators.h"
|
|
|
|
#include "llvm/Analysis/LoopInfo.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;
|
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-06-07 22:17:16 +00:00
|
|
|
Function* ExtractCodeRegion(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-06-07 22:17:16 +00:00
|
|
|
Function* ExtractLoop(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
|