*** empty log message ***
[oota-llvm.git] / include / llvm / Transforms / Utils / BasicBlockUtils.h
1 //===-- Transform/Utils/BasicBlockUtils.h - BasicBlock Utilities -*- C++ -*-==//
2 //
3 // This family of functions perform manipulations on basic blocks, and
4 // instructions contained within basic blocks.
5 //
6 //===----------------------------------------------------------------------===//
7
8 #ifndef LLVM_TRANSFORMS_UTILS_BASICBLOCK_H
9 #define LLVM_TRANSFORMS_UTILS_BASICBLOCK_H
10
11 // FIXME: Move to this file: BasicBlock::removePredecessor, BB::splitBasicBlock
12
13 #include "llvm/BasicBlock.h"
14 class Instruction;
15
16
17 // ReplaceInstWithValue - Replace all uses of an instruction (specified by BI)
18 // with a value, then remove and delete the original instruction.
19 //
20 void ReplaceInstWithValue(BasicBlock::InstListType &BIL,
21                           BasicBlock::iterator &BI, Value *V);
22
23 // ReplaceInstWithInst - Replace the instruction specified by BI with the
24 // instruction specified by I.  The original instruction is deleted and BI is
25 // updated to point to the new instruction.
26 //
27 void ReplaceInstWithInst(BasicBlock::InstListType &BIL,
28                          BasicBlock::iterator &BI, Instruction *I);
29
30 // ReplaceInstWithInst - Replace the instruction specified by From with the
31 // instruction specified by To.  Note that this is slower than providing an
32 // iterator directly, because the basic block containing From must be searched
33 // for the instruction.
34 //
35 void ReplaceInstWithInst(Instruction *From, Instruction *To);
36
37 #endif