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>
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.
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.
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.
* 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.
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.
* 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.
`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.