Commit graph

490 commits

Author SHA1 Message Date
Alexey Prokhin
18f33b1815 Make IrDsymbol to be a typesafe union to reduce memory usage 2014-09-12 14:43:49 +04:00
Andreas Hollandt
8af29baeda fix #667 flags list used as string
enable function and data sections
fix incorrect library search paths
2014-07-17 00:11:08 +02:00
David Nadlinger
0d5f084f6a x86_64 vararg support is not so simple.
This reverts 1e649422 and adds some extra cleanup/comments.
2014-07-12 02:23:32 +02:00
Alexey Prokhin
5c3209a2db Fixed ICE inroduced by 6197938 2014-07-11 18:06:58 +02:00
Alexey Prokhin
a6f358c59b Remove LINKintrisic 2014-07-10 18:10:46 +04:00
kai
45fca1f3b5 Add line number to error message of -nogc switch.
This was suggested by bearophile in the news group.
It also changes all Loc objects to be passed by reference.
2014-07-04 07:15:05 +02:00
kai
e69e435122 Merge branch 'release-0.13.0' 2014-06-28 18:08:31 +02:00
kai
9f8887b07f Fix AtomicCmpXchg for LLVM 3.5
A weak variant was added to LLVM 3.5 and the return type changed to { iN, i1 }.
Just extract the value from this struct.
2014-06-28 17:01:47 +02:00
Alexey Prokhin
61979387fd Fix DMD Issue 11394 - NRVO should work for object field initialization in constructor 2014-06-27 14:47:10 +04:00
Alexey Prokhin
1e649422d6 Simplify vaarg support on X86_64 2014-06-27 11:39:26 +04:00
kai
2b6dbb03f4 Add IF_LOG to more logging statements.
Evaluating arguments which call toChars() or toPrettyChars() are much more expensive then checking Logger::enabled().
2014-06-26 06:54:38 +02:00
kai
b7615f6a28 Merge branch 'master' into merge-2.065
Conflicts:
	dmd2/declaration.h
	dmd2/dsymbol.h
	dmd2/func.c
	gen/functions.cpp
	gen/toir.cpp
	runtime/druntime
2014-06-23 07:57:30 +02:00
kai
7c289fd673 Introduce needsCodegen.
This is a backport of the code from 2.065.
2014-06-19 13:20:28 +02:00
Kai Nacke
78c0c30d6b Merge branch 'merge-2.064' into merge-2.065
Conflicts:
	dmd2/template.h
	runtime/druntime
2014-06-06 06:44:57 +02:00
kai
7fd9e5a06e Merge branch 'master' into merge-2.064
Conflicts:
	runtime/druntime
2014-06-02 07:50:55 +02:00
David Nadlinger
aa06fea59e Reject non-integer atomic load/store during codegen.
This avoids hitting an LLVM assert during codegen.
2014-05-30 20:11:47 +02:00
David Nadlinger
6a5ed89644 Make intrinsic parameter errors in CallExp::toElem() fatal.
Returning null will crash just about any other glue layer code.

Ideally, we'd catch those during semantic analysis (glue layer
errors are always to be avoided due to speculative compilation),
but this at least avoids the segfaults.
2014-05-30 20:11:39 +02:00
Kai Nacke
92c06dede0 Merge branch 'merge-2.064' into merge-2.065
Conflicts:
	runtime/druntime
2014-05-10 21:38:37 +02:00
Kai Nacke
8db10661e7 Merge branch 'fix424' into merge-2.064 2014-04-25 23:09:19 +02:00
Kai Nacke
295212a806 Merge branch 'master' into merge-2.064 2014-04-25 23:09:09 +02:00
Kai Nacke
09a2b9774d Final fix for issue #424 2014-04-25 18:26:59 +02:00
David Nadlinger
ee3a0f29c5 Fix ArrayLiteralExp for boolean arrays.
GitHub: Fixes #602.
2014-04-24 21:13:18 +02:00
Kai Nacke
2218ca83e8 Merge branch 'merge-2.064' into merge-2.065 2014-03-23 19:29:10 +01:00
Kai Nacke
266d7c6d82 Fix destructor calls of temporaries inside an assert.
An assert expression has a slightly different requirement: if the assertion holds then
the expression of the message is not evaluated. A destructor of a temporary variable must
not be called because the object was never constructed.
If the assertion does not hold and an exception is raised, then the destructor must be
called in a finally block.

This fixes a test failure in xtest46.d
2014-03-23 18:22:33 +01:00
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