Patch: Initialize target info for LLVM-C.

Hi,

Using a JIT engine on LLVM-C currently fails on SVN because the
LLVMInitialize???Info is never called.

The attached patch fixes this.

BTW, would it be possible to include a simple LLVM-C test case, like
NP Contemplation: The secret of the LLVM C bindings,
into the test suite, and build/test regularly to prevent regressions
like this?

Jose

llvm-c-initialize-target-info.patch (1.45 KB)

Applied as r79307, thanks

Hi,

Using a JIT engine on LLVM-C currently fails on SVN because the
LLVMInitialize???Info is never called.

The attached patch fixes this.

BTW, would it be possible to include a simple LLVM-C test case, like
NP Contemplation: The secret of the LLVM C bindings,
into the test suite, and build/test regularly to prevent regressions
like this?

Yes. This should probably be done as a unit tests, for example we
already have some JIT unittests for the C++ API. Want to make a patch
for it?

- Daniel

Does the 2.5 release version also fail for this reason? I'm trying to
JIT (through LLVM-C) from code generated by my compiler, and it's
segfaulting... I'd like to know if this is the problem or if something
else is going wrong.

Never mind, I found the problem. I've alloca'd an array to pass to
LLVMStruct, but the code to fill that array has gone missing. Thanks
anyway.