[LLVMdev] llc c backend can produce code that doesn't compile on gcc 4.x

Chris Lattner sabre at nondot.org
Mon Jan 15 23:47:44 PST 2007


On Tue, 16 Jan 2007, Gordon Henriksen wrote:
> The simplest solution is to avoid typedefs for array types. With
> names of array types removed from the symbol table, llc will simply
> output (for instance) 'l_structtype_s[3]' instead of the equivalent
> 'l_fixarray_array3'.

Very nice catch and approach.

> A more ambitious fix would be to merge the "typedef" and "structure
> contents" loops into a single, substantially more complex dependency-
> ordered traversal. This would preserve type names from the bytecode
> fileā€”but to what end?

Good question, I can't think of a reason!  I applied your patch but 
generalized it slightly.  The CBE now strips off any non-struct type 
names, to avoid issues with vectors (if the CBE starts supporting them in 
the future).

Thanks Gordon!

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/


More information about the llvm-dev mailing list