Commit graph

29 commits

Author SHA1 Message Date
liushuyu
fc4d884d2d
Multiple changes ...
* Use getVoidPtrType helper
* Replace #define with constexpr
2024-03-26 14:48:36 -06:00
liushuyu
b8a96faf92 tree-wide: port LDC to LLVM 18 2024-03-26 14:45:35 -06:00
Martin Kinkelin
8c9400e7f1 [whitespace nits] 2023-08-12 16:44:30 +02:00
Ikey Doherty
a253748d2d
gen/ms-cxx-helper: Use new insertInto LLVM16 API
Instructions now use friend APIs to add themselves into a
BasicBlock, rather than a BasicBlock having an API to add
the instructions.

Signed-off-by: Ikey Doherty <ikey@serpentos.com>
2023-06-03 22:06:43 +01:00
Martin Kinkelin
538b4da7cd WinEH: Adapt to changed TypeInfo_Class names
Fixing #3520 and adding (revised) tests from #3517.
2021-09-08 01:23:57 +02:00
Martin Kinkelin
49caa9e8a0 Windows: Dllimport aggregate globals too
Init symbols, TypeInfos (classes only) & vtables - unless defined in a
root module. For explicitly exported aggregates, or, with
`-fvisibility=public`, all aggregates.
2021-04-29 17:22:12 +02:00
Martin Kinkelin
9f7a2b8e8e Use ClassDeclaration* as key for the TypeDescriptor cache in IRState
Instead of the ClassInfo global, which could theoretically be subject to
global variable replacement.
2020-11-13 06:05:28 +01:00
Martin Kinkelin
b7c6a2f101 Fix colliding WinEH TypeDescriptors for exceptions with the same TypeInfo_Class name
As reported in https://github.com/ldc-developers/ldc/issues/3501#issuecomment-661551187.

Previously, LDC would simply override an existing TypeDescriptor global
with an equivalent definition if assertions were disabled.

Use different equivalent TypeDescriptors in this exotic case now, by
using proper mangling. [The linker can presumably still fold duplicates
via ICF.]

Ideally, these descriptors would be truly unique, but WinEH depends on
string comparisons to check for matching catch clauses, and currently
depends on TypeInfo_Class.name to generate these strings at runtime when
throwing an exception, see
19731a92a9/src/ldc/eh_msvc.d (L192-L211).
So if those names were fully qualified (`cd->toPrettyChars(*true*)`
during ClassInfo generation), we'd be fine, but that'd obviously be a
breaking change and diverge from upstream.
2020-11-13 06:05:28 +01:00
Martin Kinkelin
1662406231 Upgrade front-end & libs to v2.088.0-beta.1 2019-08-25 00:36:15 +02:00
Martin Kinkelin
5e93ed0dfd Upgrade front-end & libs to v2.085.0-beta.1 2019-03-01 18:19:00 +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
5c24f60cf9
Raise min LLVM version to 3.9 (#2872) 2018-10-15 22:31:59 +02:00
Martin
9079e5cbed MSVC: Emit EH type descriptors as COMDATs 2018-04-10 22:13:00 +02:00
Martin
f38a7972a5 Split up getOrCreateGlobal() in {declare,define}Global()
Making it obvious which of the two operations is performed, reducing
call args and making sure a global isn't defined multiple times via
`defineGlobal()`.

The only [intended] functional change is in gen/trycatchfinally.cpp,
where I inserted a check for an existing __cpp_type_info_ptr global when
emitting a catch for C++ exceptions.
2018-04-10 22:13:00 +02:00
Martin
c6a9affc8f Support catching C++ exceptions for MSVC targets 2017-11-27 18:59:29 +01:00
Martin
f8f9269055 Fix linking error when using LLVM < 3.8 and enabled LDC assertions 2016-09-24 11:33:49 +02:00
David Nadlinger
e1033df6f0 gen/ms-cxx-helper: Gentle syntactical refactorings [nfc] 2016-09-03 14:38:10 +01:00
David Nadlinger
11572489d5 clang-format again some files touched in the next commits [nfc] 2016-09-03 00:52:00 +01:00
Martin
92e9ad85fc Some minor improvements for gen/trycatchfinally 2016-08-08 22:15:20 +02:00
Johan Engelen
ccea089f07 Remove explicit noinline call attribute inside SEH catch/cleanup pads.
See https://llvm.org/bugs/show_bug.cgi?id=25162
However LLVM inliner now knows not to inline functions inside cleanup pads and so this is no longer needed. I have tested with clang (trunk) and clang also no longer marks function calls explicitly with noinline: the inliner no longer tries to inline `alwaysinline` functions.

The change is necesary because setting `noinline` conflicts with functions that have `alwaysinline` attribute added (due to `pragma(inline, true)`).
2016-06-27 11:38:06 +02:00
Rainer Schuetze
08e4b13b23 RF_IgnoreMissingEntries renamed to RF_IgnoreMissingLocals in LLVM
added workaround to build with both symbols
2016-04-16 09:50:58 +02:00
Rainer Schuetze
03e7834a49 cleanup obsolete changes 2016-03-13 17:27:56 +01:00
Rainer Schuetze
2a86b7250a replace _d_skipCleanup var with callbacks _d_enter_cleanup, _d_leave_cleanup 2016-03-13 17:27:54 +01:00
Rainer Schuetze
858128a540 - add a global condition to cleanup pads to avoid them being inferred as "noreturn" by the optimizer
- do not inline functions into the cleanup funclets, it can break exception handling
- even if no var given, retrieve the caught exception to pass it to _d_eh_enter_catch
2016-03-13 17:27:53 +01:00
Rainer Schuetze
a8d5c46f66 remove setting NoBuiltin attribute, fixed in LLVM 2016-03-13 17:27:53 +01:00
Rainer Schuetze
4b2e7813fd avoid replacing library functions in funclet, it doesn't copy the "funclet" token 2016-03-13 17:27:52 +01:00
Rainer Schuetze
73ab5f4fee inside a cleanup block, convert "unreachable" to a branch to "cleanupret" 2016-03-13 17:27:51 +01:00
Rainer Schuetze
5dabf78c7b fix MSVC-EH again, disable inlining and tail call optimization for functions with EH 2016-03-13 17:27:51 +01:00
Rainer Schuetze
aad27069ca MSVC/x86 EH support using __CxxFrameHandler3 personality 2016-03-13 17:27:51 +01:00