diff options
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
| -rw-r--r-- | llvm/lib/IR/BasicBlock.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp index 29f2cbf611fa..bf19934da047 100644 --- a/llvm/lib/IR/BasicBlock.cpp +++ b/llvm/lib/IR/BasicBlock.cpp @@ -175,13 +175,13 @@ template <> void llvm::invalidateParentIListOrdering(BasicBlock *BB) { // Explicit instantiation of SymbolTableListTraits since some of the methods // are not in the public header file... -template class llvm::SymbolTableListTraits<Instruction, - ilist_iterator_bits<true>>; +template class llvm::SymbolTableListTraits< + Instruction, ilist_iterator_bits<true>, ilist_parent<BasicBlock>>; BasicBlock::BasicBlock(LLVMContext &C, const Twine &Name, Function *NewParent, BasicBlock *InsertBefore) : Value(Type::getLabelTy(C), Value::BasicBlockVal), - IsNewDbgInfoFormat(false), Parent(nullptr) { + IsNewDbgInfoFormat(UseNewDbgInfoFormat), Parent(nullptr) { if (NewParent) insertInto(NewParent, InsertBefore); @@ -189,6 +189,7 @@ BasicBlock::BasicBlock(LLVMContext &C, const Twine &Name, Function *NewParent, assert(!InsertBefore && "Cannot insert block before another block with no function!"); + end().getNodePtr()->setParent(this); setName(Name); if (NewParent) setIsNewDbgInfoFormat(NewParent->IsNewDbgInfoFormat); @@ -290,6 +291,10 @@ const Module *BasicBlock::getModule() const { return getParent()->getParent(); } +const DataLayout &BasicBlock::getDataLayout() const { + return getModule()->getDataLayout(); +} + const CallInst *BasicBlock::getTerminatingMustTailCall() const { if (InstList.empty()) return nullptr; |
