[LLVMdev] C++ type erasure in llvm-g++

Chris Lattner clattner at apple.com
Tue Mar 24 08:45:17 PDT 2009


On Mar 24, 2009, at 8:40 AM, Luke Dalessandro wrote:
> I'm curious about the type erasure that goes on when llvm-g++ compiles
> C++ code. Is this a consequence of it just being the easiest way to do
> things based on the design of gcc and how LLVM is plugged into it?

This is just due to how the G++ front-end happens to lower the C++  
types to C types internally.

> Can someone more familiar with the llvm-gcc infrastructure comment on
> the difficulty of generating more strongly typed virtual function  
> tables
> rather than just having them all be variable length arrays of pointers
> of unknown type and casting to the "known" type before the call?

This would require changing the G++ front-end.  I have no idea how  
difficult that would be.

-Chris



More information about the llvm-dev mailing list