- Sep 18, 2007
-
-
Gordon Henriksen authored
built atop the C language bindings, and user programs can link with them as such: # Bytecode ocamlc -cc g++ llvm.cma llvmbitwriter.cma -o example example.ml # Native ocamlopt -cc g++ llvm.cmxa llvmbitwriter.cmxa -o example.opt example.ml The vmcore.ml test exercises most/all of the APIs thus far bound. Unfortunately, they're not yet numerous enough to write hello world. But: $ cat example.ml (* example.ml *) open Llvm open Llvm_bitwriter let _ = let filename = Sys.argv.(1) in let m = create_module filename in let v = make_int_constant i32_type 42 false in let g = define_global "hello_world" v m in if not (write_bitcode_file m filename) then exit 1; dispose_module m; $ ocamlc -cc g++ llvm.cma llvm_bitwriter.cma -o example example.ml File "example.ml", line 11, characters 6-7: Warning Y: unused variable g. $ ./example example.bc $ llvm-dis < example.bc ; ModuleID = '<stdin>' @hello_world = global i32 42 ; <i32*> [#uses=0] The ocaml test cases provide effective tests for the C interfaces. llvm-svn: 42093
-
Gordon Henriksen authored
llvm-svn: 42092
-
Gordon Henriksen authored
llvm-svn: 42091
-
Gordon Henriksen authored
llvm-svn: 42090
-
Gordon Henriksen authored
llvm-svn: 42087
-
Bill Wendling authored
llvm-svn: 42086
-
Bill Wendling authored
llvm-svn: 42079
-
Bill Wendling authored
function. The information isn't used heavily -- it's only used at the end of exception handling emission -- so there's no need to cache it. llvm-svn: 42078
-
Gordon Henriksen authored
- The naming prefix is LLVM. - All types are represented using opaque references. - Functions are not named LLVM{Type}{Method}; the names became unreadable goop. Instead, they are named LLVM{ImperativeSentence}. - Where an attribute only appears once in the class hierarchy (e.g., linkage only applies to values; parameter types only apply to function types), the class is omitted from identifiers for brevity. Tastes like methods. - Strings are C strings or string/length tuples on a case-by-case basis. - APIs which give the caller ownership of an object are not mapped (removeFromParent, certain constructor overloads). This keeps keep memory management as simple as possible. For each library with bindings: llvm-c/<LIB>.h - Declares the bindings. lib/<LIB>/<LIB>.cpp - Implements the bindings. So just link with the library of your choice and use the C header instead of the C++ one. llvm-svn: 42077
-
Gordon Henriksen authored
Also adding some missing svn:ignores that've been bothering me. llvm-svn: 42076
-
Devang Patel authored
llvm-svn: 42075
-
Bill Wendling authored
"_-[NSString(local) isNullOrNil]".eh = 0 .no_dead_strip "_-[NSString(local) isNullOrNil]".eh The ".eh" should be inside the quotes. llvm-svn: 42074
-
Bill Wendling authored
llvm-svn: 42071
-
Evan Cheng authored
llvm-svn: 42069
-
Devang Patel authored
Do not hide APInt::dump() inside #ifndef NDEBUG. llvm-svn: 42068
-
- Sep 17, 2007
-
-
Tanya Lattner authored
Fix broken default help strings for enable-shared, enable-static, and enable-fast-install. Regenerate configure script. llvm-svn: 42066
-
Devang Patel authored
for(int i = 0; i < N; i++) { if ( i == XYZ) { A; else B; } C; D; } llvm-svn: 42058
-
Devang Patel authored
llvm-svn: 42054
-
Gordon Henriksen authored
LLVM now enforces the following prototypes for the write barriers: <ty>* @llvm.gcread(<ty2>*, <ty>**) void @llvm.gcwrite(<ty>*, <ty2>*, <ty>**) And for @llvm.gcroot, the first stack slot is verified to be an alloca or a bitcast of an alloca. Fixes test/CodeGen/Generic/GC/lower_gcroot.ll, which violated these. llvm-svn: 42051
-
Dale Johannesen authored
and storeRegToStackSlot. Evan and I concluded this should never be needed and it appears to be true. (It if is needed, adjustment would be needed for long double to work.) llvm-svn: 42049
-
Devang Patel authored
llvm-svn: 42048
-
Devang Patel authored
APInt::dump() is inside #ifndef NDEBUG, however SelectionDAG dump() routines are not. llvm-svn: 42047
-
Dale Johannesen authored
complete, but common cases work) llvm-svn: 42043
-
Chris Lattner authored
Add a new DenseMapInfo::isEqual method to allow clients to redefine the equality predicate used when probing the hash table. llvm-svn: 42042
-
Daniel Berlin authored
llvm-svn: 42040
-
Daniel Berlin authored
llvm-svn: 42039
-
Dan Gohman authored
llvm-svn: 42038
-
Evan Cheng authored
llvm-svn: 42037
-
Chris Lattner authored
llvm-svn: 42036
-
Dan Gohman authored
llvm-svn: 42035
-
Gordon Henriksen authored
llvm-svn: 42032
-
Dan Gohman authored
can terminate a block with no fall-through. llvm-svn: 42029
-
Dan Gohman authored
llvm-svn: 42027
-
Dan Gohman authored
64-bit) can use test instead of cmp with an immediate. llvm-svn: 42026
-
Dan Gohman authored
previously only done for 32-bit and smaller operands. llvm-svn: 42024
-
Duncan Sands authored
llvm-svn: 42021
-
Dale Johannesen authored
so only works on x86 target). llvm-svn: 42019
-
Daniel Berlin authored
Add operator == and != to SparseBitVector. Simplify code for test_and_set llvm-svn: 42018
-
Daniel Berlin authored
llvm-svn: 42017
-
- Sep 16, 2007
-
-
Daniel Berlin authored
llvm-svn: 42016
-