Commit Graph

113 Commits

Author SHA1 Message Date
Rafael Espindola 7c0cb2bbf5 Expose getTypeName to the C API. Patch by Patrick Walton.
llvm-svn: 125845
2011-02-18 16:35:37 +00:00
Michael J. Spencer ab425d8360 I swear I did a make clean and make before committing all this...
llvm-svn: 120304
2010-11-29 18:47:54 +00:00
Chris Lattner a7e04b04c5 add a function to the C api to get the context out of a module, patch
by Eric Dobson!

llvm-svn: 120259
2010-11-28 20:03:44 +00:00
Chris Lattner 4329e078ac add a 'LLVMConstIntOfArbitraryPrecision' api to the C api,
patch by Greg Pfeil!

llvm-svn: 119989
2010-11-23 02:47:22 +00:00
Owen Anderson 4698c5d7f7 Next step on the getting-rid-of-static-ctors train: begin adding per-library
initialization functions that initialize the set of passes implemented in
that library.  Add C bindings for these functions as well.

llvm-svn: 115927
2010-10-07 17:55:47 +00:00
Dale Johannesen 95b67aff5b Add missing X86 MMX declarations. Hopefully fixes buildbot?
llvm-svn: 113643
2010-09-10 21:58:02 +00:00
Dale Johannesen baa5d045c9 Add X86 MMX type to bitcode and Type.
(The Ada bindings probably need it too, but all the
obvious places to change say "do not edit this file".)

llvm-svn: 113618
2010-09-10 20:55:01 +00:00
Chris Lattner 13ee795c42 remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.

llvm-svn: 112356
2010-08-28 04:09:24 +00:00
Bill Wendling 578ee4070c Create the new linker type "linker_private_weak_def_auto".
It's similar to "linker_private_weak", but it's known that the address of the
object is not taken. For instance, functions that had an inline definition, but
the compiler decided not to inline it. Note, unlike linker_private and
linker_private_weak, linker_private_weak_def_auto may have only default
visibility.  The symbols are removed by the linker from the final linked image
(executable or dynamic library).

llvm-svn: 111684
2010-08-20 22:05:50 +00:00
Erick Tryzelaar b4d48706ca Expose LLVMSetOperand and LLVMGetNumOperands to llvm-c and ocaml.
llvm-svn: 111625
2010-08-20 14:51:22 +00:00
Duncan Sands b1d61aab06 Expose BasicBlock::moveBefore and moveAfter in C API, patch
by Benjamin Saunders.

llvm-svn: 108699
2010-07-19 15:31:07 +00:00
Bill Wendling 03bcd6ecc8 Implement the "linker_private_weak" linkage type. This will be used for
Objective-C metadata types which should be marked as "weak", but which the
linker will remove upon final linkage. However, this linkage isn't specific to
Objective-C.

For example, the "objc_msgSend_fixup_alloc" symbol is defined like this:

      .globl l_objc_msgSend_fixup_alloc
      .weak_definition l_objc_msgSend_fixup_alloc
      .section __DATA, __objc_msgrefs, coalesced
      .align 3
l_objc_msgSend_fixup_alloc:
       .quad   _objc_msgSend_fixup
       .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

Currently only supported on Darwin platforms.

llvm-svn: 107433
2010-07-01 21:55:59 +00:00
Bill Wendling 3632171750 Revert r107205 and r107207.
llvm-svn: 107215
2010-06-29 22:34:52 +00:00
Bill Wendling 1767723dbe Introducing the "linker_weak" linkage type. This will be used for Objective-C
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:

       .globl l_objc_msgSend_fixup_alloc
       .weak_definition l_objc_msgSend_fixup_alloc
       .section __DATA, __objc_msgrefs, coalesced
       .align 3
l_objc_msgSend_fixup_alloc:
        .quad   _objc_msgSend_fixup
        .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

llvm-svn: 107205
2010-06-29 21:24:00 +00:00
Chris Lattner 2694145e2e add attributes and module level asm to the ocaml bindings,
patch by Patrick Walton!

llvm-svn: 100932
2010-04-10 17:52:58 +00:00
Erick Tryzelaar 8f69feac47 Expose alignment and stack alignment attributes to llvm-c and ocaml.
llvm-svn: 97682
2010-03-03 23:51:25 +00:00
Erick Tryzelaar ad0e0cb0df Add Module functions in place of module providers.
llvm-svn: 97608
2010-03-02 23:58:54 +00:00
Erick Tryzelaar 9f9857e98c Rename LLVMUseIteratorRef to LLVMUseRef since we don't refer to iterators in llvm-c.
llvm-svn: 97585
2010-03-02 20:32:28 +00:00
Erick Tryzelaar 06894b3824 Add support for global variables in an address space for llvm-c and ocaml.
llvm-svn: 97377
2010-02-28 09:46:13 +00:00
Erick Tryzelaar 0fb26ef01f Add indirect br support to llvm-c and ocaml.
llvm-svn: 97376
2010-02-28 09:46:06 +00:00
Erick Tryzelaar d8531faf95 Add metadata functions to llvm-c and ocaml.
llvm-svn: 97375
2010-02-28 09:45:59 +00:00
Erick Tryzelaar 4c340c7f7f Add the new builder arthmetic instructions to llvm-c and ocaml.
llvm-svn: 97372
2010-02-28 05:51:43 +00:00
Erick Tryzelaar a8053dfd27 Add the new union arthmetic instructions to llvm-c and ocaml.
llvm-svn: 97371
2010-02-28 05:51:33 +00:00
Erick Tryzelaar 318317961c Add generic binary op and cast builder functions.
llvm-svn: 97370
2010-02-28 05:51:27 +00:00
Erick Tryzelaar 5bf1a325dc Fix a typo in an LLVMOpcode enum. LLVMTrunk -> LLVMTrunc.
llvm-svn: 96324
2010-02-16 03:45:23 +00:00
Bill Wendling da52cec9e3 Remove c++ style comments from c header.
llvm-svn: 96266
2010-02-15 20:53:17 +00:00
Bill Wendling 07d6d76269 Renumber Instruction enums in llvm-c.
llvm-svn: 96264
2010-02-15 20:50:51 +00:00
Chris Lattner 392be58cad Add support for a union type in LLVM IR. Patch by Talin!
llvm-svn: 96011
2010-02-12 20:49:41 +00:00
Jakob Stoklund Olesen 74bb06c0f0 Reintroduce the InlineHint function attribute.
This time it's for real! I am going to hook this up in the frontends as well.

The inliner has some experimental heuristics for dealing with the inline hint.
When given a -respect-inlinehint option, functions marked with the inline
keyword are given a threshold just above the default for -O3.

We need some experiments to determine if that is the right thing to do.

llvm-svn: 95466
2010-02-06 01:16:28 +00:00
Jeffrey Yasskin 091217be6f Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods.  The bindings to
other languages still use the ModuleProvider concept.  It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.

llvm-svn: 94686
2010-01-27 20:34:15 +00:00
Chris Lattner 7ba0661f27 Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore.  libvmcore is
currently blocked on bugpoint, which uses EH.  Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.

llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Eric Christopher 8444d7536c Remove the InlineHint attribute. There are no current or planned
users.

llvm-svn: 93558
2010-01-15 21:36:30 +00:00
Chris Lattner 25963c6113 "In order to ease automatic bindings generation, it would be helpful if boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for."
Patch by James Y Knight!

llvm-svn: 93079
2010-01-09 22:27:07 +00:00
Devang Patel be94f23992 Remove dead debug info intrinsics.
Intrinsic::dbg_stoppoint
 Intrinsic::dbg_region_start 
 Intrinsic::dbg_region_end 
 Intrinsic::dbg_func_start
AutoUpgrade simply ignores these intrinsics now.

llvm-svn: 92557
2010-01-05 01:10:40 +00:00
Duncan Sands 9d786d701d I forgot to update the prototype for LLVMBuildIntCast when correcting
the body to not pass the name for the isSigned parameter.  However it
seems that changing prototypes is a big-no-no, so here I revert the
previous change and pass "true" for isSigned, meaning this always does
a signed cast, which was the previous behaviour assuming the name was
not NULL!  Some other C function needs to be introduced for the general
case of signed or unsigned casts.  This hopefully unbreaks the ocaml
binding.

llvm-svn: 89648
2009-11-23 10:49:03 +00:00
Victor Hernandez de5ad42aa1 Remove FreeInst.
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.

llvm-svn: 85176
2009-10-26 23:43:48 +00:00
Chandler Carruth 56869f22c4 Move DataTypes.h to include/llvm/System, update all users. This breaks the last
direct inclusion edge from System to Support.

llvm-svn: 85086
2009-10-26 01:35:46 +00:00
Victor Hernandez 8acf2956b8 Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
llvm-svn: 84969
2009-10-23 21:09:37 +00:00
Victor Hernandez a3aaf85e23 Remove MallocInst from LLVM Instructions.
llvm-svn: 84299
2009-10-17 01:18:07 +00:00
Chris Lattner 40cf28d6eb add some more hooks to the C bindings, patch by Kenneth Uildriks!
llvm-svn: 83821
2009-10-12 04:01:02 +00:00
Dan Gohman f919bd6651 Add C API calls for building FNeg operations. Patch by KS Sreeram!
llvm-svn: 83021
2009-09-28 21:51:41 +00:00
Dan Gohman e4ca02da1b Revert 80959. It isn't sufficient to solve the full problem. And it
introduced regressions in the Ocaml bindings tests.

llvm-svn: 80969
2009-09-03 23:34:49 +00:00
Dan Gohman 2a53b30f6d Remove the API for creating ConstantExprs with the nsw, nuw, inbounds,
and exact flags. Because ConstantExprs are uniqued, creating an
expression with this flag causes all expressions with the same operands
to have the same flag, which may not be safe. Add, sub, mul, and sdiv
ConstantExprs are usually folded anyway, so the main interesting flag
here is inbounds, and the constant folder already knows how to set the
inbounds flag automatically in most cases, so there isn't an urgent need
for the API support.

This can be reconsidered in the future, but for now just removing these
API bits eliminates a source of potential trouble with little downside.

llvm-svn: 80959
2009-09-03 22:17:40 +00:00
Erick Tryzelaar f34cb0cab4 Make sure we specify no arguments for context functions.
llvm-svn: 80525
2009-08-30 23:38:06 +00:00
Dale Johannesen 2aaf539564 Add an 'inline hint' attribute to represent source
code hints that it would be a good idea to inline
a function ("inline" keyword).  No functional change
yet; FEs do not emit this and inliner does not use it.

llvm-svn: 80063
2009-08-26 01:08:21 +00:00
Erick Tryzelaar fd529d7dc4 Expose some extra functions to llvm-c
llvm-svn: 79413
2009-08-19 08:36:49 +00:00
Erick Tryzelaar dd99135721 Expose creating constant ints and floats from strings in llvm-c.
llvm-svn: 79213
2009-08-16 23:36:46 +00:00
Erick Tryzelaar 9813beadcd Add an llvm-c function that lets you insert an instruction with a name.
llvm-svn: 79163
2009-08-16 02:20:57 +00:00
Erick Tryzelaar 4cc690cce4 Expose most of the Constant creation functions to llvm-c.
llvm-svn: 79160
2009-08-16 02:20:12 +00:00
Erick Tryzelaar 3045b8b5d6 Expose most of the rest of IRBuilder's functions to llvm-c.
llvm-svn: 79159
2009-08-16 02:19:59 +00:00