mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user