diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-04-17 19:56:21 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-04-17 19:56:21 +0000 |
commit | 0f0d21e869726c947c958702f6db000e016203ce (patch) | |
tree | 05296a298f2bbac633a1a95d76fae6cc58cc229f /include | |
parent | 35df664ee64465bcad08259ef4d2c716ba7c34ff (diff) |
[opaque pointer types] Use the pointee type loaded from bitcode when constructing a LoadInst
Now (with a few carefully placed suppressions relating to general type
serialization, etc) we can round trip a simple load through bitcode and
textual IR without calling getElementType on a PointerType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235221 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/IR/Instructions.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/IR/Instructions.h b/include/llvm/IR/Instructions.h index ddb441b6e5..5d53b252c1 100644 --- a/include/llvm/IR/Instructions.h +++ b/include/llvm/IR/Instructions.h @@ -176,7 +176,11 @@ public: Instruction *InsertBefore = nullptr); LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile, BasicBlock *InsertAtEnd); - LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile, + LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile, unsigned Align, + Instruction *InsertBefore = nullptr) + : LoadInst(cast<PointerType>(Ptr->getType())->getElementType(), Ptr, + NameStr, isVolatile, Align, InsertBefore) {} + LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile, unsigned Align, Instruction *InsertBefore = nullptr); LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile, unsigned Align, BasicBlock *InsertAtEnd); |