[LLVMdev] Experimental fixes to CBackend

Eli Friedman eli.friedman at gmail.com
Wed Aug 10 11:30:43 PDT 2011


On Fri, Aug 5, 2011 at 7:57 AM, Dmitry N. Mikushin <maemarcus at gmail.com> wrote:
> Hi,
>
> LLVM C backend as of revision 136600 suffers from the following issues:
>
> * Forward structs declarations block is missing (it was there
> previously, why was it removed?)
> * Anonymous container structs are not generated for array types,
> resulting into declarations being placed directly into functions
> prototypes (previously it was not happening as well)
>
> I'm not very familiar with llvm internals, but tried by best to fix
> the problems. Please see proposed patches in attachment. Briefly, I'm
> creating fictive StructType for each ArrayType and slightly changing
> logic of anonymous structs definition to account the special case of
> ArrayType-s.

The patch seems sane, although I'm not an expert in how the C backend
works.  Please include some regression tests using FileCheck in
test/CodeGen/CBackend.  (While you're at it, rewriting some of the
existing tests to actually check their output would be a good idea.)

-Eli



More information about the llvm-dev mailing list