diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2015-03-03 22:01:13 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2015-03-03 22:01:13 +0000 |
commit | a716c07147b6c2674a3c0a8008f13abec4055baa (patch) | |
tree | adbc31118960d4f1518dbc55624ad98761d0d723 /lib/IR/BasicBlock.cpp | |
parent | 7cecca6011776663d63d5b1b0900504aac62d0d5 (diff) |
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>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231147 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/BasicBlock.cpp')
-rw-r--r-- | lib/IR/BasicBlock.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/IR/BasicBlock.cpp b/lib/IR/BasicBlock.cpp index eac7d3afbe5..fe38385d341 100644 --- a/lib/IR/BasicBlock.cpp +++ b/lib/IR/BasicBlock.cpp @@ -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; |