Commit Graph

116 Commits

Author SHA1 Message Date
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
Chris Lattner 852f2653c4 remove the now dead condprop pass, PR3906.
llvm-svn: 86810
2009-11-11 05:56:35 +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 e297149e26 Auto-upgrade free instructions to calls to the builtin free function.
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.

llvm-svn: 84987
2009-10-24 04:23:03 +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
Daniel Dunbar f4e7b6cca4 Add LLVMInitializeAllTargetInfos for C api, and update
LLVMInitializeNativeTarget to initialize target info.
 - Patch by Jose Fonseca.

llvm-svn: 79307
2009-08-18 03:03:27 +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
Erick Tryzelaar 262332f24b Expose LLVMContext to llvm-c.
llvm-svn: 78964
2009-08-14 00:01:31 +00:00
Erick Tryzelaar 70ede4843c Change llvm-c's ordering of contexts to make it consistent.
llvm-svn: 78656
2009-08-11 07:46:16 +00:00
Bill Wendling 002b16724e Put new enum at end of list to avoid changing ABI.
llvm-svn: 76447
2009-07-20 18:22:52 +00:00
Bill Wendling a3c6f6bffa Add plumbing for the `linker_private' linkage type. This type is meant for
"private" symbols which the assember shouldn't strip, but which the linker may
remove after evaluation. This is mostly useful for Objective-C metadata.

This is plumbing, so we don't have a use of it yet. More to come, etc.

llvm-svn: 76385
2009-07-20 01:03:30 +00:00
Anton Korobeynikov 9750be9776 Fix copy & paste errors
llvm-svn: 76216
2009-07-17 18:57:16 +00:00
Anton Korobeynikov 08c08870f9 Add missed attributes to C bindings
llvm-svn: 76214
2009-07-17 18:55:30 +00:00
Anton Korobeynikov c8ce7b08ba Add support for naked functions
llvm-svn: 76198
2009-07-17 18:07:26 +00:00
Chris Lattner dac44ec99b Update the C bindings to keep the LLVMTypeKind up to date between the C/C++
stuff.  Patch by Zoltan Varga!

llvm-svn: 75842
2009-07-15 22:00:31 +00:00
Dan Gohman 00d4fb45e5 llvm-c/Core.h is no longer needed in lto.h, and it brings in
several unwanted dependencies.

llvm-svn: 75717
2009-07-15 00:47:00 +00:00
Daniel Dunbar 65553d4505 Match declaration to definition.
llvm-svn: 75440
2009-07-12 23:50:34 +00:00
Chris Lattner b797115561 add missing *, patch by Peter O'Gorman!
llvm-svn: 75259
2009-07-10 18:28:19 +00:00
Nick Lewycky a21d3daadc Remove the vicmp and vfcmp instructions. Because we never had a release with
these instructions, no autoupgrade or backwards compatibility support is
provided.

llvm-svn: 74991
2009-07-08 03:04:38 +00:00
Chris Lattner 7f31824a44 Add two new accessors to the C bindings, patch by Wladimir van der Laan!
llvm-svn: 74836
2009-07-06 17:29:59 +00:00
Owen Anderson 31d44e4904 Restore other bits of the C API that I tore up. All pre-existing APIs default to using the
default global context, while new *InContext() APIs have been added that take a LLVMContextRef parameter.

Apologies to anyone affected by this breakage.

llvm-svn: 74694
2009-07-02 07:17:57 +00:00
Owen Anderson 0ff993839c Maintain the old LTO API, by using the global context.
llvm-svn: 74678
2009-07-02 00:31:14 +00:00
Owen Anderson f7691d398d Add a C wrapper for accessing the global default context.
llvm-svn: 74675
2009-07-02 00:16:38 +00:00
Owen Anderson 54648d867f Fix the LTO header for LLVMContext changes.
llvm-svn: 74663
2009-07-01 23:28:55 +00:00
Owen Anderson 1cf085d558 Hold the LLVMContext by reference rather than by pointer.
llvm-svn: 74640
2009-07-01 21:22:36 +00:00
Owen Anderson 6773d388aa Add a pointer to the owning LLVMContext to Module. This requires threading LLVMContext through a lot
of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools.

Patches for Clang and LLVM-GCC to follow.

llvm-svn: 74614
2009-07-01 16:58:40 +00:00
Bob Wilson a1d3e660ae Fix the Ocaml bindings for the ExecutionEngine: with the change to build
libraries instead of relinked objects, the interpreter, JIT, and native
target libraries were not being linked in to an ocaml program using the
ExecutionEngine.

llvm-svn: 74117
2009-06-24 21:09:18 +00:00
Bob Wilson 5a495fea07 Provide InitializeAllTargets and InitializeNativeTarget functions in the
C bindings.  Change all the backend "Initialize" functions to have C linkage.
Change the "llvm/Config/Targets.def" header to use C-style comments to avoid
compile warnings.

llvm-svn: 74026
2009-06-23 23:59:40 +00:00
Nick Kledzik cac8c8a9b3 <rdar://problem/6940611> libLTO.dylib needs to let linker specify path to assembler
Add lto_codegen_set_assembler_path() API which allows the linker to specify the
path to the assembler tool to run.  When assembler is used (instead of compiler)
different command line options are used.
Add LTO_API_VERSION #define so clients (linkers) can conditionalize use of new APIs.

llvm-svn: 72823
2009-06-04 00:28:45 +00:00
Duncan Sands af9eaa830a Rename PaddedSize to AllocSize, in the hope that this
will make it more obvious what it represents, and stop
it being confused with the StoreSize.

llvm-svn: 71349
2009-05-09 07:06:46 +00:00
Duncan Sands 7374a0118d OCaml parameter attribute bindings from PR2752.
Incomplete, but better than nothing.

llvm-svn: 71081
2009-05-06 12:21:17 +00:00
Nick Lewycky e6141a5d6f Oops! Missed a file in my last commit.
llvm-svn: 70491
2009-04-30 15:29:26 +00:00
Bill Wendling 9f795134f3 The second part of the change from -fast to -O#. This changes the JIT to accept
an optimization level instead of a simple boolean telling it to generate code
"fast" or the other type of "fast".

llvm-svn: 70347
2009-04-29 00:32:19 +00:00
Rafael Espindola 56548523f5 Add LTO_SYMBOL_DEFINITION_WEAKUNDEF, use that on the gold plugin.
llvm-svn: 69972
2009-04-24 16:55:21 +00:00
Chris Lattner 2dba0f0d75 add AvailableExternally linkage to C bindings.
llvm-svn: 68942
2009-04-13 06:25:37 +00:00
Duncan Sands 4581bebf2a It makes no sense to have a ODR version of common
linkage, so remove it.

llvm-svn: 66690
2009-03-11 20:14:15 +00:00
Duncan Sands e2881053c9 Remove the one-definition-rule version of extern_weak
linkage: this linkage type only applies to declarations,
but ODR is only relevant to globals with definitions.

llvm-svn: 66650
2009-03-11 08:08:06 +00:00
Duncan Sands 12da8ce3d2 Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr.  These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global.  In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time.   This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function.  If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body.  The
code generators on the other hand map weak and weak_odr linkage
to the same thing.

llvm-svn: 66339
2009-03-07 15:45:40 +00:00