Commit graph

466 commits

Author SHA1 Message Date
kai
f8a53ab3dc Merge branch 'merge-2.064' into merge-2.065
Conflicts:
	runtime/druntime
2014-03-12 18:27:43 +01:00
kai
7772b4ecbe Add a failure ordering to cmpxchg in LLVM 3.5.
For now, the D code is not changed. Failure ordering is the same as success ordering.
2014-03-12 17:10:49 +01:00
Kai Nacke
fe39da53e3 Merge of 2.065.0-b3.
The new visitor class is used for IR generation. This removes some modifications from DMD source.
2014-02-10 08:47:25 +01:00
kai
c6f856c01e Remove last uses of ArrayIter<>. 2014-01-12 18:07:27 +01:00
Kai Nacke
27a9ede3fd Fix error diagnosis for test fail91. 2014-01-04 01:57:56 +01:00
Kai Nacke
61720bf1ba Fix ouput for test diag8354 2014-01-03 18:02:29 +01:00
kai
dfbcb6bfd4 DtoConstSymbolAddress still returns NULL.
This fixes a failure in test ldc_github_248.d.

It would be better if DtoConstSymbolAddress would return undef but this leads to bitcast assertion.
2014-01-02 21:56:59 +01:00
David Nadlinger
3ec084da59 Return undef instead of null on toConstElem failure.
This fixes a segfault with associative array literals of
arrays of associative array literals, which occured because
of arrayLiteralToConst not handling null values properly.
Ensuring that null pointers are handled correctly in all
toConstElem callers is much more error-prone than just
returning an LLVM undef, an error is emitted anyway.

The root of the problem is actually in the kludgly
implementation of AssocArrayLiteral::toElem, we should
revisit this at some point.
2013-12-27 18:35:50 +01:00
David Nadlinger
6a17b38d83 Merge branch 'master' into merge-2.064. 2013-12-26 15:29:58 +01:00
David Nadlinger
333d538a23 Handle differing LLVM types for AA literals.
This unsfortunately more or less duplicates the code we have for
emitting ArrayLiteralExps, but with the different iteration
strategies, having a single implementation would wind up
even messier.

Unfortunately, no regression test case yet, as I found this deep
inside vibe.d.
2013-12-26 13:39:59 +01:00
Kai Nacke
dd3cc5f682 Fix for issue #553.
This version uses the skipboundscheck member variable.
2013-12-16 17:32:01 +01:00
Alexey Prokhin
669319b924 Fix DMD Issue 8360 - Destruction of uninitialized temporary struct with assert 2013-12-08 20:40:14 +04:00
Alexey Prokhin
ffe26e4ccc Fix DMD Issue 11238 - Codegen error when this is a ref parameter to the method 2013-12-08 14:56:40 +04:00
Alexey Prokhin
9e724b3f9a Implement ClassReferenceExp::toElem 2013-12-08 14:37:16 +04:00
Alexey Prokhin
dcf005213b Implement cast to void 2013-12-08 14:37:15 +04:00
Kai Nacke
08e31123e5 Fix issue with unions and initializers 2013-12-03 08:39:46 +01:00
Kai Nacke
1a36f9b394 Replace general error with more accurate error message (does not resolve issue) 2013-11-28 08:04:49 +01:00
Kai Nacke
015cf202e1 Fix cast problem with implicit constructors. 2013-11-12 08:23:06 +01:00
David Nadlinger
d918115e64 Remove assertion triggered due to qualifier mismatch. 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
David Nadlinger
1242be25d0 Remove unused, empty Ir type.
The codegen parameter was changed to IRState instead of
removing it to set the stage for an eventual eradication
of the gIR global.
2013-10-13 19:44:29 +02:00
David Nadlinger
4fee629c4d Prefer more specific functions to DtoResolveDsymbol.
The remaining ones should also be easy to remove with a
closer look at the situation.

Ideally, we would get rid of all of them at some point and
use safe wrapper functions for accessing the IrDsymbol
associated with a given declaration (which would emit the
declarations on the fly if not already present).
2013-10-13 19:18:24 +02:00
David Nadlinger
787c147986 Use Module::members -> Dsymbol::codegen to define symbols.
This commit fundamentally changes the way symbol emission in
LDC works: Previously, whenever a declaration was used in some
way, the compiler would check whether it actually needs to be
defined in the currently processed module, based only on the
symbol itself. This lack of contextual information proved to
be a major problem in correctly handling emission of templates
(see e.g. #454).

Now, the DtoResolve…() family of functions and similar only
ever declare the symbols, and definition is handled by doing
a single pass over Module::members for the root module. This
is the same strategy that DMD uses as well, which should
also reduce the maintainance burden down the road (which is
important as during the last few releases, there was pretty
much always a symbol emission related problem slowing us
down).

Our old approach might have been a bit better tuned w.r.t.
avoiding emission of unneeded template instances, but 2.064
will bring improvements here (DMD: FuncDeclaration::toObjFile).
Barring such issues, the change shoud also marginally improve
compile times because of declarations no longer being emitted
when they are not needed.

In the future, we should also consider refactoring the code
so that it no longer directly accesses Dsymbol::ir but uses
wrapper functions that ensure that the appropriate
DtoResolve…() function has been called.

GitHub: Fixes #454.
2013-10-13 19:18:24 +02:00
David Nadlinger
4987894468 Also make storage for immutable array const initializers constant/unnamed_addr. 2013-10-09 05:32:41 +02:00
David Nadlinger
0cdb74aae7 Do not heap-allocate immutable array literals. 2013-10-09 04:07:46 +02:00
David Nadlinger
60cdf58168 Combine ArrayLiteralExp::toConstElem and initializeArrayLiteral implementations. 2013-10-09 04:07:46 +02:00
David Nadlinger
eb3261f93c Do not GC-allocate temporary for static array initialization. 2013-10-09 01:51:45 +02:00
David Nadlinger
9866e5a14f Comment typo fix. 2013-10-09 01:51:45 +02:00
David Nadlinger
44f60199ad Factored actual literal building code out of ArrayLiteralExp::toElem. 2013-10-09 01:51:45 +02:00
David Nadlinger
71c67457c3 Cleanup: Kill backend_init/term. 2013-10-06 01:33:28 +02:00
Alexey Prokhin
b819975c84 Eliminate the need for TypeFunction::funcdecl 2013-10-05 19:03:03 +04:00
David Nadlinger
f35176efad Fix SymOffExp::toConstElem.
I am surprised and horrified at the same time that the test suite
(on platforms other than Windows, where the code path is triggered
in core.stdc.stdio) did not catch this at all.

The elemSize-dependent path probably doesn't make too much sense for
global variables, as it always refers to the total size of the global.
Should add a special case for arrays for clearer codegen in those cases.

GitHub: Fixes #477.
2013-09-21 18:53:26 +02:00
David Nadlinger
b17a6421a4 Merge pull request #475 from klickverbot/assert-release-trap
Emit trap for assert(0) in release mode.
2013-09-15 23:46:26 -07:00
David Nadlinger
945f4882c2 Emit trap for assert(0) in release mode. 2013-09-15 23:53:52 +02:00
David Nadlinger
3556f52b95 Fix _d_invariant mangling on MinGW/Win32.
This is getting uglier and uglier, should probably just switch back
to extern(C) irrespective of what upstream DMD does.
2013-09-15 19:57:25 +02:00
David Nadlinger
90127ab87a Fix broken indentation in debug log output. 2013-09-12 10:21:01 +02:00
kai
6875d8a20f Mark frontend generated strings with attribute unnamed_addr.
This is part of a fix for issue #133.
2013-08-18 23:34:41 +02:00
kai
f769406216 Fix for issue #119.
Instead of creating individual stores to the array elements an constant
array is created and assigned to the destination memory. This is much
less IR than before. With -O it is optimized to a memset.
2013-08-18 19:36:58 +02: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
Alexey Prokhin
8b783da523 Fixed cases where the destructor is called on an uninitialized temporary 2013-07-10 18:15:05 +04:00
Alexey Prokhin
1999749415 Issue #426 part 2. Generate a try-finally block only if it is required
(i.e. there are actually some destructor calls that are needed to be put into finally)
2013-07-10 13:34:52 +04:00
Alexey Prokhin
71023952d4 Issue #426 part 1. Wrap destructor calls of temporary variables in a try/finally expression. 2013-07-10 13:34:52 +04:00
Kai Nacke
ebadc7fcb3 Merge pull request #412 from AlexeyProkhin/cpp
extern(C++) interfaces
2013-06-30 15:37:10 -07:00
kai
67a9391f79 Replace an old-style cast. 2013-06-30 22:30:13 +02:00
Alexey Prokhin
90bb32d2d8 extern(C++) interfaces 2013-06-22 17:33:00 +04:00
David Nadlinger
235bb94878 Make -release only disable bounds checking in non-@safe code. 2013-06-17 13:31:21 +02:00
David Nadlinger
1215ffacd3 Complete IrStruct->IrAggr rename. 2013-06-17 13:14:15 +02:00
David Nadlinger
897c4382af Do not re-codegen struct literals on taking address of globals.
The AST the frontend generates is arguably invalid, but we
have to deal with that.

Fixes DMD testcase 'interpret'.
2013-06-16 01:02:46 +02:00
David Nadlinger
2e0941c194 Add names for globals to make LDC compile against LLVM 3.1. 2013-06-15 16:16:47 +02:00
David Nadlinger
c813ccdcf7 Small debug diagnostics improvements. 2013-06-15 15:04:48 +02:00