Export to GitHub

llvm-py - issue #25

Patch for compiling with LLVM 2.6


Posted on Sep 23, 2009 by Grumpy Dog

Hi, I've attached a patch to get llvm-py working with LLVM 2.6 (from SVN). This patch works with r82 of llvm-py. Here's a summary of the changes:

  • Removed instructions vicmp, and vfcmp.
  • Added instructions fadd, fsub, and fmul.
  • Removed is_trapping attribute of call instructions.
  • Updated following enums in core.py: type kinds, value ids, opcodes, linkage, attributes.
  • Updated wrap.cpp for api changes, e.g: replaced std::ostringstream with llvm::raw_string_stream, replaced llvm::ParseError with llvm::SMDiagnostic.
  • In wrap.cpp, removed those passes which have been added to the llvm-c api.
  • Regenerated _intrinsic_ids.py
  • In module init function, added calls to LLVMLinkInJIT, LLVMLinkInInterpreter, and LLVMInitializeNativeTarget. These calls are required for the JIT and Interpreter to work.

I've tested this patch on Mac OS X 10.4

Attachments

Comment #1

Posted on Oct 12, 2009 by Quick Rhino

Even with this patch, I can't cleanly import * from llvm.core with the current HEAD of 2.6 of LLVM. It complains about _LLVMCountDatatypes or something. Any hints there?

Comment #2

Posted on Oct 12, 2009 by Quick Rhino

Ah, the LLVMCountDatatypes seems to be specific to OS X. On Linux, it seems to work alright.

Comment #3

Posted on Oct 26, 2009 by Quick Rhino

Now that LLVM 2.6 is really out, it would be nice to put this into the tree (and maybe do a release). I'd like to put it in the Gentoo tree...

Comment #4

Posted on Oct 28, 2009 by Swift Lion

Applied, thanks!

Status: Fixed

Labels:
Type-Defect Priority-Medium