Commit graph

134 commits

Author SHA1 Message Date
kai
fde625b33d More changes to the Attributes class in LLVM 3.2. 2012-10-20 17:22:55 +02:00
kai
657fc42221 And still more changes for LLVM 3.2
There were additional changes to the Attributes class.
2012-10-15 18:31:18 +02:00
kai
fb108eed12 More LLVM 3.2 changes. 2012-10-14 18:45:31 +02: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
Alexey Prokhin
fa361ed598 DMD Issue 4523 - [tdpl] .remove method for Associative Arrays returns void in all cases 2012-02-15 13:23:23 +04:00
David Nadlinger
2c7f77eabd Fixed leftover llvm::Type const qualifier. 2011-11-12 20:17:29 +01:00
David Nadlinger
ffe37c4a62 Merge remote-tracking branch 'upstream/llvm3.0' 2011-11-12 19:51:30 +01:00
Alexey Prokhin
22d0f00027 Rewritten DtoArrayInit().
It does not create calls to runtime functions and generates a faster code, especially if optimizations are on.
2011-11-01 14:31:00 +04:00
Alexey Prokhin
629f13929e WIP: port to llvm 3.0 2011-10-25 15:43:39 +04:00
Alexey Prokhin
0caba6672d Call postblit on a struct when appending it to an array. Use _d_arraycatnT to concatenate multiple arrays.
Before, _d_arraycatT was used to concatenate multiple arrays. That caused an issue when postblit
was called on a struct multiple times. The next code asserted due to the issue:

void main()
{
    static struct S
    {
        int x;
        int pad;
        this(this)
        {
            ++x;
        }
    }

    auto sarr = new S[1];
    auto sarr2 = sarr ~ sarr ~ sarr;
    assert(sarr2[0].x == 1);
    assert(sarr2[1].x == 1);
    assert(sarr2[2].x == 1);
    assert(sarr[0].x == 0);
}
2011-09-10 13:22:05 +04:00
Alexey Prokhin
375dcb095c Fix array comparison 2011-03-26 17:58:08 +03:00
Alexey Prokhin
6d89bfa961 Use _d_assocarrayliteralTX to initialize associative arrays. Replace depricated _d_arrayappendcT() by _d_arrayappendcTX(). Make sure that a l-value of a binassign expressions is only evaluated once (reapllied 1784 but only for D2) 2011-02-20 19:00:45 +03:00
Alexey Prokhin
c5e9784863 Updated to dmdfe 2.051 2011-01-05 18:21:40 +03:00
Alexey Prokhin
a86f414bc1 Fixed calling of _d_array_bounds and _d_switch_error. 2011-01-02 17:43:02 +03:00
Alexey Prokhin
6b6ba75139 Call _d_hidden_func() instead of hidden functions. 2010-12-31 13:29:01 +03:00
Alexey Prokhin
023b55a772 Run postblit constructors for elements of an array. 2010-12-30 14:04:24 +03:00
Alexey Prokhin
44593f6220 Call d_delarray_t() instead of _d_delarray() 2010-12-19 15:51:00 +03:00
Alexey Prokhin
7e6807b0df Fixed calling of _d_delmemory() and _d_delinterface() 2010-12-17 12:55:28 +03:00
Alexey Prokhin
71f653f19b Fixes for closures 2010-12-15 17:05:16 +03:00
Alexey Prokhin
0cc3dc369a Fixed signature of _d_delarray() 2010-11-02 20:30:06 +03:00
Alexey Prokhin
87485d6649 Fixed signature of _aaEqual for D2 2010-11-02 18:40:58 +03:00
Alexey Prokhin
2fe6817294 Fixed a druntime crash in _d_delclass 2010-10-31 12:23:35 +03:00
Alexey Prokhin
e4c3179d43 Different fixes: phobos compiles now 2010-10-28 14:53:01 +04:00
Alexey Prokhin
b1e5993873 Started work on phobos 2010-10-27 18:13:46 +04:00
Alexey Prokhin
eb68fc3d8c Fixed building of LDC1. Work on arrays 2010-10-08 15:58:10 +04:00
Alexey Prokhin
41a66cf437 Use druntime functions for array operations 2010-10-08 15:10:56 +04:00
Alexey Prokhin
4d7a6eda23 Different fixes for d2 2010-10-07 22:35:32 +04:00
Christian Kamm
9cd32549c4 Improve array append performance.
Actually use the appropriate runtime function, instead of just
growing the array by one!
2010-02-14 10:11:05 +01:00
Benjamin Kramer
d24643bb50 Avoid some unecessary heap allocations by using llvm's StringRef class. 2009-08-14 01:43:30 +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
977fa551ee Push the context through StructType::get.
Requires LLVM >= 78258. Also remove old #if's.
2009-08-06 01:47: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
0ee2f34611 Don't use llvm::getGlobalContext() anymore 2009-07-13 20:16:15 +02:00
Benjamin Kramer
331319dab1 Build fix for the latest LLVMContext changes (LLVM r75445)
This shouldn't break the build with older LLVM revs. We include
LLVMContext.h in gen/llvm.h now to make the transition a little bit
easier.
2009-07-13 12:17:58 +02:00
Benjamin Kramer
45f7401a5b Remove all of the now unecessary #if LLVM_REV 2009-07-11 14:09:33 +02:00
Christian Kamm
756a2cb2a1 Adjust LDC to work with the LLVMContext LLVM changes.
This means we now require a fairly new LLVM revision. I use 75234.
2009-07-10 21:30:02 +02:00
Robert Clipsham
4fbcd9b9c4 A couple of ldc2 tweaks now druntime compiles. 2009-07-09 12:36:08 +01:00
Robert Clipsham
951e961f9e Merge. 2009-07-06 23:56:11 +01:00
Robert Clipsham
1812c5b00a Fixed some unmerged parts of the D2 frontend.
Removed the automatic linker flags for D2 (temp).
Renamed a runtime function for D2.
2009-07-06 23:54:02 +01:00
Benjamin Kramer
22b36384b0 Fix build for LLVM >= r74640
Some LLVM objects now take a 'Context' to make multi-threaded apps easier.
Since we're not multi-threaded it's safe to use llvm::getGlobalContext()
which gives us the same behavior as we had before.
2009-07-03 17:24:35 +02:00
Christian Kamm
265cbea170 Make == for associative arrays test for equality, not identity.
_aaEq was added to runtime/internal/aaA.d which forwards to
TypeInfo_AssociativeArray.equals in genobj.d. On the codegen side, DtoAAEquals
was added to gen/aa.cpp and is called from EqualExp::toElem in gen/toir.cpp.

I assume that the frontend will produce an error if == is used on associative
arrays of different type.

This fixes DMD bug 1429.
2009-06-21 19:05:24 +02:00
Frits van Bommel
465f15eda0 Return void* from _d_allocclass so LLVM doesn't do weird things with it...
This allows `-instcombine` followed by `-gvn` to do devirtualization, so add
`-gvn` in strategic places in the default pass order.
2009-06-20 11:39:13 +02:00
Frits van Bommel
f7ab031c7e Delete some code I forgot about in [1480]. 2009-06-07 23:00:53 +02:00
Frits van Bommel
e7b3f5415f Make "aa[key]" use the same runtime call as "key in aa". The runtime calls
these were using were different, but with equivalent definitions.

With `ldc -O3`, the following functions now all compile to the exact same code:
{{{
int[int] y;
void foo(int x) {
    if (x in y) {
        auto z = x in y;
        sink(*z);
    }
}

void bar(int x) {
    if (x in y) {
        sink(y[x]);
    }
}

void baz(int x) {
    if (auto p = x in y) {
        sink(*p);
    }
}
}}}
2009-05-25 12:50:40 +02:00
Frits van Bommel
371cdb71ba Remove an incorrect attribute: noalias doesn't apply to struct types, even if
we prefer to think of that type as an array :(.
2009-05-17 02:22:21 +02:00
Tomas Lindquist Olsen
dfea022a86 Changed array slice copying to call a runtime function when assertions or array bound checks are enabled instead of just doing a memcpy. This makes sure an exception is thrown if the copy is invalid (ie. different lengths or overlap). Fixes ticket #283 . Rebuilding the runtime is necessary. 2009-05-10 02:23:05 +02:00
Frits van Bommel
5723fa7492 Add 'nounwind' attribute to the relevant runtime functions, and use it when
deciding whether or not to generate an invoke instead of a call.
2009-05-04 20:26:45 +02:00
Frits van Bommel
3572944b90 Remove bogus noalias attribute from _d_arraysetlength[i]T. 2009-05-03 15:24:05 +02:00
Frits van Bommel
b6a6391116 Add some attributes to runtime calls, to provide the standard LLVM optimization
passes with more information.
2009-04-29 17:47:24 +02:00
Christian Kamm
c5a09c9deb Force initialize the runtime module in Module::genLLVMModule. It is required
for all non-trivial D modules anyway, so why load it lazily? This fixes
run/typeid_83.d (DtoDeclareTypeInfo expects runtime to be initialized)
2009-03-28 20:01:37 +01:00