Commit Graph

64 Commits

Author SHA1 Message Date
Nick Lewycky 8811ecdadf Correct strange whitespace.
llvm-svn: 63927
2009-02-06 07:01:00 +00:00
Chris Lattner 41b43da217 add getPointerToGlobal to the C bindings, patch by Lennart Augustsson!
PR3364

llvm-svn: 62697
2009-01-21 18:11:10 +00:00
Duncan Sands dc020f9c3c Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.

llvm-svn: 62099
2009-01-12 20:38:59 +00:00
Gordon Henriksen 05a868f7af Add dyn_cast_or_null bindings for some additional classes missed in r61252.
llvm-svn: 61253
2008-12-19 18:51:17 +00:00
Gordon Henriksen 29e3894e7d C bindings for dyn_cast_or_null.
This operation can be used to build dyn_cast, isa, and cast.

llvm-svn: 61252
2008-12-19 18:39:45 +00:00
Chris Lattner 3d1f552643 This adds some missing functions to the C binding:
- ability to insert previously created instructions using a builder
- creation of aliases
- creation of inline asm constants

Patch by Zoltan Varga!

llvm-svn: 61153
2008-12-17 21:39:50 +00:00
Nick Lewycky af67df5881 Add protected visibility to libLTO.
llvm-svn: 60257
2008-11-29 22:49:59 +00:00
Dan Gohman d5104a5de6 Add C bindings for extractvalue and insertvalue. Patch by Frits van Bommel!
llvm-svn: 58650
2008-11-03 22:55:43 +00:00
Devang Patel 4c758ea3e0 Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage 
- to implement function notes as function attributes and 
- to distinguish between function attributes and return value attributes.

This requires corresponding changes in llvm-gcc and clang.

llvm-svn: 56622
2008-09-25 21:00:45 +00:00
Gordon Henriksen eeb6537abb PR2731: C and Ocaml bindings for setTailCall and isTailCall.
Based on patch by Giorgos Korfiatis.

llvm-svn: 55570
2008-08-30 16:34:54 +00:00
Gordon Henriksen d930f913e6 Rename some GC classes so that their roll will hopefully be clearer.
In particular, Collector was confusing to implementors. Several
thought that this compile-time class was the place to implement
their runtime GC heap. Of course, it doesn't even exist at runtime.
Specifically, the renames are:

  Collector               -> GCStrategy
  CollectorMetadata       -> GCFunctionInfo
  CollectorModuleMetadata -> GCModuleInfo
  CollectorRegistry       -> GCRegistry
  Function::getCollector  -> getGC (setGC, hasGC, clearGC)

Several accessors and nested types have also been renamed to be
consistent. These changes should be obvious.

llvm-svn: 54899
2008-08-17 18:44:35 +00:00
Gordon Henriksen 72c1c7d694 Delete a redundant binding, LLVMHasInitializer.
Please use !LLVMIsDeclaration instead.

llvm-svn: 54572
2008-08-09 02:13:58 +00:00
Gordon Henriksen 5225cd66cf Fix the LLVMCreateJITCompiler C binding.
Evan broke it in r54523 by adding a parameter in the implementation without
updating the header correspondingly.

llvm-svn: 54555
2008-08-08 20:49:28 +00:00
Eric Christopher 5927883970 Have IRBuilder take a template argument on whether or not to preserve
names. This can save a lot of allocations if you aren't going to be
looking at the output.

llvm-svn: 54546
2008-08-08 19:39:37 +00:00
Devang Patel a0e4fb8283 Provide a hook to set the code generation debug options to investigate lto failures.
llvm-svn: 53119
2008-07-03 22:53:14 +00:00
Gordon Henriksen 9f337549a7 Add C binding for ExecutionEngine::addGlobalMapping.
llvm-svn: 52523
2008-06-20 02:16:11 +00:00
Gordon Henriksen 00889ccfca Remove a duplicative binding. Patch by Mahadevan R.
llvm-svn: 51238
2008-05-19 05:47:10 +00:00
Gordon Henriksen 6ea927b1d7 Improve documentation.
llvm-svn: 50768
2008-05-06 19:17:01 +00:00
Gordon Henriksen a735a9c481 Use (void) instead of () in C code.
llvm-svn: 50620
2008-05-04 12:55:34 +00:00
Anton Korobeynikov 5bf6876ab8 Correct parameter attributes encoding for C bindings.
Patch by Anders Johnsen!

llvm-svn: 50375
2008-04-28 21:48:04 +00:00
Gordon Henriksen 2d9cc2197a Expose parameter attributes via C bindings.
Patch by Anders Johnsen!

llvm-svn: 50360
2008-04-28 17:37:06 +00:00
Gordon Henriksen 2ad5aef5e6 PR2245: Misleading parameter name in llvm-c/Core.h:LLVMConstArray
Applying fix by Frits van Bommel.

llvm-svn: 50250
2008-04-25 03:21:19 +00:00
Duncan Sands a07136ee2d Merge LLVMBuilder and FoldingBuilder, calling
the result IRBuilder.  Patch by Dominic Hamon.

llvm-svn: 49604
2008-04-13 06:22:09 +00:00
Erick Tryzelaar 4a0da98825 Expose Function::viewCFG and Function::viewCFGOnly to bindings.
llvm-svn: 48982
2008-03-31 16:22:09 +00:00
Erick Tryzelaar 8ac07c2834 Expose ExecutionEngine::getTargetData() to c and ocaml bindings.
llvm-svn: 48851
2008-03-27 00:27:14 +00:00
Gordon Henriksen 07a45f4edb Objective Caml bindings for basic block, function, global, and arg iterators.
llvm-svn: 48711
2008-03-23 22:21:29 +00:00
Gordon Henriksen b81777a354 C and Objective Caml bindings for mem2reg and reg2mem.
Patch by Erick Tryzelaar.

llvm-svn: 48602
2008-03-20 17:16:03 +00:00
Gordon Henriksen 054817ce06 C bindings for Module-, Function-, and BasicBlock::iterator.
llvm-svn: 48528
2008-03-19 03:47:18 +00:00
Gordon Henriksen 265f780c22 C and Objective Caml bindings for the various getParent methods of the IR.
Based on Erick Tryzelaar's patch.

llvm-svn: 48523
2008-03-19 01:11:35 +00:00
Gordon Henriksen ab4b7d36cd C and Objective Caml bindings for the TargetData class.
llvm-svn: 48422
2008-03-16 20:08:03 +00:00
Gordon Henriksen 82a0e74f43 C and Objective Caml bindings for several scalar transforms.
Patch originally by Erick Tryzelaar, but has been modified somewhat.

llvm-svn: 48419
2008-03-16 16:32:40 +00:00
Gordon Henriksen 9657149875 Remove unnecessary includes.
llvm-svn: 48418
2008-03-16 15:55:43 +00:00
Gordon Henriksen 878114bf16 C and Objective Caml bindings for PassManagers.
llvm-svn: 48413
2008-03-16 04:20:44 +00:00
Gordon Henriksen 6c6075e326 Expose Module::dump via C and Ocaml.
Patch by Erick Tryzelaar.

llvm-svn: 48379
2008-03-14 23:58:56 +00:00
Gordon Henriksen a49d435b27 Cleanup some comments in the OCaml bindings.
Patch by Erick Tryzelaar.

llvm-svn: 48014
2008-03-07 19:13:06 +00:00
Nick Kledzik 91a6dcff32 fixes from review of first commit
llvm-svn: 47695
2008-02-27 22:25:36 +00:00
Nick Kledzik 07b4a62234 first commit of new LTO system. It is not hooked up in the llvm/tools/Makefile, so no one will build it be default yet
llvm-svn: 47621
2008-02-26 20:26:43 +00:00
Gordon Henriksen 931e121ad1 Fixing a bug creating floating point constants of type other
than double through the C bindings. Thanks to Tomas Lindquist
Olsen for reporting it.

llvm-svn: 46656
2008-02-02 01:07:50 +00:00
Gordon Henriksen 097102c32a Adding C bindings for SwitchInst::addCase.
Patch by Bryan O'Sullivan!

llvm-svn: 45481
2008-01-01 05:50:53 +00:00
Gordon Henriksen 4a4d73519e Add some doxygen comments to llvm-c/Core.h.
llvm-svn: 45450
2007-12-30 17:46:33 +00:00
Gordon Henriksen 1158c533f7 Bindings for instruction calling conventions.
llvm-svn: 45422
2007-12-29 20:45:00 +00:00
Chris Lattner e9cc742a17 Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Gordon Henriksen 05568bbd98 Adding bindings for target triple and data layout.
llvm-svn: 45369
2007-12-27 20:13:47 +00:00
Gordon Henriksen 823f9730d7 Switch the bindings to use LLVMFoldingBuilder.
llvm-svn: 45367
2007-12-27 18:25:59 +00:00
Gordon Henriksen 2a8cd89d03 C and Ocaml bindings for ExecutionEngine (i.e., the JIT compiler).
llvm-svn: 45335
2007-12-23 16:59:28 +00:00
Gordon Henriksen 34eb6d877e Adding bindings for memory buffers and module providers. Switching
to exceptions rather than variants for error handling in Ocaml.

llvm-svn: 45226
2007-12-19 22:30:40 +00:00
Gordon Henriksen 5a3fe03784 C and Ocaml bindings for address spaces, for that burgeoning market
for Ocaml-based compilers targeting embedded devices. :)

llvm-svn: 45096
2007-12-17 16:08:32 +00:00
Gordon Henriksen 0a68fe2ffc Add (very basic) bindings for ModuleProvider.
llvm-svn: 44899
2007-12-12 01:04:30 +00:00
Gordon Henriksen 2b0eed278b Adding Ocaml bindings for the bitreader as requested by Sarah
Thompson. Usage should be something like this:

open Llvm
open Llvm_bitreader

match read_bitcode_file fn with
  | Bitreader_failure msg ->
      prerr_endline msg
  | Bitreader_success m -> 
      ...;
      dispose_module m

Compile with: ocamlc llvm.cma llvm_bitreader.cma
              ocamlopt llvm.cmxa llvm_bitreader.cmxa

llvm-svn: 44824
2007-12-11 00:20:48 +00:00
Gordon Henriksen 71183b6739 Adding a collector name attribute to Function in the IR. These
methods are new to Function:

  bool hasCollector() const;
  const std::string &getCollector() const;
  void setCollector(const std::string &);
  void clearCollector();

The assembly representation is as such:

  define void @f() gc "shadow-stack" { ...

The implementation uses an on-the-side table to map Functions to 
collector names, such that there is no overhead. A StringPool is 
further used to unique collector names, which are extremely
likely to be unique per process.

llvm-svn: 44769
2007-12-10 03:18:06 +00:00