[opaque pointer type] LoadInst: assert that the explicit type matches the implicit one
[oota-llvm.git] / lib / IR / Instructions.cpp
index 3a32be542cc3a0e65df6f1d91efe7e766346ac10..32b7451b0747ca60bbe07c9f6365050215d75f34 100644 (file)
@@ -953,6 +953,7 @@ LoadInst::LoadInst(Type *Ty, Value *Ptr, const Twine &Name, bool isVolatile,
                    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);