Commit graph

502 commits

Author SHA1 Message Date
Martin Kinkelin
bfa3cead08 Upgrade frontend & libs to early v2.097.0 (dlang/dmd@cb0457daf3) 2021-05-29 00:19:22 +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
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
8d71c8624a
-cleanup-obj: Put object files into temporary directory by default (#3660)
To prevent conflicts for concurrent LDC processes in the same
working dir, resolving #3643.

Re-use this for the temporary object files of -run by enforcing
-cleanup-obj in that case. Additionally enforcing -oq prevents
conflicting filenames in that dir and allows to get rid of previous
Module.makeObjectFilenameUnique().
2021-02-11 00:08:47 +01:00
Martin Kinkelin
29b4355f26 Merge upstream stable (dlang/dmd@d8668e1afa)
Requiring some adaptations for enhanced emitMakeDeps functionality.
2021-02-08 21:23:59 +01:00
Martin Kinkelin
4134289978 Musl: Use libunwind for druntime backtraces 2021-01-16 12:12:34 +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
fe5a1776ac Merge remote-tracking branch 'origin/master' into merge-2.095 2021-01-06 23:58:20 +01:00
Martin Kinkelin
0ae530f966 Merge upstream stable (dlang/dmd@ebd5e81dc9) 2021-01-06 23:34:36 +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
1ca4b9332b FreeBSD targets: Predefine version FreeBSD_<major>
As newly required for druntime.
2020-11-27 18:53:11 +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
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
6343bf08a8
Predefine version FreeStanding when targeting bare-metal (#3608)
Resolves #3607.
2020-11-07 15:10:42 +08:00
Martin Kinkelin
baca172439
Fix LTO with -link-internally for MSVC targets (#3604)
Fixes #2657 by deferring the llvm_shutdown() call.

This allows to remove bundled lld-link.exe for the prebuilt Windows
packages.
2020-11-01 19:11:11 +01: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
Hiroki Noda
0f1257fbca Remove RISCV_LLVM_DEV 2020-06-05 18:09:24 +09:00
Roberto Rosmaninho
6274217c39
Add -output-mlir and prepare for MLIR emission (#3313) 2020-05-22 12:31:24 +02:00
Ernesto Castellotti
c40bbbc320
AVR: Add predefined version AVR and emit TLS globals as regular ones (#3420)
The AVR target on LLVM and AVR-GCC does not have support for TLS, so
it is necessary to emit global variables as NotThreadLocal.
2020-05-08 22:47:10 +02:00
Martin Kinkelin
ff36be2c01
Do not fallback to host for critical section size of unknown targets (#3389)
Instead, error out whenever requested by an expression-less
`synchronized` statement, including source LoC to track it down.

This is safer, especially since the previous initial warning may likely
be suppressed, and makes this host-agnostic.

Also suppress previous warnings about unknown `` and `none` OS, treating
these like `unknown`.
2020-03-30 21:26:51 +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
770383c3e7 Upgrade frontend & libs to early v2.091.0 (dlang/dmd@44112eb84b) 2020-02-22 00:33:49 +01:00
Martin Kinkelin
00a270e76f Add predefined versions WASI and CRuntime_WASI for triples like wasm32-unknown-wasi
Requires LLVM 8+.
2020-02-08 15:42:45 +01:00
Martin Kinkelin
bfde22d865 Properly disable GC without -lowmem
This is a cherry-pick from dlang/dmd#10752. Rainer has found out that
the compiler might crash with a segfault when aborting via exit() upon
some compile error, and that this seems to be related to GC worker
threads (so only an issue with recent host compilers), spawned because
of some module ctors bypassing `root/rmem.d` and using the GC directly,
like setting up an associative array in `imphint.d`.

He came up with a nice simple solution to this, making sure the GC
starts in disabled mode whenever it is initialized.
2020-02-05 22:06:22 +01:00
Martin Kinkelin
f22304abb0 Don't allocate front-end Strings on C++ heap
If the GC is enabled (-lowmem), it must know about those Array instances,
so that the GC-allocated array of pointers and referenced GC-allocated
strings are kept alive.
2020-02-05 22:06:22 +01:00
Fangrui Song
0a007a55f8
Fix StringRef conversion for LLVM 11 (777180a32b61070a10dd330b4f038bf24e916af1) (#3305) 2020-02-01 02:52:35 +01:00
Martin Kinkelin
97e0d978ee
Merge pull request #3288 from jacob-carlborg/ios
Add support for iOS, tvOS and watchOS
2020-01-28 22:55:50 +01:00
Martin Kinkelin
f1fb9d50fd Slightly revise iOS additions 2020-01-28 20:45:07 +01:00
Martin Kinkelin
78af39a5c7 Fix minor potential issues wrt. CLI parsing of -m32/-m64
Ignore it if the default triple (as opposed to the host) has the desired
bitness already. So only relevant if the default triple doesn't match
the host. I think that should render LDC-specific NO_ARCH_VARIANT in
dmd-testsuite's Makefile obsolete (if set, d_do_test won't add -m32/-m64
by default).

Also fix the config file section lookup in case both -m32 and -m64 are
specified.
2020-01-21 23:37:46 +01:00
Jacob Carlborg
b9c284537a Add predefined version identifiers for Apple platforms 2020-01-19 20:57:23 +01:00
Martin Kinkelin
7a6c536fe9 Merge remote-tracking branch 'origin/master' into merge-2090 2020-01-12 15:49:04 +01:00
Martin Kinkelin
f7a15a59c5
Support 2 leading dashes in manual CLI pre-parsing (#3275)
Fixes #3268 and related issues.
2020-01-12 13:31:22 +01:00
Martin Kinkelin
4ac7f0554b Adapt to frontend refactorings 2019-12-22 16:29:45 +01:00
Martin Kinkelin
12a386cdae New DIP1021 implies DIP1000
Fixes dmd-testsuite's fail_compilation/test1021.d.
2019-10-18 23:46:21 +02:00
Ivan Butygin
a40c6c7fd2
Make LDC custom passes available to jit, add API for jit compiler options (#2758) 2019-09-08 09:16:05 +03:00
Martin Kinkelin
72b790c536 Add lit-test wrt. application of --DRT-* options in response files 2019-08-09 04:28:25 +02:00
Martin Kinkelin
42619762e9 Windows: Read environment variables as UTF-8
And use the wide API for pure is-env-variable-set checks too, as the
first call to a narrow env API function would lead to the C runtime
preparing and maintaining both narrow and wide environments.
2019-08-08 22:38:38 +02:00
Martin Kinkelin
9626213a5e Windows: Switch console code page to UTF-8, for LDC and LDMD
For proper in/output of narrow UTF-8 strings.
2019-08-08 22:38:38 +02:00
Martin Kinkelin
9bb3bb1457 Fix manual cmdline parsing (ignore after -run) 2019-08-08 22:38:38 +02:00
Martin Kinkelin
c7766b9357 Windows: Switch to wmain entry point & convert to UTF-8 (ldc2 & ldmd
only)

This makes _d_wrun_main (cherry-picked from dlang/druntime#2701) use the
provided args directly instead of the process's real arguments (on
Windows) - if the host D compiler supports it.
E.g., this is required when passing --DRT-* options from a response file
to _d_wrun_main.

As a major change, the encoding of the Windows cmdline arguments is
switched from the current codepage to UTF-8.

Note that the MinGW-based libs currently only provide narrow CRT entry
points.
2019-08-08 22:38:37 +02:00
Martin Kinkelin
0c0d0f6365 Expand response files before parsing -lowmem
This is required for dub, which appears to always use a response file
containing all command-line arguments.
2019-08-08 22:38:37 +02:00
Martin Kinkelin
e52199469f Upgrade front-end & libs to v2.087.0-beta.1 2019-06-21 15:39:45 +02:00
Nicholas Wilson
b750ce0c27
add __traits(getTargetInfo, "dcomputeTargets") (#3090) 2019-06-14 10:49:46 +08: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
3817ab0595 Upgrade front-end & libs to v2.086.0-beta.1 2019-04-23 22:13:13 +02:00