<div dir="ltr">A "store" instruction doesn't return anything, so getType() returns void. <div><br></div><div>Try getOperand(0)->getType(). That returns the type of the first operand (i.e. the value stored). <a href="http://llvm.org/docs/LangRef.html#store-instruction">http://llvm.org/docs/LangRef.html#store-instruction</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 7, 2016 at 10:34 AM, Mohammad Norouzi via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi All,<br><br></div>I need to get the type of store instructions using getType from StoreInst. However, I get the following error when compiling my program:<br><br><div style="margin-left:40px">clang-3.6: /home/norouzi/Desktop/software/dp-clang-llvm/branches/llvm_361/dp-clang-llvm/include/llvm/IR/DataLayout.h:500: uint64_t llvm::DataLayout::getTypeSizeInBits(llvm::Type*) const: Assertion `Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!"' failed.<br></div><br></div>I tried to figure out why and checked out that getType returns "void" so DataLayout cannot proceed.<br><br></div><div>I should mention that i tried it also about LoadInst which perfectly works.<br></div><div><br></div>I would be happy about any help.<br><br></div>Best,<br></div>Mo<br><div><div><div><div><br></div></div></div></div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>