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. - D. -------------- next part -------------- A non-text attachment was scrubbed... Name: llvm.patch Type: text/x-patch Size: 5153 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110805/e3b6d54e/attachment.bin>
Hi, Please see the collection of test cases attached. To build everything execute make in the top directory. Files with logs show how compilation fails/succeeds, depending on patched/unpatched version of llvm. Could we setup this test suite as a regular test for C backend? Thanks, - D. 2011/8/5 Dmitry N. Mikushin <maemarcus at gmail.com>:> 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. > > - D. >-------------- next part -------------- A non-text attachment was scrubbed... Name: cbe_tests.tar.gz Type: application/x-gzip Size: 33710 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110805/64087515/attachment.bin>
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
On Fri, Aug 5, 2011 at 10:33 AM, Dmitry N. Mikushin <maemarcus at gmail.com> wrote:> Hi, > > Please see the collection of test cases attached. To build everything > execute make in the top directory. Files with logs show how > compilation fails/succeeds, depending on patched/unpatched version of > llvm. > > Could we setup this test suite as a regular test for C backend?We really don't have a particularly good place in the existing test infrastructure for testing the C backend... and there's generally low interest in it. If you have a use for the C backend, I would suggest making sure there are quality regression tests in test/CodeGen/CBackend (so things don't accidentally break), and regularly testing your uses yourself. -Eli