From 9a9738f6e5ecbd45bb2bc105d37570f045717152 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Tue, 3 Mar 2015 22:01:13 +0000 Subject: 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 llvm-svn: 231147 --- llvm/lib/IR/BasicBlock.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/lib/IR/BasicBlock.cpp') diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp index eac7d3a..fe38385 100644 --- a/llvm/lib/IR/BasicBlock.cpp +++ b/llvm/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; -- cgit v1.1