Commit graph

502 commits

Author SHA1 Message Date
Johan Engelen
91d306894e
Add support for LLVM 17. (#4533) 2023-12-03 19:07:31 +01:00
Martin Kinkelin
406df56b82 Add new CLI options -fno-moduleinfo and -fno-rtti
Using the same names as GDC.
2023-11-06 21:25:18 +01:00
Martin Kinkelin
a2bd6a6c95 Add new CLI option -fno-exceptions (-nothrow for ldmd2)
Tested by `fail_compilation/test24084.d`.
2023-11-06 20:46:06 +01:00
Martin Kinkelin
a053480010 Misc. merge fixes (C++) 2023-11-06 00:33:57 +01:00
liushuyu
a49db8e5d3
Add initial support for LoongArch64 (#4500) 2023-10-05 12:36:01 +02:00
Martin Kinkelin
798fde387d Follow DMD and make -betterC imply -allinst 2023-08-26 23:45:32 +02:00
Martin Kinkelin
9c265436fe Adopt DMD's -wo command-line option to enable warnings about obsolete features
Fixes dmd-testsuite's fail_compilation/body.d.
2023-08-26 23:16:43 +02:00
Martin Kinkelin
81ea49db13 Merge remote-tracking branch 'origin/master' into llvm16-2 2023-08-12 14:37:01 +02:00
Martin Kinkelin
53e52ccbe4 Fix initialization of new global.compileEnv
Fixes some dmd-testsuite regressions, such as fail_compilation/diaginref.d.
2023-07-16 18:24:15 +02:00
Martin Kinkelin
5b137768a0 Run C preprocessor 2023-06-07 12:06:25 +02:00
Ikey Doherty
0454f3378f
driver/main: For LLVM > 16, stop using AggressiveInstCombine
This was killed upstream in the codegen pipeline as part of a bunch of
legacy PM removals:

 - https://reviews.llvm.org/D137116

Signed-off-by: Ikey Doherty <ikey@serpentos.com>
2023-06-03 22:06:53 +01:00
Martin Kinkelin
5dd0092dc6 Deprecate -dip25 (following DMD)
Fixes fail_compilation/dip25flag.d.
2023-03-25 17:58:42 +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
Martin Kinkelin
d6d72e6c05 Predefine new version D_Optimized with enabled optimizations 2022-11-26 04:19:55 +01: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
80d914c48d Add LDC_LLVM_OpaquePointers version identifier, to support both opaque and typed pointers in source code (notably druntime ldc/intrinsics.di) 2022-11-15 01:48:22 +01:00
Johan Engelen
96b5cfb371
LLVM 16 fix build (#4259)
* Remove initialization of removed legacy passes

See: 4153f989ba
and  ef37504879

* Add initializeAggressiveInstCombine pass

* LLVM16: Fix build for new MemoryEffects attributes (`memory(read)` instead of `readonly`)
2022-11-13 18:27:06 +00: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
906037988f
Move abi*.* to abi/ (#4192) 2022-09-21 13:16:04 +00:00
Nicholas Wilson
6b38ad0eff
Move gen/cl_helpers.* to driver/ (#4191) 2022-09-21 19:36:24 +08:00
Nicholas Wilson
1951db6d1d
Deprecate -check-printf-calls (#4183) 2022-09-18 10:25:43 +08:00
Nicholas Wilson
39727641d5
fix Optional deprecation in LLVM16 (#4177) 2022-09-16 16:16:51 +08:00
Martin Kinkelin
b7624aa625 Upgrade frontend & libs to pre-DMD-monorepo state (dlang/dmd@20bd0cacbd) 2022-09-12 16:14:16 +02:00
Martin Kinkelin
c555700c9d Predefine new version D_Invariants 2022-04-27 01:23:53 +02:00
Martin Kinkelin
b7b8e59043 Upgrade frontend & libs to v2.100.0-beta.1+ (dlang/dmd@c0cff59c79) 2022-04-26 23:01:13 +02:00
Martin Kinkelin
bdef01e7cc Raise min LLVM version to 9.0 2022-04-25 23:11:48 +02:00
Martin Kinkelin
603e773278
Merge pull request #3946 from drahosj/master
Added support for newlib
2022-04-07 22:54:44 +02:00
Martin Kinkelin
264776a3c9 [more liberal uclibc/newlib environment matching/patching]
To make e.g. `-mtriple=armv7-none-newlibeabi` work, where
`newlibeabi` was previously apparently treated as OS component
before normalization.
2022-04-07 04:53:50 +02:00
Martin Kinkelin
224217b193 [refactor fixup{UClibc,Newlib}Env] 2022-04-07 03:51:01 +02:00
Martin Kinkelin
143d7b3171 Fix compile & link errors against LLVM 14 2022-03-30 13:51:18 +02:00
Jake Drahos
543b218c88 Strip newlib without first parsing triple
Avoids issues where an environment won't be recognized
as the environment component when the specified as a less-than-full
quadruple.
2022-03-16 15:44:33 -05:00
Jake Drahos
7e01c62ef9 Added support for newlib
Similar to fixupUClibcEnv, fixupNewlibEnv checks for "newlib" within
the environment of the triple, sets a global flag, then removes [-]newlib
from the triple. This preserves "eabi" if present in the triple, and allows
both arm-unknown-none-eabi-newlib and arm-unknown-none-newlib to
work.
2022-03-16 14:02:49 -05:00
Martin Kinkelin
1e7fe83a0c Support *.{i,c} files as -run arguments too 2022-03-11 20:45:41 +01: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
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
64d79ef753 Write JSON file with -Xi without -X/-Xf
Fixes dmd-testsuite's compilable/jsonNoOutFile.d.
2021-09-09 01:54:40 +02:00
Martin Kinkelin
e126c86b41 Adapt to global.params.useDIP1000 refactoring 2021-09-07 16:51:19 +02:00
Martin Kinkelin
d38c576919
Merge pull request #3808 from JohanEngelen/gh3802
Fix issue #3802 - Fix size_t size for 32bit ABI on 64bit architectures.
2021-08-14 20:44:10 +02:00
Martin Kinkelin
ec5fd799b9 Predefine version D_X32 for 64-bit targets with 32-bit pointer size 2021-08-14 18:52:23 +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
Mathias LANG
926db58d5c
Driver: Use CppRuntime_Gcc by default with Musl (#3769)
While CppRuntime should ideally be moved out of the compiler,
it is currently reserved by the compiler and can't be defined
in user code. The most used Musl platform is Alpine Linux,
which doesn't have an alternative for CppRuntime_Clang,
so just define it to use Gcc for now.
2021-06-21 05:07:17 +00:00
Martin Kinkelin
a8475bec8a Add -dllimport CLI option for explicitly controlling implicit dllimports 2021-06-15 00:15:19 +02:00
Martin Kinkelin
9865e459d1 Windows: Make implicit dllimport more selective
* Newly require `-link-defaultlib-shared` for implicit dllimport.
  E.g., this enables to compile druntime DLL with `-fvisibility=public`
  for pure exports and no (local) imports (such as builtin TypeInfos).
* `-link-defaultlib-shared` alone now only implicitly imports symbols
  from druntime/Phobos.
  This simplifies building complex DLLs linked against a bunch of
  static libs (dub only supports static lib dependencies!); the static
  libs don't need to be compiled with `-fvisibility=public` anymore
  (if the DLL itself isn't either), `-link-defaultlib-shared` is
  sufficient.
  This is mainly useful for existing DLLs with explicit exports, to make
  them link against *shared* druntime/Phobos and so end up with a single
  druntime/Phobos for the whole process.
2021-06-14 17:47:32 +02:00
Martin Kinkelin
2ffe09ddbc Merge upstream stable (dlang/dmd@2adf6ff4f6) 2021-05-31 02:44:42 +02:00
Martin Kinkelin
331ca177d6 Fix upstream regression wrt. mutual init dependency of Type and Target
`Type._init()` depends on `Target.isLP64`, and `Target._init()` depends
on `Type.{twchar,tdchar}`. `Type` is initialized before `Target`.

Previously, `isLP64` was in `global.params`, which are initialized very
early.
2021-05-29 00:19:22 +02:00
Martin Kinkelin
1e00f63045 Adapt to upstream global.params.* -> target.* shuffling 2021-05-29 00:19:22 +02:00