[LLVMdev] casting Constant * to value *?

John Criswell jtcriswel at gmail.com
Mon Mar 23 10:42:13 PDT 2015


On 3/18/15 1:35 PM, Alexander Poddey wrote:
> John, you are right.
> I 'browsed' the doxygen's inheritance diagram.
> Shouldn't I then be able to cast Constant * to Value*?

You should be able to, although, as others have pointed out, it is 
unnecessary.

>
> Plugging the retrieved Constant* (from ConstantExpr::getGetElementPtr)
> into Instruction->setOperand compiles, but gives me an assertion failure at
> runtime.

What assertion did you get?  It's hard to diagnose the problem without 
knowing what assertion you are seeing.

Regards,

John Criswell

-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
http://www.cs.rochester.edu/u/criswell




More information about the llvm-dev mailing list