diff options
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/BasicBlock.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/IR/DataLayout.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/IR/Globals.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/IR/Instruction.cpp | 4 |
4 files changed, 12 insertions, 4 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp index 41e58ec5da2..1d7db917915 100644 --- a/llvm/lib/IR/BasicBlock.cpp +++ b/llvm/lib/IR/BasicBlock.cpp @@ -30,6 +30,10 @@ ValueSymbolTable *BasicBlock::getValueSymbolTable() { return 0; } +const DataLayout *BasicBlock::getDataLayout() const { + return getParent()->getDataLayout(); +} + LLVMContext &BasicBlock::getContext() const { return getType()->getContext(); } diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp index ccdaec5e554..bddb6807512 100644 --- a/llvm/lib/IR/DataLayout.cpp +++ b/llvm/lib/IR/DataLayout.cpp @@ -786,10 +786,6 @@ DataLayoutPass::DataLayoutPass(const DataLayout &DL) initializeDataLayoutPassPass(*PassRegistry::getPassRegistry()); } -DataLayoutPass::DataLayoutPass(StringRef Str) : ImmutablePass(ID), DL(Str) { - initializeDataLayoutPassPass(*PassRegistry::getPassRegistry()); -} - DataLayoutPass::DataLayoutPass(const Module *M) : ImmutablePass(ID), DL(M) { initializeDataLayoutPassPass(*PassRegistry::getPassRegistry()); } diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp index 5ad96b2ce3a..ee882c3eace 100644 --- a/llvm/lib/IR/Globals.cpp +++ b/llvm/lib/IR/Globals.cpp @@ -40,6 +40,10 @@ void GlobalValue::Dematerialize() { getParent()->Dematerialize(this); } +const DataLayout *GlobalValue::getDataLayout() const { + return getParent()->getDataLayout(); +} + /// Override destroyConstant to make sure it doesn't get called on /// GlobalValue's because they shouldn't be treated like other constants. void GlobalValue::destroyConstant() { diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp index a7773c47168..fd5bcc904fb 100644 --- a/llvm/lib/IR/Instruction.cpp +++ b/llvm/lib/IR/Instruction.cpp @@ -35,6 +35,10 @@ 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(0) { |