LLVM API Documentation

FunctionUtils.h

Go to the documentation of this file.
00001 //===-- Transform/Utils/FunctionUtils.h - Function Utils --------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This family of transformations manipulate LLVM functions.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_TRANSFORMS_UTILS_FUNCTION_H
00015 #define LLVM_TRANSFORMS_UTILS_FUNCTION_H
00016 
00017 #include "llvm/Analysis/LoopInfo.h"
00018 #include <vector>
00019 
00020 namespace llvm {
00021   class BasicBlock;
00022   class DominatorTree;
00023   class Function;
00024 
00025   /// ExtractCodeRegion - rip out a sequence of basic blocks into a new function
00026   ///
00027   Function* ExtractCodeRegion(DominatorTree& DT,
00028                               const std::vector<BasicBlock*> &code,
00029                               bool AggregateArgs = false);
00030 
00031   /// ExtractLoop - rip out a natural loop into a new function
00032   ///
00033   Function* ExtractLoop(DominatorTree& DT, Loop *L,
00034                         bool AggregateArgs = false);
00035 
00036   /// ExtractBasicBlock - rip out a basic block into a new function
00037   ///
00038   Function* ExtractBasicBlock(BasicBlock *BB, bool AggregateArgs = false);
00039 }
00040 
00041 #endif