Martin Kinkelin
75f18b49ba
Merge pull request #3441 from kinke/fix_captured_nonpassed
...
Fix ICE for *captured* parameters *not* passed on the LLVM level
2020-05-29 18:28:45 +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
Martin Kinkelin
0c0102a9e4
Fix ICE for *captured* parameters *not* passed on the LLVM level
...
Their IrParameter isn't created as part of DtoDeclareFunction(). Before
being able to handle that later in defineParameters() (as part of
defining the function), DtoCreateNestedContextType() steps in and
creates an IrLocal if not already created.
1) Create an IrParameter in that case in DtoCreateNestedContextType().
2) Handle these new value-less (no LL param) IrParameters in
defineParameters().
3) Fix the iOS AArch64 ABI, as apparently not all empty structs are
ignored for parameter passing, but only POD ones.
Also don't ignore anything passed by reference.
2020-05-22 14:58:29 +02:00
Martin Kinkelin
967947eb84
Emulate @weak functions on Windows and don't emit COMDATs for ELF anymore
...
Emulation for @weak global variables is still left out but should be
analogous.
The test adaptations are mostly a revert of 3893840f
. The testcase has
shown that @weak hasn't worked properly for ELF (linker apparently
prefers the version in the 1st object file, independent of whether it's
weak or not), because the functions are emitted in COMDATs.
clang emits COMDATs for templates and inline functions only, not for
regular functions.
2020-05-16 20:42:57 +02:00
Martin Kinkelin
f4f80d32d7
Make IR type determination for captured lazy params TargetABI-agnostic
...
This fixes codegen/nested_lazy_gh2302.d for AArch64, which failed due to
the TargetABI rewriting the delegate (IR struct) to `[2 x i64]`.
2020-05-03 16:31:46 +02:00
Martin Kinkelin
d603010159
Refactoring: Introduce TargetABI::isExternD()
2020-05-03 16:31:46 +02:00
Martin Kinkelin
3786614967
Merge upstream stable ( dlang/dmd@2dc6c9d619 )
2020-05-03 13:36:07 +02:00
Martin Kinkelin
d8f22699a8
Prevent redundant type semantic for va_list
2020-05-02 01:06:58 +02:00
Martin Kinkelin
684acd6a3f
Improve check for multiple entry point definitions
...
* Extend the error message, closely following DMD. Tested by
fail_compilation/fail5634.d.
* Check across all compiled modules, not on a per-object-file basis.
That's what DMD does too.
* Apply the implicit `return 0` / void -> int return type promotion to
all D/C main functions, not just the first one. This prevents some
potential follow-up crashes.
2020-04-28 01:37:49 +02:00
Martin Kinkelin
5e7e0d55bc
Merge remote-tracking branch 'origin/master' into merge-2090
...
Conflicts:
tests/d2/dmd-testsuite
2020-01-06 17:01:57 +01:00
Martin Kinkelin
1f5c442519
Revise recent adaptations to frontend refactorings
2020-01-06 17:01:31 +01:00
Fangrui Song
77775a40de
Use function attribute "frame-pointer" instead of "no-frame-pointer-elim"/"no-frame-pointer-elim-non-leaf"
...
LLVM 8 (D56351) introduced "frame-pointer" which was intended to replace
"no-frame-pointer-elim"/"no-frame-pointer-elim-non-leaf".
2019-12-28 09:26:26 -08:00
Martin Kinkelin
4ac7f0554b
Adapt to frontend refactorings
2019-12-22 16:29:45 +01:00
Martin Kinkelin
8fd69da8fb
Make all DtoGEP helpers use implicit inbounds
...
Single functional change: always emit inbounds when computing the base
pointer of a SliceExp.
2019-09-10 22:36:25 +02:00
Martin Kinkelin
d4fa4710e0
Don't emit DMD-style tracing with pragma(LDC_profile_instr, false)
...
E.g., this disables it for __entrypoint.d (the C main function(s) in
there), which is required.
A wmain on Windows is not detected as FuncDeclaration.isCMain() yet,
that should be fixed too.
2019-08-08 22:38:38 +02:00
Martin Kinkelin
d93087ad90
Emit fatal codegen error for unsupported dual-context for now
...
As long as dlang/dmd#9282 isn't ported to LDC.
2019-07-29 20:13:59 +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
cc336d6df1
Support generic ldc.attributes.llvmAttr UDAs for function parameters
2019-03-31 20:59:54 +02:00
Martin Kinkelin
1fdf330346
Refactoring: Remove obsolete AttrBuilder wrapper
...
It was useful when we still supported older LLVM versions, but it's
obsolete now.
2019-03-31 19:18:56 +02:00
Martin Kinkelin
306bda36fd
Adapt to latest LLVM 8 changes
2019-03-02 19:54:36 +01:00
Martin Kinkelin
5e93ed0dfd
Upgrade front-end & libs to v2.085.0-beta.1
2019-03-01 18:19:00 +01:00
Johan Engelen
0a84988d65
Enable pragma(LDC_extern_weak) on function declarations. ( #2984 )
...
Enable pragma(LDC_extern_weak) on function declarations.
2019-01-27 14:44:31 +01:00
Johan Engelen
d2ff275678
Fix glaring mistake in #2983 ( #2985 )
2019-01-27 14:43:13 +01:00
Johan Engelen
354e45737b
Support LLVM 9 (trunk) ( #2983 )
...
* LLVM 9: fix sanitizer pass renaming
* Add LLVM 9 to intrinsics in druntime
* LLVM 9: fix commandline option change from `-disable-fp-elim` to -frame-pointer=`
Resolves issue 2980
2019-01-25 17:58:26 +01:00
Martin Kinkelin
f5a5324773
Merge pull request #2946 from kinke/merge-2.084
...
Upgrade front-end & libs to v2.084.0
2019-01-18 19:48:47 +01:00
Nicholas Wilson
f5ae8311cd
Adapt to using SPIR-V support as an external library ( #2935 )
...
Adapt to using SPIR-V support as an external library.
2019-01-18 14:51:48 +08:00
Martin Kinkelin
c57e597323
Support both CRT ctor and dtor pragmas for a single function
2019-01-06 21:14:40 +01:00
Martin Kinkelin
32ecbdd266
Upgrade front-end & libs to v2.084.0-beta.1
2018-12-18 02:31:57 +01:00
Martin Kinkelin
deaaab8cf3
-fvisibility=hidden: Only hide function *definitions*, don't touch declarations ( #2923 )
2018-12-03 20:59:59 +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
7776c4081b
Upgrade frontend & libs to v2.083.0-beta.1
2018-10-20 16:19:46 +02:00
Elie Morisse
02eb4058fa
Debug info: create temporary forward subprograms before creating the subprogram type
...
This is for the special case of auto functions returning a nested type, e.g:
auto foo() {
struct S {};
S s;
return s;
}
2018-10-15 23:10:18 +02:00
Martin Kinkelin
5c24f60cf9
Raise min LLVM version to 3.9 ( #2872 )
2018-10-15 22:31:59 +02:00
Martin Kinkelin
9fe95daeea
Improve diagnostics for multiple function decls with IR type mismatch
2018-08-18 20:41:41 +02:00
Martin Kinkelin
7461269af4
Merge pull request #2773 from kinke/uda
...
Add @naked UDA
2018-07-28 17:46:59 +02:00
Martin Kinkelin
c10cf86403
Add @naked UDA
...
Adding the LLVM `naked` function attribute and disabling LDC's
prologue/epilogue too.
2018-07-27 22:53:55 +02:00
Martin Kinkelin
4d5871a027
Fix overzealous check for multiple main() functions ( #2778 )
2018-07-19 21:18:50 +02:00
Martin Kinkelin
c536910cb3
Bail out when trying to take address of intrinsic
...
Incl. overloaded aliases.
2018-06-26 23:10:13 +02:00
Ivan Butygin
cbeb2b45d6
@dynamicCompileEmit attribute ( #2747 )
2018-06-26 21:59:02 +03:00
Martin Kinkelin
a133ffad56
MSVC: Port Rainer's upstream extern(C++) method ABI fixes
...
From https://github.com/dlang/dmd/pull/8330 .
2018-06-19 20:13:02 +02:00
Martin Kinkelin
3ca43c51b8
Use IndirectByvalRewrite for non-POD args and extern(C++) on Posix ( #2728 )
...
Fixing one aspect of issue #2702 ; not tackling the different destruction
rules yet.
2018-06-19 20:09:35 +02:00
Martin Kinkelin
29d609d63d
Refactoring: Introduce TargetABI::reverseExplicitParams()
2018-05-30 22:42:00 +02:00
Martin Kinkelin
92913d4c08
Store front-end D function type in IrFuncTy
...
As we do for IrFuncTyArg. We'll need access to the front-end linkage for
the Posix ABIs too in order to implement indirect-by-value passing of
non-PODs for `extern(C++)`.
2018-05-30 22:41:48 +02:00
Martin
d8f60d2f5c
Redirect access to object.d type declarations through gen/runtime
...
Not all type declarations yet (e.g., some TypeInfo subtypes are still
accessed directly), but those already wrapped as LazyType in the
gen/runtime.cpp module (with check and proper error msg in case object.d
doesn't contain a required declaration).
2018-04-04 19:59:10 +02:00
Martin
1b8a3b9d7d
Adapt to frontend injecting implicit 'return 0' for betterC main
...
This fixes lit-test codegen/betterC_typeinfo.d.
2018-02-25 01:25:37 +01:00
Martin
c6132508b1
Don't waste an alloca for the nested context argument
...
And so get rid of all loads too; just use the untouched pointer argument
directly.
2018-02-11 18:43:02 +00:00
Johan Engelen
1da088330d
Add basic clang-like support for XRay, through -fxray-instrument
and -fxray-instruction-threshold=
. ( #2465 )
...
Currently only fully working on Linux.
See https://llvm.org/docs/XRay.html
2018-01-23 22:06:05 +01:00
Johan Engelen
3ec79179b4
PGO: refactor such that there can be IR-based and frontend-based PGO.
2018-01-15 23:59:14 +01:00
Johan Engelen
f2d9ff3424
Add DMD-style function trace profiling. ( #2477 )
2018-01-14 22:22:59 +01:00