Commit graph

314 commits

Author SHA1 Message Date
kai
a2748cd2fd Merge current development state of 2.067
First merge of current development stream. Asm blocks are known to be broken.

DMD:      0c9f437bc24015707130ba42dc434d9cd58282fb
druntime: 86d49cfb3670904603df0cfdfe44c6fff565c0fc
Phobos:   a8ca4f7964becac680af0eadbde05aa7d10fc338
2014-11-15 18:53:23 +01:00
David Nadlinger
ced9f884df Do not emit variables for enum declarations.
GitHub: Fixes #762.
2014-10-25 14:36:49 +02:00
David Nadlinger
bff766b379 Track member field index in IrTypeAggr, not IrField.
This fixes a regression introduced in caa2f15c8a. The IrDsymbol
metadata is obviously reset in between modules, while IrTypes
are not. Thus, we can never set symbol metadata when resolving
types, as the symbol data will be wrong in all modules following
the one where the type was first resolved.

GitHub: Fixes #739.
2014-10-11 03:28:49 +02:00
David Nadlinger
2071cf4b3d [cleanup] Merge DtoIndex{Struct, Class}. 2014-10-11 03:28:48 +02:00
David Nadlinger
d8089ab3cf Fixed getParentFunc(..., true) as used for nested context creation.
It seems like the original code contained two issues: First,
the stopOnStatic branch checked the passed symbol over and
over again instead of the current parent. Second, aggregate
declarations are not Declarations, they are ScopeDsymbols.

GitHub: Fixes #696.
2014-10-10 18:11:22 +02:00
Alexey Prokhin
9ead7f7996 Move debugVariable and debugFunc from VarDeclaration to IrVar 2014-10-05 16:08:52 +04:00
Alexey Prokhin
a0b9f95869 There is no real need in FuncDeclaration::labmap 2014-10-05 16:08:35 +04:00
David Nadlinger
ff7ed64920 Revert owningTemplate hack from 39e3e3a6.
It is no longer needed now that we use DMD's model for determining
whether to emit templates. We might also be able to use the more
general tinst/minst machinery from DMD Git master if we ever need
something similar.
2014-10-04 18:11:03 +02:00
Andreas Hollandt
6db62ee8a9 remove all the "tmp" IR names 2014-10-02 14:36:51 +02:00
Kai Nacke
382ad184d8 Merge branch 'master' into merge-2.066
Conflicts:
	dmd2/builtin.c
	gen/classes.cpp
	gen/functions.cpp
	gen/llvmhelpers.cpp
	gen/statements.cpp
	gen/toir.cpp
	runtime/druntime
	runtime/phobos
2014-09-13 23:11:54 +02:00
Alexey Prokhin
e526d74ed5 Const and immutable fields with initializers are not globals since 2.064 2014-09-12 16:27:17 +04:00
Alexey Prokhin
960d84508b [Refactoring] Turn IrDsymbol flags into an enum value 2014-09-12 16:27:13 +04:00
Alexey Prokhin
32b1d4cc55 Reduce size of IrDsymbol even more
resolved/defined/declared/initialized are turned into flags.
2014-09-12 14:43:54 +04:00
Alexey Prokhin
18f33b1815 Make IrDsymbol to be a typesafe union to reduce memory usage 2014-09-12 14:43:49 +04:00
Alexey Prokhin
d9189acbc4 Move toElem/toConstElem to visitors 2014-08-27 16:22:02 +04:00
Alexey Prokhin
6d5944f80b Refactoring: Synchronized is rewritten to try-finally statement. Remove it 2014-08-24 13:59:18 +04:00
Alexey Prokhin
f4141ab596 Fix DMD Issue 12094 - typeof(null) should convert to reference types 2014-08-22 16:01:35 +04:00
Alexey Prokhin
2214728efd Remove DtoCastNull, because DtoNullValue does the same thing (only better) 2014-08-22 16:01:35 +04:00
Alexey Prokhin
76f3fd02bd Call _d_arraybounds for bounds checking instead of _d_array_bounds.
It expects file name as a first argument instead of pointer to Module.
2014-08-22 16:01:35 +04:00
Alexey Prokhin
76dec46df5 WIP: merge dmdfe 2.066 2014-08-22 16:01:28 +04:00
Alexey Prokhin
e0b9048998 Rename 'enclosingFinally' to the original 'tf' to minimize differences with mainstream 2014-07-11 18:06:58 +02:00
Alexey Prokhin
a6f358c59b Remove LINKintrisic 2014-07-10 18:10:46 +04:00
David Nadlinger
fc7acc48fc Add pragma(LDC_extern_weak) for symbols with (ELF-style) weak linkage.
For now, this is only an internal feature to be used in the
implementation of rt.sections_linux.
2014-07-10 00:45:06 +02: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
Alexey Prokhin
ffb67f2918 Fix crashes when a variable is accessed by nested function inside __traits(compile) or typeof 2014-06-27 21:38:58 +04: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
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 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
Alexey Prokhin
dcf005213b Implement cast to void 2013-12-08 14:37:15 +04:00
Kai Nacke
18d53f8937 Enable NRVO for static arrays.
This is new in 2.064 and fixes a test failure in runnable/sdtor.d.
2013-11-20 21:29:50 +01:00
Kai Nacke
b22b7aef3c Merge branch 'master' into merge-2.064 2013-11-14 21:35:10 +01:00
Kai Nacke
2063b4ea89 Fix for issue #543.
Immutables are constant values, too.
2013-11-14 21:21:04 +01:00
Kai Nacke
7743f56450 Fix for the tuple assignment error in test aliasthis.d
The DMD front end uses a hack to avoid a "has no effect" error. This
hack must be recognised by LDC, too.
2013-11-10 20:34:48 +01:00
Kai Nacke
248d3f2b66 Merge branch 'master' into merge-2.064 2013-11-05 10:47:43 +01:00
kai
6fe28e1660 Small code modifications to Ir-Classes.
Adds some constructors and moves the code to the header file. Uses some of the new constructors.

A big problem with the source are the different strategies used for otherwise similar classes.
E.g. a IrField registers itself with the VarDeclaration. Same is required for IrParameter, but
in this case it is done by the caller.
2013-11-05 10:31:14 +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
kai
835e972e6b Fix va_arg handling.
The change of symbol emission ignored the fact that the va_arg intrinsic must be
handled in a special way. This commit corrects the omission (which leads to seg
faults on Linux/PPC64).
2013-10-25 16:15:52 +02:00
David Nadlinger
265d3ee069 Do not try to emit nested functions with unanalyzed parents.
GitHub: Fixes #497.
2013-10-13 21:37:53 +02: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
48b7710d22 More robust way of handling static array single element initialization.
Fixes a std.traits test where there would be a mismatch
in const/shared qualifiers on the element type of a dynamic
array initializer.
2013-10-13 19:18:24 +02:00
David Nadlinger
8ead24a2bb Handle typeof(null) -> Object conversion.
Not sure why this wasn't triggered by the test suite before.
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
b556ad9996 Don't log the uninteresting case of DtoConstExpInit. 2013-10-13 01:00:25 +02:00
David Nadlinger
3d9b70c7a6 Mention TypeInfo emission in debug log. 2013-10-13 01:00:24 +02:00
David Nadlinger
a2a3e400c9 LDMD: Avoid unitialized data.
Found using Valgrind.
2013-10-09 19:50:28 +02: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
Kai Nacke
795df4da1b Merge pull request #427 from AlexeyProkhin/issue426
Fixed issue #426 — dtor / destructor not called for (rvalue) struct used in opApply
2013-07-20 11:19:07 -07: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