Commit graph

273 commits

Author SHA1 Message Date
Martin Kinkelin
d140f2a283 Skip superfluous IR pointer bitcasts, now that they are always opaque 2024-05-20 16:45:09 +02:00
Martin Kinkelin
2cd14c59dd Drop support for LLVM 14
Mainly because opaque IR pointers appear buggy in LLVM 14 (LLVM
crashes when compiling druntime).
2024-05-19 14:18:32 +02:00
Martin Kinkelin
bb2dec2f87 Adapt to free arrayOf(Type*) function 2024-03-03 22:12:16 +01:00
Martin Kinkelin
9041c0bf67 Adapt to free functions in dmd C++ namespace now 2024-03-03 19:14:00 +01:00
Martin Kinkelin
a3aadfcce8 Adapt to new multi-dimensional array allocation lowering
Fixes runnable/test28.d.
2024-01-19 19:42:17 +01:00
Martin Kinkelin
a053480010 Misc. merge fixes (C++) 2023-11-06 00:33:57 +01:00
Martin Kinkelin
c5704c764d Adapt to new _d_newitemT template lowering for heap-allocations of structs 2023-08-26 16:48:04 +02:00
Martin Kinkelin
81ea49db13 Merge remote-tracking branch 'origin/master' into llvm16-2 2023-08-12 14:37:01 +02:00
Martin Kinkelin
67885a8ef7 Adapt to new _d_arraycatnTX template lowering 2023-07-16 13:46:34 +02:00
Martin Kinkelin
a6dc3fa73a Adapt to new _d_arraysetlengthT template lowering 2023-07-16 13:43:00 +02:00
Ikey Doherty
f06d31de56
gen/runtime: Use the correct header path for ModRef
In stable LLVM 16 this is now under `Support` and not `IR`

Signed-off-by: Ikey Doherty <ikey@serpentos.com>
2023-06-03 22:06:24 +01:00
Hiroki Noda
d001a7cdb8
Fix C assert calls for newlib (#4351) 2023-04-13 15:42:41 +02:00
Martin Kinkelin
72391f7210 Support new new AA syntax, lowering to a _aaNew call 2022-12-01 01:59:50 +01:00
Martin Kinkelin
1e9f3a7be7 Merge remote-tracking branch 'origin/master' into pre-monorepo
Conflicts:
	runtime/druntime
2022-11-19 19:08:06 +01:00
Johan Engelen
96b5cfb371
LLVM 16 fix build (#4259)
* Remove initialization of removed legacy passes

See: 4153f989ba
and  ef37504879

* Add initializeAggressiveInstCombine pass

* LLVM16: Fix build for new MemoryEffects attributes (`memory(read)` instead of `readonly`)
2022-11-13 18:27:06 +00:00
Johan Engelen
62bcb9854b
LLVM15: fix tests for LLVM15 and opaque pointers (#4252) 2022-11-10 23:55:17 +00:00
Martin Kinkelin
e040d28745 Merge remote-tracking branch 'origin/master' into pre-monorepo 2022-10-04 14:19:56 +02:00
Nicholas Wilson
906037988f
Move abi*.* to abi/ (#4192) 2022-09-21 13:16:04 +00:00
Martin Kinkelin
b81c2b5510 Adapt to new array-append frontend lowerings 2022-09-15 21:00:53 +02:00
Martin Kinkelin
6998886e89 Adapt to removed _d_array[set]ctor druntime hooks (replaced by templated lowerings) 2022-09-15 19:00:21 +02:00
jamesragray
7d8e0f787b
Add UWTableKind for LLVM15+ (#4169)
uwtable attribute needs an argument. This was set using setUWTableKind

Co-authored-by: james <jamesragray@bitbucket.org>
2022-09-15 21:24:53 +08:00
Martin Kinkelin
bdef01e7cc Raise min LLVM version to 9.0 2022-04-25 23:11:48 +02:00
Martin Kinkelin
d57435e2cf Don't use noalias-return attribute for GC-allocating druntime function prototypes
As that's invalid according to
https://github.com/llvm/llvm-project/issues/54740, and a problem
since LLVM 14 at least.
2022-04-04 18:17:59 +02:00
Martin Kinkelin
dc25da9557 ABI: Handle extern(C++) delegates for 32-bit MSVC with __thiscall convention 2022-02-22 14:48:38 +01:00
Martin Kinkelin
a9877cb2b7 Remove orphaned dmd/root/root.h
This file isn't part of the upstream frontend anymore.
2022-02-17 02:14:48 +01:00
Martin Kinkelin
18d819cd83 Don't allocate frontend Arrays and OutBuffers on the C++ heap
That's just begging for trouble with -lowmem, as they contain roots to
(potentially GC-managed) D arrays.

After a rather superficial grep-check for `new ` in the *.{cpp,h} files,
these should be about all occurrences of frontend stuff previously
allocated on the C++ heap.
2021-09-17 03:49:28 +02:00
Martin Kinkelin
9858cfb01c Simplify dmd/ldcbindings.{d,h} 2021-09-17 03:49:28 +02:00
Martin Kinkelin
fab82436dd Use new druntime hooks _d_arraybounds_{slice,index} for more informative RangeErrors
Fixing dmd-testsuite's runnable/testbounds.d.
2021-09-09 17:37:38 +02:00
Martin Kinkelin
1e00f63045 Adapt to upstream global.params.* -> target.* shuffling 2021-05-29 00:19:22 +02:00
Martin Kinkelin
079858f3b2 Upgrade frontend & libs to early v2.095.0 (dlang/dmd@a4274b3c39) 2020-11-27 17:45:13 +01:00
Martin Kinkelin
c155e3c141
Merge pull request #3600 from kinke/linkonce2
Extend -linkonce-templates by matching template emission scheme
2020-11-27 02:45:14 +01:00
Martin Kinkelin
3f716ff75e Refactoring: Introduce getIrType()
As *the* way to access the IrType associated with a Type via its `ctype`
field. Most importantly, it makes sure all access is redirected to the
*unqualified* type's `ctype`, which allows to get rid of the 'multiple
types' workaround for aggregates in DtoType(). Those were e.g. hit for
`shared struct SpinLock`, where the struct's type includes the `shared`
modifier...
2020-11-13 15:43:18 +01:00
Martin Kinkelin
145ce40b11 Extend -linkonce-templates by matching template emission scheme
I.e., *define* templated symbols in each referencing compilation unit
when using discardable linkonce_odr linkage, analogous to C++.

This makes each compilation unit self-sufficient wrt. templated symbols,
which also means increased opportunity for inlining and less need for
LTO. There should be no more undefined symbol issues caused by buggy
template culling.

The biggest advantage is that the optimizer can discard unused
linkonce_odr symbols early instead of optimizing and forwarding to the
assembler. So this is especially useful with -O to decrease compilation
times and can at least in some scenarios greatly outweigh the
(potentially very much) higher number of symbols defined by the glue
layer.

Libraries compiled with -linkonce-templates can generally not be linked
against dependent code compiled without -linkonce-templates; the other
way around works.
2020-11-13 02:41:11 +01:00
Martin Kinkelin
39d3aa7d34
druntime: Define rt.aaA.AA as naked pointer, no struct wrapper (#3613)
To fix ABI incompatibilities between the previous struct and `void*`
used by the hardcoded compiler prototypes, e.g., for WebAssembly, which
uses the default UnknownTargetABI, which uses LLVM byval for all structs
and static arrays.
2020-11-13 01:52:42 +01:00
Martin Kinkelin
834f666ce5
Raise min LLVM version to 6.0 (#3493) 2020-07-13 20:42:50 +02:00
Hiroki Noda
a31ac78037
[Trivial] Remove unused parameter attribute (#3477) 2020-06-26 03:21:19 +02:00
Martin Kinkelin
030123410a Add support for LLVM 9.0.0
Including some of Nicholas' fixes in #3144.
2019-09-25 03:42:18 +02:00
Martin Kinkelin
e52199469f Upgrade front-end & libs to v2.087.0-beta.1 2019-06-21 15:39:45 +02:00
Martin Kinkelin
3e0e98607f Fix C assert calls for uClibc
Resolves #3078.
2019-05-31 11:14:13 +02:00
Martin Kinkelin
1c3cb2bade Refactoring: Replace isMusl() by triple.isMusl()
As LLVM 3.9 is the min required version now.
2019-05-31 10:49:45 +02:00
Martin Kinkelin
ef2bbfa09b Fix DIP1008
Invoke _d_newThrowable for exception allocation & initialization, and
increase the reference count in LDC-specific _d_throw_exception for MSVC
targets. Fixes runnable/test19317.d.
2019-04-25 22:16:20 +02:00
Martin Kinkelin
0dbd7ded60 Adapt to switch error lowering to object.__switch_error!()
The _d_switch_error function has been removed from druntime.
2019-04-23 22:41:44 +02:00
Martin Kinkelin
3817ab0595 Upgrade front-end & libs to v2.086.0-beta.1 2019-04-23 22:13:13 +02:00
Martin Kinkelin
5e93ed0dfd Upgrade front-end & libs to v2.085.0-beta.1 2019-03-01 18:19:00 +01:00
Martin Kinkelin
33cadfaca6 Remove ldc.arrayinit & streamline _d_array_slice_copy/_d_arraycast_len with upstream 2019-01-07 15:54:26 +01:00
Martin Kinkelin
32ecbdd266 Upgrade front-end & libs to v2.084.0-beta.1 2018-12-18 02:31:57 +01:00
Martin Kinkelin
4a23399236 Aim for consistent #includes (order + dir prefix)
I surely missed a few.
2018-10-20 16:19:46 +02:00
Martin Kinkelin
40cf784cbe Misc. merge fixes, minor adaptions 2018-08-17 21:31:53 +02:00
Martin
e337cec78a Slightly refactor RTTIBuilder 2018-04-04 19:59:10 +02:00
Martin
4c1154703e Improve LoC propagation for error messages in gen/runtime.cpp 2018-04-04 19:59:10 +02:00