[llvm-commits] [llvm] r96214 - /llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h

Chris Lattner clattner at apple.com
Wed Feb 17 11:29:30 PST 2010


On Feb 17, 2010, at 9:06 AM, Dan Gohman wrote:

>> 
>> I'm ok with it if that is the direction you want to go, but it seems much more natural to treat SDValue as a "rich pointer". It seems much more natural to use V->getOpcode() than V.getOpcode() or V.getOperand() etc.  The duplicated methods don't make a lot of sense to me (and yes, I'm to blame for the original poor design).
> 
> Basically, I think "rich pointer" is the wrong concept for SDValue.
> It's really a (Node, ResNo) pair, and thinking about it as a pointer
> means it's carrying around extra bits which sometimes matter and
> sometimes don't.

I understand the desire to avoid the extra cost, but if passed by value it should be *that* bad, should it?

> I'd eventually like to get rid of both V.getOpcode() and V->getOpcode()
> and replace them with V.getNode()->getOpcode(), for code that really
> needs to do that kind of thing.

I'm ok with that if we really do get rid of the convenience functions.  It seems extremely inconvenient and verbose to always have to use .getNode()-> though.

-Chris



More information about the llvm-commits mailing list