Commit graph

436 commits

Author SHA1 Message Date
Martin
9d5560601a WIP: fix array construction/assignment wrt. RAII 2015-07-22 01:41:17 +02:00
David Nadlinger
21d1bab114 Merge branch 'master' into merge-2.067 2015-07-11 18:10:43 +02:00
David Nadlinger
f7c3fc4ef3 Do not emit globals with void initializer as LLVM constants
Fixes things like `const(Foo) f = void; static shared this() { f = …; }`.
2015-07-08 02:34:48 +02:00
Kai Nacke
d1e764cec1 Backport of "Avoid using llvm::Linker" to master.
See pull request #974 for the original code.
2015-06-27 22:08:44 +02:00
David Nadlinger
0922254dd1 Directly emit IR into same llvm::Module instead of using Linker
GitHub: Fixes #970.
2015-06-14 21:36:35 +02:00
David Nadlinger
6f6f6b1987 Use new global string literal cache for module names 2015-06-14 21:27:21 +02:00
Kai Nacke
80acadc841 Merge branch 'master' into merge-2.067 2015-06-04 20:48:38 +02:00
Kai Nacke
104e7c991f DebugInfo: Remove most calls to EmitFuncEnd()
Debug information is based on static lexical blocks. Most calls to
EmitFuncEnd() are done if control flow reaches the end of the
function which is quite different.
2015-06-04 20:19:54 +02:00
Kai Nacke
f49d32f5f6 Merge branch 'master' into merge-2.067 2015-05-31 19:01:54 +02:00
Kai Nacke
63ed72cf48 Merge branch 'master' into merge-2.067 2015-05-30 10:42:06 +02:00
David Nadlinger
568bf3723b DtoSymbolAddress: Remove support for unused ClassInfoDeclaration
It will be gone in 2.068.
2015-05-30 06:23:16 +02:00
David Nadlinger
084ae9da5b Remove extra load on assignment generated only for debug info
This leads to serious problems for values we really should
not be loading from, such as 100k element static arrays.

It was hard to figure out exactly why we need to emit DWARF
info here, so the easiest solution is to just have a look
at assignments during the next big debug info push.
2015-05-29 00:53:58 +02:00
Martin
c76ac3496d Enable default-initialized static arrays of voids.
With a single byte (implicit and 0) as initializer, as each void
element occupies 1 byte.

This is required when building T.init for a struct T containing
a void[N] with N > 0 and building literals of T.
2015-04-26 14:15:51 +02:00
Martin
2f9b58e261 Don't copy any data when assigning to empty structs. 2015-04-26 02:36:52 +02:00
Kai Nacke
7159aa5392 Merge branch 'master' into merge-2.067 2015-04-16 07:27:09 +02:00
Johan Engelen
8396fc941b Modify stripModifiers to optionally work transitively.
Strip modifiers transitively when testing whether to repaint return type.
2015-04-14 22:06:44 +02:00
Martin
6c333f5761 Allocate structs on the heap via runtime function _d_newitem.
This is required for the GC to be able to call their dtors, if need
be (by appending a TypeInfo pointer after the actual struct in case
the struct has a dtor).

_d_newitemT() / _d_newitemiT() also perform the initialization, so
we don't need to take care of that in toir.cpp anymore.
2015-04-04 21:00:05 +02:00
Martin
f8c9c72795 Don't try to invoke non-existent dtors when deleting dynamic arrays.
Runtime function _d_delarray_t() expects the TypeInfo_Struct argument
to be null if the struct has no dtor.

This fixes runnable/hospital.d, which deletes a dynamic array of class
handles. But in this case, we only delete the memory allocated for the
handles and don't destruct the actual class instances!
For hospital.d, it doesn't matter as the class has no dtor.
But I doubt that's intended behavior...
2015-03-29 17:55:47 +02:00
Martin
7d0d2a1d26 Call _d_delstruct() runtime function when deleting struct pointers.
As long as the struct has a dtor, otherwise continue forwarding
to _d_delmemory().
2015-03-29 04:54:31 +02:00
kai
350c01a97d Updates to runtime functions.
Adds new functions and corrects signatures.
2015-03-21 21:50:49 +01:00
kai
9ef4c8f421 Implement _d_arraycatnTX and remove _d_arraycatnT.
With this commit, the first simple applications can be linked and run!
2015-03-21 17:37:51 +01:00
kai
c39c7e9c35 Update to DMD v2.067.0-b2
Includes all tagged with v2.067.0-b2. Does not includes latest druntime changes from ldc (head) branch.

This is known to be broken. I only merged the frontend stuff but did not try to compile something...
2015-02-24 22:16:17 +01:00
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