Commit graph

210 commits

Author SHA1 Message Date
Martin Kinkelin
c280c3d31a Skip noreturn-typed fields for aggregate debuginfos
Fixes an ICE for a new test in dmd-testsuite's runnable/noreturn1.d.
2021-10-11 12:04:27 +02:00
Martin Kinkelin
9858cfb01c Simplify dmd/ldcbindings.{d,h} 2021-09-17 03:49:28 +02:00
Martin Kinkelin
369cfd13ce Adapt to TY enum class 2021-09-07 16:51:19 +02:00
Martin Kinkelin
1e00f63045 Adapt to upstream global.params.* -> target.* shuffling 2021-05-29 00:19:22 +02:00
Martin Kinkelin
c9b6c8a488 DI: Try switching module parent from CU to source file
As the CU parent seems to be reset to null in the final IR for some
reason, at least in some cases.
2021-05-21 05:27:18 +02:00
Martin Kinkelin
c50036e2ff DI: Don't use a forward declaration for base class inheritance info
Instead, resolve it to the actual derived type. I've noticed this
while investigating the tests/debuginfo/classtypes_gdb.d failure.
2021-05-21 05:27:18 +02:00
Martin Kinkelin
3ca48d7ac6 DI: Streamline file path components ('filename', 'directory') with clang
This resolves #3687.
2021-05-20 19:14:08 +02:00
Martin Kinkelin
f39371a32d Merge remote-tracking branch 'origin/master' into merge-2.096
Conflicts:
	gen/dibuilder.cpp
2021-04-10 15:57:21 +02:00
Martin Kinkelin
4db0954067 DI: Remove 2 more superfluous helpers 2021-04-06 04:00:40 +02:00
Martin Kinkelin
84832c937d DI: Fix up a few names 2021-04-06 04:00:40 +02:00
Martin Kinkelin
06d51e36f4 Remove superfluous DIBuilder::CreateCompositeTypeDescription 2021-04-06 01:35:46 +02:00
Martin Kinkelin
f8ef4cd863 DI: Emit enums with floating-point base type as typedefs
In the VS debugger, this means that the displayed type is the floating-
point one instead of the enum, but the enum value is displayed
correctly - it was previously re-interpreted as integer of matching
size.
2021-04-05 22:18:27 +02:00
Martin Kinkelin
eb4fcf26b1 DI: Emit delegate funcptr member as function *pointer*
This is at least required when debugging in VS on Windows.
2021-04-05 22:07:06 +02:00
Martin Kinkelin
3b7e00a768 Fix overzealous toBasetype'ing for debuginfo types
Resolves #3688.
2021-04-05 22:07:06 +02:00
Martin Kinkelin
44daef934a Add support for 'noreturn' type
It's apparently already in the AST, e.g., for core.internal.abort.
2021-02-28 18:57:45 +01:00
Martin Kinkelin
879c8ba465 Upgrade frontend & libs to v2.096.0-beta.1+ (dlang/dmd@0c2d8bd2ab) 2021-02-28 17:40:11 +01:00
Martin Kinkelin
d8bc064cfb Add support for LLVM 12 2021-02-12 07:54:41 +01:00
Martin Kinkelin
079858f3b2 Upgrade frontend & libs to early v2.095.0 (dlang/dmd@a4274b3c39) 2020-11-27 17:45:13 +01:00
Martin Kinkelin
3f716ff75e Refactoring: Introduce getIrType()
As *the* way to access the IrType associated with a Type via its `ctype`
field. Most importantly, it makes sure all access is redirected to the
*unqualified* type's `ctype`, which allows to get rid of the 'multiple
types' workaround for aggregates in DtoType(). Those were e.g. hit for
`shared struct SpinLock`, where the struct's type includes the `shared`
modifier...
2020-11-13 15:43:18 +01:00
Martin Kinkelin
246b783119
Win64 ABI: Pass/return delegates like slices - in (up to) 2 GP registers (#3609)
I expect this to be slightly more performant than the previous behavior,
where a delegate was treated like a corresponding struct, passed via
hidden pointer and returned via sret.

The primary motivation is a smooth preparation for PR #3578 - in order
to allow people to experiment with `-preview=in` without recompiling
druntime and Phobos, `in` slices and delegates must not be passed by-ref
with `-preview=in` (see dlang/dmd#11828). This would have required a
special case for delegates on Win64, which is IMO better handled this
way.
2020-11-11 21:04:05 +01:00
Martin Kinkelin
1d969cfcca Revise IRScope refactoring
LLVM already provides suited RAII helper types to restore the IRBuilder
state. [They sadly aren't movable, so I've had to wrap them in a
unique_ptr.]

While at it, also minimally revise debuginfo generation for functions.
2020-09-26 01:04:50 +02:00
Martin Kinkelin
9c42dfd9d0 LLVM 11: Adapt debuginfos wrt. static array and vector lengths
To overcome a new assertion, complaining that subranges with lower
bounds (always 0) aren't supported for CodeView.
2020-09-26 01:04:50 +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
49affcffb2
Fix issue #3496 - missing IR declarations for some fwd-declared functions (#3503)
Whenever we need an IR function, we'd better make sure it exists. Handle
that in DtoCallee(), by invoking DtoDeclareFunction() by default,
instead of the previous DtoResolveFunction() + DtoCallee() combo.
DtoResolveFunction() usually declares the function, but somehow doesn't
for abstract and body-less functions.
2020-07-13 21:49:41 +02:00
Martin Kinkelin
834f666ce5
Raise min LLVM version to 6.0 (#3493) 2020-07-13 20:42:50 +02:00
Martin Kinkelin
22bf484ccf
Don't emit any column infos for CodeView by default (like clang) & add -gcolumn-info (#3388)
Fixes #3102; see https://reviews.llvm.org/D23720.
2020-03-30 14:37:45 +02:00
Martin Kinkelin
7a6c536fe9 Merge remote-tracking branch 'origin/master' into merge-2090 2020-01-12 15:49:04 +01:00
Martin Kinkelin
34eae780c1 Fix debuginfo for enum of delegates 2020-01-11 03:44:12 +01:00
Martin Kinkelin
66f3267a82 Fix issue #3272 (debuginfo for enum of function pointers) 2020-01-11 03:44:11 +01: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
Fangrui Song
1743be4e8e dibuilder: fix createGlobalVariableExpression call for LLVM 10 (#3266) 2020-01-06 01:16:31 +01:00
Martin Kinkelin
4ac7f0554b Adapt to frontend refactorings 2019-12-22 16:29:45 +01:00
Roberto Rosmaninho
a1e44b2c81 Adapt to current LLVM 10 (#3257) 2019-12-16 22:23:43 +01:00
Martin Kinkelin
b741ee5715 Fix some ICEs in debuginfo generator wrt. opaque structs
Just enough to make new compilable/ice20044.d pass with `-g`.
2019-07-29 21:38:34 +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
d4858cfbcb
Fix issue #2937 (DI scope for types in static foreach in mixin templates) (#2939) 2018-12-16 13:41:18 +01:00
Nicholas Wilson
7a2a59874a fix compilation with recent LLVM (#2921) 2018-11-25 15:27:10 +01:00
Martin Kinkelin
0a6125352d
Debuginfo: Fix Win64 CodeView emission for some by-value params (#2908)
Don't declare some special params as DI references, but as DI locals
instead.

Also enable some Win32 checks in the args_cdb test, as they are working
now with LLVM 7.
2018-11-15 03:02:09 +01:00
Oleksandr Palamar
540f19c8a9 Debuginfo: Fix type for associative arrays and make -gc emit C++-imitating names (#2869) 2018-11-11 17:29:00 +01:00
Martin Kinkelin
71dfc4a637 Fix DIBuilder::EmitNamespace() for LLVM < 5.0 2018-11-03 23:22:19 +01:00
Martin Kinkelin
3e30bc691a Clang-format messy gen/dibuilder.cpp 2018-11-03 23:22:19 +01:00
Martin Kinkelin
be6c608a67 Refactor DIBuilder [NFC] 2018-11-03 23:22:19 +01:00
Martin Kinkelin
e0319eadf1 Add DI namespaces & use them for templates and C++ namespaces
And make sure the template instance names include the template
parameters, a regression after #2826.

Also prevent `TemplatedSymbol(...).TemplatedSymbol` names, just use
`TemplatedSymbol!(...)` instead.
2018-11-03 23:22:19 +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
Martin Kinkelin
5cdab742f7 Restore special DI name for extern(D) main function (D main) 2018-10-15 23:17:24 +02:00
Martin Kinkelin
518eafc2f9 Work around apparent LLVM CodeView bug wrt. nested functions 2018-10-15 23:17:24 +02:00
Martin Kinkelin
070d6dab0f Slightly refactor DIBuilder::EmitSubProgram() 2018-10-15 23:17:24 +02:00
Elie Morisse
dcad25d6fd Debug info: for extern(D) functions whose order of explicit arguments gets reversed, set the calling convention to DW_CC_D_dmd.
DW_CC_D_dmd is set to the first available value according to https://gcc.gnu.org/wiki/GNUDwarfExtensions. A GDB patch to handle this calling convention is being proposed.
2018-10-15 23:17:24 +02:00
Elie Morisse
23e73160cf Debug info: remove dead getDefinedModule() function. 2018-10-15 23:10:22 +02:00