[llvm] r237830 - [opaque pointer type] LoadInst: assert that the explicit type matches the implicit one
David Blaikie
dblaikie at gmail.com
Wed May 20 13:22:31 PDT 2015
Author: dblaikie
Date: Wed May 20 15:22:31 2015
New Revision: 237830
URL: http://llvm.org/viewvc/llvm-project?rev=237830&view=rev
Log:
[opaque pointer type] LoadInst: assert that the explicit type matches the implicit one
Modified:
llvm/trunk/lib/IR/Instructions.cpp
Modified: llvm/trunk/lib/IR/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Instructions.cpp?rev=237830&r1=237829&r2=237830&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Instructions.cpp (original)
+++ llvm/trunk/lib/IR/Instructions.cpp Wed May 20 15:22:31 2015
@@ -953,6 +953,7 @@ LoadInst::LoadInst(Type *Ty, Value *Ptr,
unsigned Align, AtomicOrdering Order,
SynchronizationScope SynchScope, Instruction *InsertBef)
: UnaryInstruction(Ty, Load, Ptr, InsertBef) {
+ assert(Ty == cast<PointerType>(Ptr->getType())->getElementType());
setVolatile(isVolatile);
setAlignment(Align);
setAtomic(Order, SynchScope);
More information about the llvm-commits
mailing list