Commit graph

438 commits

Author SHA1 Message Date
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
Martin Kinkelin
48e1df4759 Fix crash with -lowmem -mixin 2019-03-09 15:07:00 +01:00
Martin Kinkelin
eed8cb88f5 Filter out --DRT-* options in the cmdline 2019-03-03 01:55:51 +01:00
Martin Kinkelin
8016608a55 Enable opt-in GC for front-end via explicit -lowmem switch
This is a port of dlang/dmd#9048.
2019-03-02 21:16:18 +01:00
Martin Kinkelin
6765e51799 Change behavior when invoking LDC/LDMD without source files
Only display the appropriate usage help (and then fail) if invoked
without any explicit cmdline options. Otherwise emit an error about
missing source files and fail immediately, without displaying the usage
help.

Besides making LDC and LDMD behave identically in this regard, it makes
just more sense IMO (when forgetting to specify a file, LDC previously
just printed the cmdline help without any error message).

It also makes `ldmd2 -transition=?` and `ldmd2 -preview=help` etc. print
the expected help without LDMD special cases.
2019-03-01 18:19:00 +01:00
Martin Kinkelin
12d6193b9a Print transition/preview/revert usage help without src file 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
b972262f73 Refactoring: Let mars.d handle cmdline reconciliation 2019-03-01 18:19:00 +01:00
Martin Kinkelin
5e93ed0dfd Upgrade front-end & libs to v2.085.0-beta.1 2019-03-01 18:19:00 +01:00
Martin Kinkelin
b9ebfe0fca Add -transition={fixAliasThis,markdown,vmarkdown} 2018-12-22 00:23:42 +01:00
Martin Kinkelin
a170aa4b2c Don't let -unittest override -{enable,disable}-asserts
This conforms to a DMD breaking change too.
2018-12-21 22:16:45 +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
389977d084 Add new cmdline option -mixin=<filename> 2018-12-21 20:17:50 +01:00
Martin Kinkelin
26c27c664d Don't codegen header files (.di)
A port from dmd/mars.d.
2018-12-21 19:13:08 +01:00
Martin Kinkelin
32ecbdd266 Upgrade front-end & libs to v2.084.0-beta.1 2018-12-18 02:31:57 +01:00