Commit graph

180 commits

Author SHA1 Message Date
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
Martin Kinkelin
f202c851ae Upgrade frontend & libs to v2.094.0-beta.1 2020-09-22 00:06:19 +02:00
Martin Kinkelin
877ce6fe4c
Add -gdwarf CLI option to emit DWARF debuginfos for MSVC targets (#3533)
Analogous to clang.
2020-08-11 10:30:31 +02:00
Martin Kinkelin
834f666ce5
Raise min LLVM version to 6.0 (#3493) 2020-07-13 20:42:50 +02:00
Martin Kinkelin
e3a1096e44 Merge upstream stable (dlang/dmd@bafab33f27) 2020-07-03 22:20:29 +02:00
Martin Kinkelin
9725dcd5de Add CLI option -vtemplates 2020-06-21 05:31:40 +02:00
Hiroki Noda
b8b7615696
Add --fno-plt option to avoid PLT external calls (#3443)
This patch gives new option which avoids the PLT and lazy binding while
making external calls.
Implementation inspired by `-fno-plt` support to Clang.

Clang's patch: https://reviews.llvm.org/D39079
2020-05-24 22:31:07 +02:00
Roberto Rosmaninho
6274217c39
Add -output-mlir and prepare for MLIR emission (#3313) 2020-05-22 12:31:24 +02:00
Martin Kinkelin
26678a1631 Support new CLI switches -verror-style and -HC, -HCd, -HCf 2020-02-27 01:54:28 +01:00
Martin Kinkelin
2d86e49fba
Finalize support for LLVM 10 (#3323) 2020-02-14 17:53:40 +01:00
Martin Kinkelin
4d167b09f3 Merge upstream stable (47874e5b37) 2019-11-17 15:14:41 +01:00
Martin Kinkelin
fbfbdf3503 Hide command-line options leaking from LLVM 9 2019-10-27 00:12:13 +02:00
Guillaume Piolat
1f9ce7e613 Disambiguate that -link-defaultlib-shared can take a parameter (#3169) 2019-10-09 21:43:38 +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
b5fda2e59c Clean up front-end diff some more 2019-04-14 15:47:16 +02:00
Martin Kinkelin
9624834ccf Hide a few new LLVM 8 cmdline options 2019-03-02 19:54:36 +01:00
Martin Kinkelin
0530f08e9a Hide legacy cmdline options -dip<N> 2019-03-01 18:19:00 +01:00
Martin Kinkelin
b8dc871e81 Add cmdline options -preview and -revert
Reusing parsing and usage functionality from DMD, as the number of these
is likely to grow.
2019-03-01 18:19:00 +01:00
Martin Kinkelin
6c3d8b952e Add cmdline option -extern-std=c++{98,11,14,17} 2019-03-01 18:19:00 +01:00
Martin Kinkelin
40ca840560 Add cmdline option -verrors-context (-verrors=context for LDMD) 2019-03-01 18:19:00 +01:00
Martin Kinkelin
ef6bab0389 Add cmdline option -checkaction=context 2019-03-01 18:19:00 +01:00
Martin Kinkelin
8db8780a81 Re-sync LDMD cmdline usage help with upstream 2018-12-21 23:18:30 +01:00
Martin Kinkelin
d33b827f96 Don't let -d-debug (without arg) override previous asserts, contracts etc.
This is what DMD does AFAICT and fixes
https://github.com/ldc-developers/ldc/issues/599.
2018-12-21 22:30:00 +01:00
Martin Kinkelin
25dd4007e7 Don't let -release cmdline option override previous -{enable,disable}-{invariants,preconditions,postconditions,contracts}
This is a breaking change, conforming to new DMD semantics.
The previous semantics were inconsistent, as -{enable,disable}-asserts
and -boundscheck (as well as new -{enable,disable}-switch-errors)
weren't overridden.
2018-12-21 22:15:04 +01:00
Martin Kinkelin
2d539fa63d Add new cmdline option -checkaction=<D|C|halt> 2018-12-21 21:36:42 +01:00
Martin Kinkelin
40fcc3fd70 Add new cmdline option -{enable,disable}-switch-errors 2018-12-21 21:05:20 +01:00
Martin Kinkelin
389977d084 Add new cmdline option -mixin=<filename> 2018-12-21 20:17:50 +01:00
Martin Kinkelin
32ecbdd266 Upgrade front-end & libs to v2.084.0-beta.1 2018-12-18 02:31:57 +01:00
Andrey Penechko
7bcd6d34dd Add option '-fvisibility=<hidden|default>' able to hide symbols not marked as 'export' on non-Windows targets. Resolves #2431 (#2894) 2018-11-09 20:55: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
61a7e407ab Add new command-line option -transition=<dtorfields|14246> 2018-10-20 16:19:46 +02:00