diff options
Diffstat (limited to 'include/llvm/Instructions.h')
-rw-r--r-- | include/llvm/Instructions.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index bc5e0b4af9..3c8673e627 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -455,7 +455,8 @@ public: Instruction *InsertBefore =0) : Instruction(PointerType::get( checkType(getIndexedType(Ptr->getType(), - IdxBegin, IdxEnd, true))), + IdxBegin, IdxEnd, true)), + cast<PointerType>(Ptr->getType())->getAddressSpace()), GetElementPtr, 0, 0, InsertBefore) { init(Ptr, IdxBegin, IdxEnd, Name, typename std::iterator_traits<InputIterator>::iterator_category()); @@ -465,7 +466,8 @@ public: const std::string &Name, BasicBlock *InsertAtEnd) : Instruction(PointerType::get( checkType(getIndexedType(Ptr->getType(), - IdxBegin, IdxEnd, true))), + IdxBegin, IdxEnd, true)), + cast<PointerType>(Ptr->getType())->getAddressSpace()), GetElementPtr, 0, 0, InsertAtEnd) { init(Ptr, IdxBegin, IdxEnd, Name, typename std::iterator_traits<InputIterator>::iterator_category()); |