mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-27 02:31:09 +00:00
Adjust to the new BB ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11113 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3fb57b691d
commit
4f05611ed9
@ -61,25 +61,8 @@ iplist<Instruction> &ilist_traits<Instruction>::getList(BasicBlock *BB) {
|
|||||||
template class SymbolTableListTraits<Instruction, BasicBlock, Function>;
|
template class SymbolTableListTraits<Instruction, BasicBlock, Function>;
|
||||||
|
|
||||||
|
|
||||||
// BasicBlock ctor - If the function parameter is specified, the basic block is
|
BasicBlock::BasicBlock(const std::string &Name, Function *Parent,
|
||||||
// automatically inserted at the end of the function.
|
BasicBlock *InsertBefore)
|
||||||
//
|
|
||||||
BasicBlock::BasicBlock(const std::string &name, Function *Parent)
|
|
||||||
: Value(Type::LabelTy, Value::BasicBlockVal, name) {
|
|
||||||
// Initialize the instlist...
|
|
||||||
InstList.setItemParent(this);
|
|
||||||
|
|
||||||
// Make sure that we get added to a function
|
|
||||||
LeakDetector::addGarbageObject(this);
|
|
||||||
|
|
||||||
if (Parent)
|
|
||||||
Parent->getBasicBlockList().push_back(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// BasicBlock ctor - If the InsertBefore parameter is specified, the basic
|
|
||||||
/// block is automatically inserted right before the specified block.
|
|
||||||
///
|
|
||||||
BasicBlock::BasicBlock(const std::string &Name, BasicBlock *InsertBefore)
|
|
||||||
: Value(Type::LabelTy, Value::BasicBlockVal, Name) {
|
: Value(Type::LabelTy, Value::BasicBlockVal, Name) {
|
||||||
// Initialize the instlist...
|
// Initialize the instlist...
|
||||||
InstList.setItemParent(this);
|
InstList.setItemParent(this);
|
||||||
@ -88,10 +71,11 @@ BasicBlock::BasicBlock(const std::string &Name, BasicBlock *InsertBefore)
|
|||||||
LeakDetector::addGarbageObject(this);
|
LeakDetector::addGarbageObject(this);
|
||||||
|
|
||||||
if (InsertBefore) {
|
if (InsertBefore) {
|
||||||
assert(InsertBefore->getParent() &&
|
assert(Parent &&
|
||||||
"Cannot insert block before another block that is not embedded into"
|
"Cannot insert block before another block with no function!");
|
||||||
" a function yet!");
|
Parent->getBasicBlockList().insert(InsertBefore, this);
|
||||||
InsertBefore->getParent()->getBasicBlockList().insert(InsertBefore, this);
|
} else if (Parent) {
|
||||||
|
Parent->getBasicBlockList().push_back(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,7 +215,7 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I, const std::string &BBName) {
|
|||||||
assert(I != InstList.end() &&
|
assert(I != InstList.end() &&
|
||||||
"Trying to get me to create degenerate basic block!");
|
"Trying to get me to create degenerate basic block!");
|
||||||
|
|
||||||
BasicBlock *New = new BasicBlock(BBName, getNext());
|
BasicBlock *New = new BasicBlock(BBName, getParent(), getNext());
|
||||||
|
|
||||||
// Move all of the specified instructions from the original basic block into
|
// Move all of the specified instructions from the original basic block into
|
||||||
// the new basic block.
|
// the new basic block.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user