Commit graph

744 commits

Author SHA1 Message Date
David Nadlinger
b10f110066 Do not try to use RTTI for C++ classes
Casts are just bitcasts, and do not try to invoke
class invariants on asserts.

@yebblies mentioned he would extend the DMD test suite
accordingly.
2015-05-31 09:34:14 +02:00
Kai Nacke
23303140fe Merge branch 'master' into merge-2.067 2015-05-22 21:44:33 +02:00
Kai Nacke
8d0fada2c2 LLVM 3.7: The signature of CreateCall() has changed.
The method now takes an array with the argument values.
2015-05-22 21:25:14 +02:00
Martin
6c645649ed Enable passing binAssign expressions as ref/out arguments.
Fixes runnable/testassign.d.
2015-04-24 00:40:01 +02:00
Kai Nacke
1385c17efc Merge branch 'master' into merge-2.067 2015-04-15 21:46:16 +02:00
Dmitri Makarov
efa96d69d8 Cache global variables for string literals. 2015-04-15 09:56:02 +02:00
kai
eadefdc676 The runtime functions for multi-dim arrays have changed.
_d_newarraymT and _d_newarraymiT are now named _d_newarraymTX and
_d_newarraymiTX. There is also a change in the signature: instead
of a variable length argumentlist the functions now require an array
of dimensions.

This should fix test runnable/test28.d
2015-04-12 19:59:18 +02:00
Kai Nacke
ac7f8c70f8 Merge branch 'master' into merge-2.067
Conflicts:
	dmd2/mars.h
	driver/ldmd.cpp
	gen/module.cpp
2015-04-08 22:23:50 +02:00
Johan Engelen
505f18ca2a Add coverage analysis ("-cov=...") to ldc2 2015-04-07 22:11:02 +02:00
Kai Nacke
ced658da92 Merge branch 'master' into merge-2.067 2015-04-05 03:29:30 +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
Kai Nacke
a4924c50e1 LLVM 3.7: llvm::ConstantExpr::getElementPtr() wants element type.
This is the same change like the one on the GEP instruction.
2015-04-04 01:37:14 +02:00
David Nadlinger
9e17ae9fea Merge pull request #877 from kinke/deleteArray
Don't try to invoke non-existent dtors when deleting dynamic arrays.
2015-03-29 19:32:36 +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
Kai Nacke
5bd431b7fd Fix MSVC build.
These changes seems to be required for MSVC 2013.
2015-03-29 17:54:09 +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
Martin
bf55d7b431 Descend to nested lvalue for assign, binAssign and address-of expressions.
Thereby enabling nested assign/binAssign expressions in left-hand-sides
of assign/binAssign expressions as well as taking the address of assign/
binAssign expressions.
2015-03-28 16:34:12 +01:00
Martin
9ecc483b14 Don't care about mismatching types in conditional expressions.
Ignore LL type mismatches between the overall expression and its
2 nested true/false expressions.
2015-03-24 00:34:28 +01:00
Kai Nacke
2ad804c16b Implement core.bitop.volatileLoad() and core.bitop.volatileStore()
The implementation introduces 2 new intrinsics: ldc.bitop.vld and ldc.bitop.vst.
2015-03-22 00:11:43 +01:00
kai
95806fd7cd Merge branch 'master' into merge-2.067
Conflicts:
	runtime/druntime
2015-03-15 20:35:44 +01:00
kai
30df48f360 LLVM 3.7: llvm::GetElementPtrInst::Create() now has an additional type parameter. 2015-03-15 18:07:11 +01:00
Kai Nacke
886c2eab06 Merge branch 'master' into merge-2.067
Conflicts:
	runtime/druntime
2015-03-01 15:03:31 +01:00
Kai Nacke
9ec79ded40 Merge pull request #768 from kinke/vararg2
Varargs fix & ABI refactoring
2015-02-24 23:26:45 +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
e455b90456 Merge branch 'master' into merge-2.067
Conflicts:
	dmd2/template.c
	runtime/druntime
	runtime/phobos
2015-02-24 07:23:58 +01:00
kai
136fe8dd03 Fix some more warnings.
Replace format modifier %zu (for size_t) with %llu and a cast to unsigned long long.
2015-02-23 23:12:41 +01:00
Martin
c19550ad39 Fix va_arg intrinsic. 2015-02-23 22:52:11 +01:00
Martin
aa38fe06ec Refactoring: move ABI-specific variadic stuff to TargetABI type. 2015-02-23 22:52:11 +01:00
Martin
e5deefb1dd Re-implement __va_list struct allocation for System V AMD64 varargs ABI. 2015-02-23 22:52:11 +01:00
Martin
9839cfb889 Experimental varargs fix 2015-02-23 22:52:10 +01:00
David Nadlinger
8436f079c3 Merge pull request #798 from klickverbot/tuple-sarray
Fix initialization of TupleExps with static array members.
2014-12-26 22:54:43 +01:00
kai
024b14cd7f Fix some warnings.
These are easy to solve and reduce the noise in the Travis build.
2014-12-26 15:59:23 +01:00
Alexey Prokhin
b7a361f467 Fix issue #795 — Struct dtor called twice under some circumstances 2014-11-20 16:19:11 +03:00
David Nadlinger
d6e54bef97 Fix initialization of TupleExps with static array members.
Just as for structs, `DVarValue::getRVal()` doesn't dereference the
address for these.

GitHub: Fixes #797.
2014-11-16 21:28:14 +01:00
David Nadlinger
e4aa92deb3 Get rid of more superfluous casts with DMD arrays.
There are still a few more left.
2014-11-16 08:00: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
Martin
1289ca8664 Win64: don't use DMD x64 implementations of LDC_va_start and LDC_va_copy intrinsics 2014-10-24 18:43:33 +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
Andreas Hollandt
afcd0aad41 add a few IR names 2014-10-02 14:36:51 +02:00
Andreas Hollandt
6db62ee8a9 remove all the "tmp" IR names 2014-10-02 14:36:51 +02:00
Andreas Hollandt
cf9b18ed3d fix C2883 in MSVC build 2014-09-30 12:30:02 +02:00
kai
de75dccdfa Move visitor outside of class to fix MSVC compile problem. 2014-09-25 06:50:21 +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
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
08c5d6f82e Shut up compiler warnings about hidden visit() methods 2014-08-24 21:01:45 +04:00
Alexey Prokhin
056f93db7b Bad codegen for logical right shift assign expression
Cast rhs to lhs type, instead of casting both to common type
and then back to the original.
2014-08-24 13:59:19 +04:00
Alexey Prokhin
f25d31332b Trivial error message improvements 2014-08-22 16:26:16 +04:00
Alexey Prokhin
fb95fd60a9 Fix DMD Issue 12153 - Ternary operator on static array lvalues creates copy 2014-08-22 16:01:35 +04:00