"SrcValue is not a pointer?" assertion in SelectionDAG::getSrcValue

hi,

i am building selectionDAG by my own code, but got a assertion fail
said "SrcValue is not a pointer?".

but since the comment above the SrcValueSDNode said: "SrcValueSDNode -
An SDNode that holds an arbitrary LLVM IR Value." why the llvm value
of SrcValueSDNode must be with PointerType? is that assertion
necessary? thanks a lots.

regards
--ether

Hello Ether,

I think it is referring to the Value class (captial V) whose documentation is found at LLVM: llvm::Value Class Reference . It has to be a pointer because the Value class is a parent class to many many child classes.

--Sam

hi sam,

i cant quite understand the follow code in SelectionDAG::getSrcValue
are not necessary:

assert((!V || isa<PointerType>(V->getType())) &&
         "SrcValue is not a pointer?");

why V must be a pointer?

thanks

--ether