summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Instruction.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2015-03-03 22:01:13 +0000
committerMehdi Amini <mehdi.amini@apple.com>2015-03-03 22:01:13 +0000
commit9a9738f6e5ecbd45bb2bc105d37570f045717152 (patch)
tree607649fe7f2d6f54383c72f31b0b4648c7cca6e7 /llvm/lib/IR/Instruction.cpp
parent1dbe2e3dc4368a1985decfb180bd8e7290cd9f8e (diff)
downloadbcm5719-llvm-9a9738f6e5ecbd45bb2bc105d37570f045717152.tar.gz
bcm5719-llvm-9a9738f6e5ecbd45bb2bc105d37570f045717152.zip
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
Diffstat (limited to 'llvm/lib/IR/Instruction.cpp')
-rw-r--r--llvm/lib/IR/Instruction.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp
index 92c6e9f3ded..7d9bd7ed5ff 100644
--- a/llvm/lib/IR/Instruction.cpp
+++ b/llvm/lib/IR/Instruction.cpp
@@ -32,10 +32,6 @@ Instruction::Instruction(Type *ty, unsigned it, Use *Ops, unsigned NumOps,
}
}
-const DataLayout *Instruction::getDataLayout() const {
- return getParent()->getDataLayout();
-}
-
Instruction::Instruction(Type *ty, unsigned it, Use *Ops, unsigned NumOps,
BasicBlock *InsertAtEnd)
: User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(nullptr) {
@@ -58,6 +54,10 @@ void Instruction::setParent(BasicBlock *P) {
Parent = P;
}
+const Module *Instruction::getModule() const {
+ return getParent()->getModule();
+}
+
void Instruction::removeFromParent() {
getParent()->getInstList().remove(this);
}
OpenPOWER on IntegriCloud