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:
Mehdi Amini
2015-03-03 22:01:13 +00:00
parent 1dbe2e3dc4
commit 9a9738f6e5
8 changed files with 23 additions and 20 deletions

View File

@@ -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;