[LLVMdev] ConstantInt to Value*?

Duncan Sands baldrick at free.fr
Tue Nov 2 04:15:13 PDT 2010


Hi,

> How to convert ConstantInt* to value*?

I guess you mean Value*.  You don't have to.  The ConstantInt
class is derived from the Constant class:

   class ConstantInt : public Constant

The Constant class is derived from the User class:

   class Constant : public User {

The User class is derived from the Value class:

   class User : public Value {

Thus ConstantInt is derived from Value, and so you should be
able to pass a ConstantInt* where-ever a Value* is needed.

Ciao,

Duncan.



More information about the llvm-dev mailing list