Commit Graph

83 Commits

Author SHA1 Message Date
David Nadlinger
9f1c26b52a gc2stack: Handle _d_allocmemory.
This allows us to clean up after inlining closures.
2013-10-27 17:05:19 +01:00
David Nadlinger
3539e201f8 gc2stack: Move TypeInfo handling code into FunctionInfo subclass.
This is to properly support calls that don't involve TypeInfo
at all, like it is already the case for _d_newclass, and will be
for _d_allocmemory.
2013-10-27 17:05:19 +01:00
David Nadlinger
5b9208ef85 gc2stack: Extract static size checking code into helper function. 2013-10-27 17:05:19 +01:00
David Nadlinger
e1a6d8144b gc2stack: Replace return type bool with proper enum flag.
This makes the code much easier to read.
2013-10-27 15:43:12 +01:00
David Nadlinger
27b4f730aa gc2stack: Remove unused safeToDelete mechanism. 2013-10-27 15:36:14 +01:00
kai
a73e4602ee Simplify EmitMemSet in GarbageCollect2Stack.
Simply take advantage of the predefined `CreateMemSet()` function.
2013-10-25 23:28:29 +02:00
Kai Nacke
e5fe110280 Merge pull request #526 from klickverbot/newclass-signature
Correct signature of _d_newclass runtime call.
2013-10-23 21:43:11 -07:00
David Nadlinger
1f59740524 _d_allocclass -> "_d_newclass".
The define is a leftover from the times when we supported
both D1 and D2.
2013-10-24 00:25:36 +02:00
David Nadlinger
3d8e2e5e5c Add virtual destructor to GarbageCollect2Stack to silence GCC warning. 2013-10-24 00:24:55 +02:00
David Nadlinger
36b70b68e8 Do not generate invalid IR in dgc2stack pass.
Branching to a block that starts with a landing pad
instruction is illegal.

GitHub: Fixes #524.
2013-10-23 22:53:18 +02:00
David Nadlinger
43e27d0dd1 Remove USE_METADATA.
It has been on by default for quite some time now.
2013-06-07 02:48:53 +02:00
David Nadlinger
9fbad3c4ba Removed tautological checks.
They were probably used during initial development of the
pass to be able to disable emission of the global reference
by setting TD_TypeInfo to -1.
2013-06-07 02:45:44 +02:00
David Nadlinger
af699bd76e Rename TD_Confirm to TD_TypeInfo.
The old name probably was a reference to the fact that the
metadata node is used to _confirm_ that a metadata record
found by name really belongs to a given TypeInfo instance,
but I found it to be rather non-intuitive.
2013-06-07 02:41:10 +02:00
David Nadlinger
c02b38fe9a Removed LLVM 3.0 compatibility code.
There might be still some pieces left here and there, and
there is certainly code that could be rewritten in a nicer
way with the 3.0 requirement out of the picture.
2013-05-31 20:48:38 +02:00
David Nadlinger
0a376b9c71 Avoid unnecessary memset when allocating array literals.
This completes the merge of pull request #294. Thanks a lot to
Chris Holdsworth who originally wrote the patch!

GitHub: Fixes #294.
GitHub: Fixes #141.
2013-05-04 21:20:09 +02:00
John Colvin
e74d9b79b6 typo 2013-04-09 00:02:55 +02:00
kai
1e4a8fffc2 Remove DMDV1 and DMDV2. 2013-03-06 10:20:24 +01:00
David Nadlinger
0a96aea868 Sort includes according to style guidelines:
1. Main include corresponding to .cpp file, if any.
 2. DMD and LDC includes.
 3. LLVM includes.
 4. System includes.

Also updated a few include guards to match the default format.
2013-02-07 21:20:55 +01:00
kai
a11459bc31 "The Great Renaming" continues.
More changes to match the renamed files of LLVM 3.3.
2013-01-06 17:17:30 +01:00
kai
272e7b7a55 Follow "The Great Renaming" in LLVM 3.3
This time VMCore was renamed to IR. Several top level include
files were moved to new subfolder IR.
2013-01-03 08:52:23 +01:00
Evangelos Foutras
984207e348 Fix llvm/IRBuilder.h include when using LLVM 3.2 2012-12-25 04:58:25 +02:00
David Nadlinger
8880645bf6 Typo fix.
Turns out I still had USE_METADATA=OFF in the CMake cache when
testing the previous commit.
2012-12-24 02:22:40 +01:00
David Nadlinger
a0971b7c4b Use more portable integer log from LLVM. 2012-12-24 02:05:06 +01:00
David Nadlinger
8094e3c21b dgc2stack: Added size limit for stack promotion. 2012-12-23 21:20:55 +01:00
kai
5f37ae30cf LLVM 3.3: class Attributes is renamed to Attribute.
Some other renamings took place in "llvm/Attributes.h" but only this causes
compile errors in LDC.
Also uses new location of "llvm/IRBuilder.h".
2012-12-21 17:32:17 +01:00
David Nadlinger
7be9c5c5c7 dgc2stack: LLVM 3.2 compatibility. 2012-12-20 23:52:25 +01:00
David Nadlinger
8913898b5e dgc2stack: Demote LLVM "tail" calls when promoting an allocation.
Referencing alloca'd memory in tail calls is invalid IR. This was
not caught by the verifier, but produced misoptimizations due to
wrong alias analysis results.
2012-12-20 23:52:25 +01:00
David Nadlinger
bc541a4421 Added D2/druntime support to gc2stack. 2012-12-20 23:52:25 +01:00
David Nadlinger
ebbbfdd4ac Metadata/gc2stack compile fixes to accomodate LLVM API changes. 2012-12-20 23:52:24 +01:00
David Nadlinger
1bb14c45d2 Removed trailing whitespace. 2012-12-16 17:19:15 +01:00
David Nadlinger
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
kai
a7c7b514c0 Add changes for LLVM 3.2
- The Attributes class was changed again
- TargetData was renamed to DataLayout

Compiles again with LLVm 3.0, 3.1 and trunk(3.2).
2012-10-13 18:54:42 +02:00
kai
dbb5a34eda Add changes for LLVM 3.2. 2012-07-29 17:31:50 +02:00
Alexey Prokhin
629f13929e WIP: port to llvm 3.0 2011-10-25 15:43:39 +04:00
Robert Clipsham
2234264acf Merged klickverbot's off-by-one fixes for D optimisation passes. Thanks. 2011-01-05 23:39:32 +00:00
Kelly Wilson
11cbacf9da Fix for ticket #440 by klickverbot. Thx. 2011-01-02 00:42:10 -05:00
Alexey Prokhin
4d7a6eda23 Different fixes for d2 2010-10-07 22:35:32 +04:00
Moritz Warning
c151d37365 fixes #434 :: add llvm 2.8 support 2010-10-23 13:38:26 +02:00
Tomas Lindquist Olsen
1fac40d2bd Update to work with LLVM 2.7.
Removed use of dyn_cast, llvm no compiles
without exceptions and rtti by
default. We do need exceptions for the libconfig stuff, but rtti isn't
necessary (anymore).

Debug info needs to be rewritten, as in LLVM 2.7 the format has
completely changed. To have something to look at while rewriting, the
old code has been wrapped inside #ifndef DISABLE_DEBUG_INFO , this means
that you have to define this to compile at the moment.

Updated tango 0.99.9 patch to include updated EH runtime code, which is
needed for LLVM 2.7 as well.
2010-05-19 12:42:32 +02:00
Benjamin Kramer
8b6f11938a Kill off StripMetaData. 2009-08-25 21:35:43 +02:00
Benjamin Kramer
c220dcac05 IntegerType is now contextifed.
Requires llvm >= 78969. resistor says this will be the last context API change :)
2009-08-14 00:39:18 +02:00
Benjamin Kramer
0a1d467ac7 getTrue/getFalse were moved back to ConstantInt
Requires LLVM >= r77685
2009-07-31 19:11:07 +02:00
Tomas Lindquist Olsen
d5d3ecdb05 Added back option to disable metadata generation and users. Set USE_METADATA to OFF in ccmake. 2009-07-31 11:28:31 +02:00
Benjamin Kramer
e34f07505b use the new NamedMDNode class
this will need a LLVM >= r77619
2009-07-30 20:54:03 +02:00
Benjamin Kramer
66101517d7 LLVMContext changes up to r77366 2009-07-30 15:25:10 +02:00
Benjamin Kramer
3f0a0686a8 Value::getNameStart and Value::getNameLength were removed 2009-07-23 20:34:35 +02:00
Benjamin Kramer
27a9f93767 DOUT is deprecated, use DEBUG(errs()) instead 2009-07-27 11:44:01 +02:00
Benjamin Kramer
a398cd39b3 ConstantInt::get{True,False} moved to LLVMContext
Non-breaking build fix for LLVM r76533. Also fixes a context related
bug in GarbageCollect2Stack.
2009-07-21 13:11:39 +02:00
Benjamin Kramer
51c02d192a Some minor cleanups
* remove an #ifdef USE_METADATA I accidently left in
* remove now unneeded llvm-version includes
* fix indentation in metadata.h
* prevent the "Found native target" message from interrupting ccmake
2009-07-20 18:16:11 +02:00
Benjamin Kramer
d7049de966 More factory methods moved to LLVMContext 2009-07-15 18:09:41 +02:00