<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Sep 12, 2007, at 01:01, Gordon Henriksen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div><div><div><span class="Apple-style-span" style="-webkit-text-stroke-width: -1; ">I'm authoring a C interface to the LLVM IR type system. Since this is Really Quite Tedious, I would like to solicit opinions before I get too far down any paths that seem offensive. I've attached the header, where I've mapped a portion of <font class="Apple-style-span" face="Courier">Module</font> and most of <font class="Apple-style-span" face="Courier">Type</font> and its subclasses. This is working, and I've built ocaml bindings on top of it.</span></div></div></div></div></blockquote><div><div><div><div><br class="webkit-block-placeholder"></div><div>Now with constants and globals variables. Functions and basic blocks next, then on to LLVMBuilder.</div><div><br class="webkit-block-placeholder"></div></div></div></div></div><div><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Trebuchet MS; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Trebuchet MS; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Trebuchet MS; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Trebuchet MS; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Trebuchet MS; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Trebuchet MS; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; ">— Gordon<br class="Apple-interchange-newline"></span></span></span></span></span></span> </div><br><div><br class="webkit-block-placeholder"></div><div><div>//===-- c-bindings.patch (+730) -------------------------------===//</div><div><br class="webkit-block-placeholder"></div><div>  include/llvm/CHelpers.h (+94)</div><div>  include/llvm-c/BitWriter.h (+42)</div><div>  include/llvm-c/Core.h (+221)</div><div>  lib/Bitcode/Writer/BitWriter.cpp (+51)</div><div>  lib/VMCore/Core.cpp (+322)</div><div><br class="webkit-block-placeholder"></div><div>Tedious C bindings for libLLVMCore.a and libLLVMBitWriter.a!</div><div><br class="webkit-block-placeholder"></div><div>- The naming prefix is LLVM.</div><div>- All types are represented using opaque references.</div><div>- Functions are not named LLVM{Type}{Method}; the names became unreadable goop.</div><div>  Instead, they are named LLVM{ImperativeSentence}.</div><div>- Where an attribute only appears once in the class hierarchy (e.g., linkage</div><div>  only applies to values; parameter types only apply to function types), the</div><div>  class is omitted from identifiers for brevity. Tastes like methods.</div><div>- Strings are C strings or string/length tuples on a case-by-case basis.</div><div>- APIs which give the caller ownership of an object are not mapped</div><div>  (removeFromParent, certain constructor overloads). This keeps</div><div>  keep memory management as simple as possible.</div><div><br class="webkit-block-placeholder"></div><div>For each library with bindings:</div><div><br class="webkit-block-placeholder"></div><div>  llvm-c/<LIB>.h       - Declares the bindings.</div><div>  lib/<LIB>/<LIB>.cpp  - Implements the bindings.</div><div><br class="webkit-block-placeholder"></div><div>So just link with the library of your choice and use the C header</div><div>instead of the C++ one.</div><div><br class="webkit-block-placeholder"></div><div>This patch is independent.</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>//===-- ocaml-make.patch (+380 -27) ---------------------------===//</div><div><br class="webkit-block-placeholder"></div><div>  configure (+111 -25)</div><div>  Makefile.config.in (+2)</div><div>  bindings/ocaml/Makefile.ocaml (+263)</div><div>  Makefile (+2 -2)</div><div>  autoconf/configure.ac (+2)</div><div><br class="webkit-block-placeholder"></div><div>I add a generic ocaml Makefile which will be used by the ocaml</div><div>language bindings.</div><div><br class="webkit-block-placeholder"></div><div>configure is schooled how to sniff ocamlc and ocamlopt.</div><div><br class="webkit-block-placeholder"></div><div>This patch is independent.</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>//===-- ocaml-bindings.patch (+936) ---------------------------===//</div><div><br class="webkit-block-placeholder"></div><div>  bindings/ocaml/llvm</div><div>  bindings/ocaml/llvm/llvm.ml (+226)</div><div>  bindings/ocaml/llvm/llvm_ocaml.c (+394)</div><div>  bindings/ocaml/llvm/llvm.mli (+168)</div><div>  bindings/ocaml/llvm/Makefile (+24)</div><div>  bindings/ocaml/bitwriter</div><div>  bindings/ocaml/bitwriter/llvm_bitwriter.mli (+18)</div><div>  bindings/ocaml/bitwriter/bitwriter_ocaml.c (+31)</div><div>  bindings/ocaml/bitwriter/llvm_bitwriter.ml (+18)</div><div>  bindings/ocaml/bitwriter/Makefile (+23)</div><div>  bindings/ocaml/Makefile (+13)</div><div>  bindings/README.txt (+3)</div><div>  bindings/Makefile (+18)</div><div><br class="webkit-block-placeholder"></div><div>Adds ocaml language bindings to LLVM. They are built automatically</div><div>if configure detects the ocamlc compiler and are installed to the</div><div>ocaml standard library.</div><div><br class="webkit-block-placeholder"></div><div>This patch depends on c-bindings and ocaml-make.</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><br class="webkit-block-placeholder"></div><div><span></span></div></body></html>