Remove getDataLayout() from Instruction/GlobalValue/BasicBlock/Function
Summary: This does not conceptually belongs here. Instead provide a shortcut getModule() that provides access to the DataLayout. Reviewers: chandlerc, echristo Reviewed By: echristo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8027 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 231147
This commit is contained in:
@@ -29,10 +29,6 @@ ValueSymbolTable *BasicBlock::getValueSymbolTable() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const DataLayout *BasicBlock::getDataLayout() const {
|
||||
return getParent()->getDataLayout();
|
||||
}
|
||||
|
||||
LLVMContext &BasicBlock::getContext() const {
|
||||
return getType()->getContext();
|
||||
}
|
||||
@@ -117,6 +113,9 @@ void BasicBlock::moveAfter(BasicBlock *MovePos) {
|
||||
getParent()->getBasicBlockList(), this);
|
||||
}
|
||||
|
||||
const Module *BasicBlock::getModule() const {
|
||||
return getParent()->getParent();
|
||||
}
|
||||
|
||||
TerminatorInst *BasicBlock::getTerminator() {
|
||||
if (InstList.empty()) return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user