Commit graph

210 commits

Author SHA1 Message Date
Martin Kinkelin
1bf7e28c59 Add -Xcpp CLI option for C preprocessor flags (-P with ldmd2) 2023-06-07 12:06:25 +02:00
Martin Kinkelin
422555a4d0 Merge remote-tracking branch 'origin/master' into merge-2.103 2023-04-21 15:25:14 +02:00
Johan Engelen
ba2e25bc44
Add --fsplit-stack. (#4379) 2023-04-19 23:00:51 +02:00
Johan Engelen
044b919bf6
Add --fwarn-stack-size=<threshold> for LLVM >= 13. (#4378) 2023-04-19 23:00:24 +02:00
Johan Engelen
25dc3fc6eb
Remove "experimental" from --cache (#4364)
It's been there for a while and has been used at Weka for a while too.
2023-04-13 15:39:40 +02:00
Martin Kinkelin
28ac391a87 Adopt new CLI option -verror-supplements=<num> 2023-03-12 22:21:54 +01:00
Martin Kinkelin
48a897eedf Merge remote-tracking branch 'origin/master' into merge-2.102 2023-02-24 21:25:26 +01:00
Martin Kinkelin
e2790bdaa2 Hide new LLVM 15 command-line options 2023-02-24 15:23:41 +01:00
Martin Kinkelin
2f44a281f9 Merge remote-tracking branch 'origin/master' into merge-2.102 2023-02-22 16:13:22 +01:00
Zachary Yedidia
7f2498b6cd
Allow RISC-V ABI to be configured by mabi (#4322) 2023-02-14 21:46:10 +00:00
Martin Kinkelin
710950246b Fix compile errors for compiler itself 2023-02-12 17:47:37 +01:00
Martin Kinkelin
38c480c0ac Override LLVM's -opaque-pointers CLI option, to default to false for now 2023-01-26 13:54:17 +01:00
Johan Engelen
07f009cdee
Add -fno-delete-null-pointer-checks (#4297)
The commandline option name stems from GCC and Clang.
2023-01-13 01:00:48 +00: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
da3e45f330
Fix loading pass plugins while using the new passmanager. (LLVM >= 14) (#4254) 2022-11-12 11:58:51 +01:00
Johan Engelen
fed90e8993
Give error when selecting unsupported passmanager. (#4250) 2022-11-10 23:10:01 +00:00
Martin Kinkelin
e040d28745 Merge remote-tracking branch 'origin/master' into pre-monorepo 2022-10-04 14:19:56 +02:00
Nicholas Wilson
6b38ad0eff
Move gen/cl_helpers.* to driver/ (#4191) 2022-09-21 19:36:24 +08:00
Martin Kinkelin
b7624aa625 Upgrade frontend & libs to pre-DMD-monorepo state (dlang/dmd@20bd0cacbd) 2022-09-12 16:14:16 +02:00
Johan Engelen
8edd8de439
Add --fno-discard-value-names : Do not discard value names in LLVM IR (#4012) 2022-07-23 12:06:44 +02:00
Martin Kinkelin
bdef01e7cc Raise min LLVM version to 9.0 2022-04-25 23:11:48 +02:00
Martin Kinkelin
101ebce014 Hide new cmdline options leaking from LLVM 14
Checked on Linux.
2022-03-30 18:09:05 +02:00
Martin Kinkelin
4cbaebd965
Make -linkonce-templates less aggressive by default & add -linkonce-templates-aggressive (#3924)
Make -linkonce-templates *not* tamper with the general template
emission algorithm anymore (so on top of default non-allinst or
-allinst modes), and keep those tweaks as experimental
-linkonce-templates-aggressive.

Compiling the druntime/Phobos unittests is only marginally slowed
down compared to the more aggressive variant (~1.5% for debug,
~2.5% for release). It does show some rough 10% increase in required
memory, but that's in line with non-linkonce-templates.

The more aggressive variant has the advantage of skipping
needsCodegen() and potentially codegen'ing less symbols. The problem
is that if an instantiated symbol isn't explicitly referenced, for
instance a CRT ctor, it might not be codegen'd at all.
2022-03-01 00:10:34 +01:00
Martin Kinkelin
fa9897fb18 Sync with dmd/mars.d 2022-02-18 22:04:07 +01:00
Martin Kinkelin
019e9c8e30 Add support for LLVM 13 2021-10-11 19:20:15 +02:00
Martin Kinkelin
5e8490d69e
Merge pull request #3821 from kinke/merge-2.098
Upgrade frontend & libs to early v2.098.0
2021-09-11 20:12:55 +02:00
Martin Kinkelin
16b9eab374
-dllimport=defaultLibsOnly: Avoid -linkonce-templates requirement (#3816)
Via a sorts-of '-linkonce-templates light', only defining all *data*
symbols instantiated from druntime/Phobos templates in each
referencing CU.
2021-09-11 04:53:21 +02:00
Martin Kinkelin
e126c86b41 Adapt to global.params.useDIP1000 refactoring 2021-09-07 16:51:19 +02:00
Johan Engelen
c517ce9d12
Improve ftime-trace implementation. (#3797)
* Improve ftime-trace implementation.
- Rewrite ftime-trace to our own implementatation instead of using LLVM's time trace code. The disadvantage is that this removes LLVM's work from the trace (optimization), but has the large benefit of being able to tailor the tracing output to our needs.
- Add memory tracing to ftime-trace (not possible with LLVM's implementation)
- Do not output the sum for each "category"/named string. This causes the LLVM output to be _very_ long, because we put more information in each time segment name. Tooling that processes the time trace output can do this summing itself (i.e. Tracy), and makes the time trace much more pleasant to view in trace viewers.
- Use MonoTime, move timescale calculation to output stage, 'measurement' stage uses ticks as unit
- Fix crash on `ldc2 -ftime-trace` without files passed.
2021-08-14 14:11:22 +02:00
Martin Kinkelin
db4faf336a Refactoring: Add little dllimportSymbol() helper 2021-06-18 22:31:35 +02:00
Martin Kinkelin
a8475bec8a Add -dllimport CLI option for explicitly controlling implicit dllimports 2021-06-15 00:15:19 +02:00
Johan Engelen
f9147a6f62
Add -cov-increment option to specify the type of increment instruction. Add atomic, non-atomic, and boolean increment types. (#3724) 2021-06-09 12:49:07 +02:00
Martin Kinkelin
ee0d5fbe3c Windows: Default to dllexport with -shared, and enforce dllimport with -link-defaultlib-shared 2021-05-03 20:54:57 +02:00
Martin Kinkelin
eaeb65a9d8 Windows: Make -fvisibility=public export all defined symbols
To pave the way for simple DLL generation (end goal:
druntime-ldc-shared.dll).

The dllexport storage class for functions definitions is enough; the
automatically generated import .lib seems to resolve the regular symbol
name to the actual symbol (__imp_*), so dllimport for declarations seems
superfluous.

For global variables, things are apparently different unfortunately.
2021-04-29 17:20:32 +02:00
Martin Kinkelin
879c8ba465 Upgrade frontend & libs to v2.096.0-beta.1+ (dlang/dmd@0c2d8bd2ab) 2021-02-28 17:40:11 +01:00
Martin Kinkelin
d8bc064cfb Add support for LLVM 12 2021-02-12 07:54:41 +01:00
Martin Kinkelin
2172c605b4 Add support for -makedeps[=<filename>]
And streamline implicit -singleobj with DMD, also enforcing it when
compiling a *single* module *and* specifying the -of name.
[-makedeps currently depends on -singleobj.]
2021-01-07 15:55:00 +01:00
Martin Kinkelin
a4922f6460 Add support for -extern-std=c++20 2021-01-07 01:51:33 +01:00
Martin Kinkelin
fe5a1776ac Merge remote-tracking branch 'origin/master' into merge-2.095 2021-01-06 23:58:20 +01:00
Johan Engelen
29245c8255
Add --ftime-trace functionality. (#3624)
This uses LLVM's TimeProfiler functionality, such that LLVM's work is traced in the same profile (optimization and machine code gen).
Functionality is meant to be identical to Clang and LLD's --ftime-trace.
2020-12-28 17:05:04 +01: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
45a9e062f0 Default to -linkonce-templates=false again but enable for defaultlib unittests & dmd-testsuite (release) 2020-11-13 02:41:11 +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
c61b1357ed Fix -Xcc=-Wl,... - disallow comma-separated shortcut for -Xcc
E.g., -Xcc=-Wl,-blub used to expand to `cc -Wl -blub`, which is invalid.
With this change, it's now properly forwarded as `cc -Wl,-blub`.
2020-10-03 17:12:29 +02:00
Martin Kinkelin
6f5730049b Merge remote-tracking branch 'origin/master' into merge-2.094
Conflicts:
	gen/tocall.cpp
	runtime/phobos
2020-09-30 19:46:43 +02:00
Martin Kinkelin
4b7f14f58d Hide new LLVM 11 CLI options 2020-09-26 01:04:50 +02:00
Martin Kinkelin
eb64be821a Adapt to llvm:🆑:parser<bool> being final for LLVM < 9 2020-09-25 03:04:19 +02:00
Martin Kinkelin
4be4501227 Re-add support for -HC without value 2020-09-23 21:32:46 +02:00
Martin Kinkelin
4431f6744f Add support for -vtemplates=list-instances 2020-09-23 21:02:59 +02:00
Martin Kinkelin
47b25ca6ab Add support for -cov=ctfe
Incl. making sure `-cov=N ... -cov[=ctfe]` doesn't reset the required
percentage to 0.

Use a dummy *bool* option for a better help output (displaying `--cov`,
not `--cov=<value>`).
2020-09-23 20:57:06 +02:00