[LLVMdev] DebugFactory

Talin viridia at gmail.com
Tue Sep 22 00:14:00 PDT 2009

So, one feature of the late, lamented DebugInfoBuilder that I am missing 
quite badly, and which is not available in the current DIFactory, is the 
ability to specify structure offsets abstractly. The DebugFactory 
requires that you pass in structure offset information as ints, whereas 
DebugInfoBuilder had "offsetOf" and "alignOf" methods, similar to the 
"sizeOf" trick, that would create the constants for you in a way that 
didn't require your front end to know the sizes of things. So far I've 
been able to avoid having any references to target machines in my 
frontend, but now that I am trying to flesh out my debug info more fully 
I'm finding it hard to use DIFactory as-is.

What I'd like to see is a set of alternative factory methods in 
DIFactory, where you pass in an LLVM type, and possibly a GEP index, 
plus all of the parameters that it can't figure out from looking at the 
type. So you can eliminate the offset, size, and alignment parameters 
since those can be figured out from the type.

-- Talin

More information about the llvm-dev mailing list