Commit graph

249 commits

Author SHA1 Message Date
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
Martin
bd623f028a Redirect access to remaining TypeInfo subtypes through gen/runtime 2018-04-04 19:59:10 +02:00
Martin
d8f60d2f5c Redirect access to object.d type declarations through gen/runtime
Not all type declarations yet (e.g., some TypeInfo subtypes are still
accessed directly), but those already wrapped as LazyType in the
gen/runtime.cpp module (with check and proper error msg in case object.d
doesn't contain a required declaration).
2018-04-04 19:59:10 +02:00
Martin
081b681776 Forward-declare runtime functions lazily
Thereby deferring requirements wrt. object.d declarations (Object,
Throwable, TypeInfo, TypeInfo_Class, TypeInfo_Struct...) and paving the
way for a minimal druntime.

This also greatly reduces the `-vv` output for tiny code samples, e.g.,
reduced test cases.
2018-04-04 19:59:10 +02:00
Martin Kinkelin
5e4d04faad
Call _Unwind_Resume() directly (except for ARM EABI) (#2642)
This fixes the 32-bit std.file unittests on Linux with enabled
optimizations. Quoting the SysV ABI docs:

> This is the only routine in the unwind library which is expected to be
> called directly by generated code: it will be called at the end of a
> landing pad in a "landing-pad" model.

The remaining LDC-specific ARM EABI wrapper (_d_eh_resume_unwind()) is
implemented in assembly (ldc/eh_asm.S), preserving registers apparently.
2018-04-04 19:58:06 +02:00
joakim-noah
04cd029bb9 Pull in Musl's assert function for betterC mode. (#2604) 2018-03-04 20:48:07 +01:00
Oleg Nykytenko
907dae171a Solaris: fix assert for betterC build. (#2566)
* Solaris: fix assert for betterC build.

* Added parens to avoid relying on operator precedence rules.
2018-02-09 16:07:07 +00:00
Martin
197e65efde Merge branch 'master' into merge-2.078
Conflicts:
	driver/main.cpp
	gen/cl_helpers.h
	gen/declarations.cpp
	runtime/druntime
	tests/d2/dmd-testsuite
2018-01-20 11:20:17 +01:00
Johan Engelen
f2d9ff3424
Add DMD-style function trace profiling. (#2477) 2018-01-14 22:22:59 +01:00
Martin
e1e5229f2a Clean up more unused runtime function declarations 2018-01-07 05:37:31 +01:00
Martin
f9575686e1 Get rid of obsolete runtime functions
For array comparisons (new) and the _adReverse family.
2018-01-07 05:03:37 +01:00
Martin
b83780538f Adapt to new string-switch lowering
Now all done in the front-end, no need for us to handle it manually
anymore. This also fixes tests/semantic/dcompute.d.
2018-01-07 01:43:12 +01:00
Johan Engelen
7e7de7a69e
Move instrumentation options into their own .h/.cpp files. (#2472) 2017-12-28 11:44:51 +01:00
Martin
dfe45715ba Enable catching C++ exceptions for non-MSVC targets 2017-11-26 18:41:01 +01:00
Martin
c378636fcf druntime: Use adapted upstream DWARF EH 2017-11-26 18:40:21 +01:00
Martin
b59849ab28 Android: Use proper C assert function signature 2017-11-19 18:56:21 +01:00
Martin
aa97794dc6 Annotate C assert function with nounwind attribute 2017-10-25 00:38:05 +02:00
Martin
30b858781b -betterC: Use C assert function
Instead of druntime's _d_assert[_msg], _d_arraybounds and
_d_switch_error.

Tested by dmd-testsuite's runnable/cassert and compilable/betterCarray.
2017-10-25 00:38:05 +02:00
Martin
c251170912 Rename DtoMangled... to getIRMangled... 2017-10-07 14:06:17 +02:00
Martin
192649326d Remove dead code 2017-10-07 14:06:17 +02:00
Martin
c9a3be1295 Let TargetABI fix up LLVM mangles for more special symbols
For ModuleInfos, ModuleRefs, InterfaceInfos, interface vtables & thunks.
2017-10-07 14:06:17 +02:00
Martin
0b28925e9a Win32: Remove extra leading underscore from D symbol mangling
This is compatible with DMD.
2017-10-07 14:06:17 +02:00
Martin
2616261fd2 Revise all LDC-specific errors/warnings/deprecs and insert backticks
For DMD's new syntax highlighting. I grepped in all .{h,cpp} files only.
2017-08-03 22:53:49 +02:00
Martin
1fb269f940 Drop support for LLVM < 3.7 2017-07-16 02:18:00 +02:00
Martin
5f0e83824b Update 2 hardcoded strings used in error messages 2017-06-17 19:49:54 +02:00