Commit graph

321 commits

Author SHA1 Message Date
David Nadlinger
1d142129e3 Handle "initializer outlining" for loop rewrites in 2.064. 2013-10-29 19:21:15 +01:00
David Nadlinger
cb341586e3 First merge of 2.064 beta.
This corresponds to DMD commit a913ce4bc59a94a022a27e390fc841f4aededffb.

Doesn't build Phobos yet.
2013-10-29 19:21:15 +01:00
Alexey Prokhin
b819975c84 Eliminate the need for TypeFunction::funcdecl 2013-10-05 19:03:03 +04:00
kai
c28c7fb134 Introduce a debug info builder.
Moves all code from todebug into a new class.
Also caches the compilation unit in order to fix a LLVM 3.4 compile error.
2013-07-29 00:04:08 +02:00
David Nadlinger
292caa1438 Merge the 2.063 frontend. 2013-06-12 20:16:37 +02:00
kai
522c06ff7f Do not memcpy with same source and destination.
This can happen for sret_args. Drop the assignment in this case.
2013-05-10 12:59:14 +02:00
kai
7d65a311b1 More changes to std::vector usage.
Replace with std::vector with static array, llvm::SmallVector or
add code to reserve space.
2013-03-17 23:58:30 +01: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
David Nadlinger
30caa4bfe6 Merge branch 'master' into merge-2.061-2 2013-01-12 01:27:02 +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
David Nadlinger
1a3fc9f97f Fix break out of non-nothrow range foreach.
Fixes DMD testcase 'test9068'.
2013-01-04 16:48:10 +01:00
David Nadlinger
59a4a02e49 Cleanup: Avoid signed/unsigned comparisons.
The ones ones left are for DMD-defined constants.
2012-12-20 01:21:09 +01:00
David Nadlinger
2988bc46e0 Removed long obsolete (and broken) LLVM IR annotation code.
If someone wants to redo this properly, an idea that actually works
would be to use a custom llvm::AssemblyAnnotationWriter.
2012-12-19 01:50:48 +01:00
David Nadlinger
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
David Nadlinger
c6abdcf4a4 Don't set TypePointer::isunsigned to true in the frontend.
The previous solution was problematic because the change was language-
visble via the isUnsigned trait. Now, pointers are simply explicitly
checked for in the relevant places. (Note that there might be cases in
the diff where a direct isunsigned() call would have been appropriate –
I only checked for instances where the type clearly cannot be a pointer,
but chose to go the safe route in replicating existing behavior
otherwise).

Fixes DMD testcase 'traits'.
2012-09-28 00:28:49 +02:00
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
Alexey Prokhin
2f60c4dcda Codegen the try block before the catches and finally 2012-04-21 22:37:32 +04:00
Alexey Prokhin
52c5c03495 Fixed segfault when compiling a non-constant case expression 2012-02-15 13:23:23 +04:00
Alexey Prokhin
b3ed8724b7 Fixed codegen of SwitchErrorStatement 2012-02-15 13:23:23 +04:00
kai
f9201e8352 Merge 1.072 2012-02-02 03:13:27 +01:00
Alexey Prokhin
edc4a5f003 DMD Issue 5416 - null should have a type of its own 2011-12-16 20:15:10 +04: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
David Nadlinger
d0ea856024 Emit all D inline asm labels as local labels.
On OS X, there is an actual significance to the distinction, which before lead e.g. to exception throwing in the below example being broken:

---
import core.exception;

void main() {
  asm {
    jmp Lfoo;
Lfoo:
    ;
  }
  throw cast(OutOfMemoryError)cast(void*)OutOfMemoryError.classinfo.init;
  assert(0);
}
---
2011-12-04 18:13:33 +01:00
Alexey Prokhin
91f4e5d015 Added emission of dwarf lexical blocks.
Also, dropped support for DISABLE_DEBUG_INFO definition.
2011-12-04 15:34:35 +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
Alexey Prokhin
629f13929e WIP: port to llvm 3.0 2011-10-25 15:43:39 +04:00
Alexey Prokhin
9a9999854f Named Return Value Optimization 2011-09-13 21:01:38 +04:00
Alexey Prokhin
0e754b5acd Merge dmd v2.055 2011-09-13 21:01:32 +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
71a0a968ef Fixed #6 2011-07-26 09:48:10 +04:00
Alexey Prokhin
a41b822420 Fixed ldc1 compilation 2011-07-26 09:30:36 +04:00
Alexey Prokhin
6576b68dfd Added empty ImportStatement::toIR(). That fixes import from a function 2011-07-19 20:02:39 +04:00
Alexey Prokhin
ce799e9974 Fixed postblit call 2011-07-19 19:20:43 +04:00
Alexey Prokhin
2cc34c4005 Call desctructors on temporary variables 2011-07-19 19:20:42 +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
a684dd2df9 ldc1 compiles again 2011-02-27 21:00:01 +03:00
Alexey Prokhin
063020fae6 Don't run postblit on references 2011-02-27 12:27:38 +03:00
Alexey Prokhin
70aee84c70 Fix passing of a padded struct to a function 2011-02-26 20:16:01 +03:00
Alexey Prokhin
28aa0e2bf3 Add missing postblit call 2011-02-25 22:29:28 +03:00
Alexey Prokhin
c5e9784863 Updated to dmdfe 2.051 2011-01-05 18:21:40 +03:00
Alexey Prokhin
89375729cf Work on switch statements. 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
57866a8359 Fixed a crash in WithStatement::toIR. 2010-12-31 13:45:11 +03:00
Alexey Prokhin
20b2b4b7f5 Added missing calls of postBlit 2010-11-04 12:50:19 +03:00
Alexey Prokhin
b1e5993873 Started work on phobos 2010-10-27 18:13:46 +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
dd6a54d442 Strange workaround for returning from within 'void main()'. The new dmdfe sets the ReturnStatement->exp to null. Fixed bug #391. 2010-03-10 19:35:14 -07:00