[llvm-commits] [llvm] r58278 - in /llvm/trunk: include/llvm/CodeGen/DAGISelHeader.h lib/Target/ARM/ARMISelDAGToDAG.cpp lib/Target/Alpha/AlphaISelDAGToDAG.cpp lib/Target/CellSPU/SPUISelDAGToDAG.cpp lib/Target/IA64/IA64ISelDAGToDAG.cpp lib/Target/Mips/MipsISelDAGToDAG.cpp lib/Target/PIC16/PIC16ISelDAGToDAG.cpp lib/Target/PowerPC/PPCISelDAGToDAG.cpp lib/Target/Sparc/SparcISelDAGToDAG.cpp lib/Target/X86/X86ISelDAGToDAG.cpp utils/TableGen/DAGISelEmitter.cpp

David Greene dag at cray.com
Tue Oct 28 11:56:47 PDT 2008


On Tuesday 28 October 2008 13:42, Dan Gohman wrote:

> >> This DAG parameter shouldn't be necessary. SelectRoot is a member
> >> of SelectionDAGISel, where it can access the CurDAG member.
> >
> > It is?  Then why isn't it qualified by a scoping operator?
>
> It's actually #included inside of the target-specific SelectionDAGISel
> subclasses, so syntactically it's an inline function. This is a little
> unusual, but it allows targets to share this code while avoiding the
> need for a virtual function call to get back into target-specific code.
> I suppose the same effect could be had using templates, but the

CRTP is perfect for this kind of thing.  But things work now so I wouldn't
disturb it unless we have a cleanup goal later on.

                                           -Dave



More information about the llvm-commits mailing list