Commit graph

152 commits

Author SHA1 Message Date
kai
2dbee75523 Prefer C++-style casts.
This is based on Item 2 of "More Effective C++". In general, the C++ cast operators are more expressive and easy to find,
e.g. by grep. Using const_cast also shuts up some compiler warnings.
2012-08-02 19:55:29 +02:00
Eldar Insafutdinov
feefad412c Move cl_options out of LDCShared 2012-04-02 14:53:52 +01:00
David Nadlinger
3916835380 Merge remote-tracking branch 'AlexeyProkhin/master' into merge-3.0
Conflicts:
	CMakeLists.txt
	druntime
	runtime/CMakeLists.txt
2011-12-04 18:38:09 +01:00
David Nadlinger
fe19ee84f5 Merge branch 'llvm3.0' into merge-3.0
Conflicts:
	gen/configfile.cpp
2011-12-04 18:16:36 +01:00
Alexey Prokhin
1f4de64360 Fixed appending to an array 2011-12-03 12:24:53 +04:00
Alexey Prokhin
014d6bdd4d Merged 2.056 2011-12-02 21:50:52 +04:00
kai
a5b3dd29b5 Fixes 2 kinds of warnings.
1) The last parameter of getGetElementPtr() has type bool. In some instances, a 2 is used as parameter. This is converted to true.
2) Several loops use int instead of unsigned. This causes warning about signed/unsigned mismatch.

Curiously, only Visual C++ complains about this. Nevertheless I think that the warnings should be fixed.
2011-11-23 19:01:04 +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
7431d58702 Rewritten initialization of global variables. 2011-10-25 15:43:49 +04:00
Alexey Prokhin
629f13929e WIP: port to llvm 3.0 2011-10-25 15:43:39 +04:00
Alexey Prokhin
f3c901af9d Use _d_arraycatT to append an element to an array instead of reallocating the array 2011-09-10 13:23:47 +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
aef7e0ee36 Fix array append with dollar op 2011-07-19 10:14:12 +04:00
Alexey Prokhin
f3bf9fd277 Improve _d_arrayappendT call 2011-05-11 21:13:43 +04:00
Alexey Prokhin
805fb5cfc1 D2: pass static arrays into functions by value 2011-04-30 15:30:57 +04:00
David Nadlinger
7a24e12736 Cleanup: Remove unused code in backend, silence some warnings.
This removed quite some clutter that has presumably piled up because LDC is seldom built with a lot of warnings enabled due to DMDFE.
2011-04-24 12:21:33 +02: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
34987f71e2 Fixed some issues with phobos. 2011-01-06 13:00:06 +03:00
Alexey Prokhin
c5e9784863 Updated to dmdfe 2.051 2011-01-05 18:21:40 +03:00
Alexey Prokhin
1c59eed83a Check for lower slice bound when bounds checking is enabled 2011-01-03 16:50:08 +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
3c4db7bc87 Fixed initialization of the static arrays 2011-01-02 17:43:02 +03:00
Alexey Prokhin
d8115713d2 Fixed initialization of multidimensional static arrays. 2010-12-30 14:04:24 +03:00
Alexey Prokhin
023b55a772 Run postblit constructors for elements of an array. 2010-12-30 14:04:24 +03:00
Alexey Prokhin
eccd26ac93 Fixed crashes when compiling interpret test. 2010-12-17 12:55:28 +03:00
Alexey Prokhin
de15f4adbb That should be in rev. 1744... 2010-12-15 22:24:23 +03:00
Alexey Prokhin
7cf80b3541 Fixed ldc2 crash when compiling static array concatenation. 2010-12-15 18:55:56 +03:00
Alexey Prokhin
88d7b955c8 Reverted rev.1710 and rev.1711 2010-11-04 17:58:27 +03:00
Alexey Prokhin
fbb36404d9 Removed unnecessary temporary variables from getSlice() and DtoCatArrays(). 2010-11-04 14:14:08 +03:00
Alexey Prokhin
6b1243cec2 Fixed creating of arrays of immutable types 2010-11-02 16:38:13 +03:00
Alexey Prokhin
dc50773333 Fixed D1 regression. Thanks to mwarning 2010-10-31 15:22:24 +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
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
Kelly Wilson
b38845e88e Apply patch from klickverbot. This is his 'proper fix' patch for bug #395. 2010-03-08 23:37:40 -07:00
Christian Kamm
532af253a9 Apply workaround for #395 by klickverbot. 2010-03-08 20:06:08 +01: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
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
4c5457ba61 getNullValue is in Constant again
Requires LLVM >= r77721
2009-07-31 23:01:29 +02:00
Benjamin Kramer
0a1d467ac7 getTrue/getFalse were moved back to ConstantInt
Requires LLVM >= r77685
2009-07-31 19:11:07 +02:00
Benjamin Kramer
66101517d7 LLVMContext changes up to r77366 2009-07-30 15:25:10 +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
d7049de966 More factory methods moved to LLVMContext 2009-07-15 18:09:41 +02:00
Benjamin Kramer
0ee2f34611 Don't use llvm::getGlobalContext() anymore 2009-07-13 20:16:15 +02:00