Commit graph

164 commits

Author SHA1 Message Date
Martin Kinkelin
b2d3c99b4f Fix missing bitcast for LLVM 15 2023-01-26 13:54:17 +01:00
Johan Engelen
7707754a03
LLVM15: Fix lit tests (opaque pointers) (#4253) 2022-11-12 00:07:23 +00:00
Nicholas Wilson
f4bbcdd07b
Fix issue 4130 (#4135) 2022-09-16 11:01:12 +08:00
Nicholas Wilson
4c7a714b4b
Remove getContainedType in DtoMemCpy (#4162) 2022-09-14 08:36:24 +08:00
Nicholas Wilson
0280ed8244
Remove getContainedType from DiBuilder::OpOffset (#4150) 2022-09-13 18:36:12 +08:00
Martin Kinkelin
78fdc135e4 Merge remote-tracking branch 'origin/master' into bitfields
Conflicts:
	gen/dvalue.cpp
	gen/llvmhelpers.cpp
	gen/structs.cpp
	gen/toir.cpp
	ir/irtypeaggr.cpp
2022-09-10 16:25:59 +02:00
Nicholas Wilson
827dde08b9
Use typed load in nested.cpp (#4108) 2022-09-04 10:35:06 +08:00
Nicholas Wilson
113fdc12e5
Use typed loads & geps in nested.cpp (#4097) 2022-09-03 05:33:14 +08:00
Nicholas Wilson
8514341354
Use typed loads & geps in nested.cpp (#4096) 2022-09-02 19:20:32 +08:00
Nicholas Wilson
84a77005e8
Use typed loads & geps in nested.cpp (#4094) 2022-09-02 18:09:00 +08:00
Nicholas Wilson
ad4f32259c
Use typed loads & geps in nested.cpp (#4078) 2022-09-02 10:16:33 +08:00
Nicholas Wilson
b0eab59b1b
Use typed load/gep in indexVThis (#4077) 2022-08-29 15:17:03 +08:00
Nicholas Wilson
51a4e9a28f
[NFC] Factor out indexing this in DtoNestedContext (#4076) 2022-08-29 12:04:38 +08:00
Nicholas Wilson
85b371e7bc
nested.cpp: Refactor loading the this pointer, use typed loads (#4052) 2022-08-28 10:12:05 +08:00
Nicholas Wilson
aea2033c19
Remove getPointeeType from DtoAlignedLoad (#4025) 2022-08-21 08:24:40 +08:00
Martin Kinkelin
d16fba3030 Rework packed-ness of IR aggregates
Base it on the IR alignments of the fields only.

Also fix the alignment of variables captured by ref (=> pointer
alignment, not the pointee's) and captured lazy params (=>
delegate alignment) in nested frames, something that cropped up with
a new assertion.
2022-08-14 14:54:27 +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
143d7b3171 Fix compile & link errors against LLVM 14 2022-03-30 13:51:18 +02:00
Nicholas Wilson
4349388563
Prepare for LLVM15: Headers, attributes (#3936)
`llvm::AttrBuilder` was changed to require an LLVMContext in its constructor, and can no longer be copied.

declare `DEBIG_TYPE` after includes for the GC2Stack pass as `llvm/Support/GenericDomTreeConstruction.h `(included from `llvm/IR/Dominators.h` `#define`s and `#undef`s it.

`llvm::DIBuilder::createExpression` now takes an `ArrayRef<uint64_t>` instead of `int64_t`. EmitLocalVariable has similarly changed
2022-03-11 16:38:49 +01:00
Martin Kinkelin
c100c15ae0
Fix capturing NRVO variables (#3902)
Fixes #3883 by capturing NRVO vars by ref - unless the nested context
is a heap closure.
2022-01-21 03:41:03 +01:00
Martin Kinkelin
9858cfb01c Simplify dmd/ldcbindings.{d,h} 2021-09-17 03:49:28 +02:00
Martin Kinkelin
7aed600440 Adapt to changed TypeDelegate constructor signature 2021-09-07 16:51:19 +02:00
Martin Kinkelin
56b2902473
Fix DtoCreateNestedContextType() for -linkonce-templates (#3766)
Fixes #3690.
2021-06-21 21:37:03 +02:00
Martin Kinkelin
fe5a1776ac Merge remote-tracking branch 'origin/master' into merge-2.095 2021-01-06 23:58:20 +01:00
Martin Kinkelin
a9aafac862 Glue layer: Make all mutable Loc & params const 2020-12-13 15:01:19 +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
1700e30c20
Traverse full chain of nested aggregates when resolving a nested variable (#3558)
Fixes #3556.
2020-10-10 19:34:06 +02:00
Martin Kinkelin
834f666ce5
Raise min LLVM version to 6.0 (#3493) 2020-07-13 20:42:50 +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
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
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
e52199469f Upgrade front-end & libs to v2.087.0-beta.1 2019-06-21 15:39:45 +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
d2c704b186
Fix context of some nested aggregates (#2969)
The context for instances of aggregates *not* nested in the current
function, but some parent. Fixes #2960.
2019-01-20 22:18:55 +01:00
Martin Kinkelin
61ed0563e8
Fix issue #2932 (allow speculative nested variables) (#2940) 2019-01-20 14:58:59 +01:00
Martin Kinkelin
32b6e49a65
Debuginfo: Fix nested variables (primarily for CodeView) (#2909)
We've been going back and forth between GEPs and complex DWARF
expressions based on the context pointer; this goes back to the latter,
as that fixes simple nested variables for CodeView with LLVM >= 6.

I guess it also helps for debuginfos of nested vars with enabled
optimizations.
2018-11-20 20:44:47 +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
5d8b581025 Rename ExplicitByvalRewrite to IndirectByvalRewrite 2018-05-27 00:57:26 +02: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
Martin
d7f68dbeb3 Merge branch 'master' into merge-2.075
Conflicts:
	runtime/druntime
2017-10-01 18:28:44 +02:00
kinke
5a9c7a17ae Fix storage of captured lazy parameters (depending on ABI) (#2330)
Fixes issue #2302.
2017-09-24 19:46:52 +02:00
Johan Engelen
0546bd406b Small reduction of scope. (#2335) 2017-09-20 00:40:02 +02:00
Martin
41aae46b91 Merge branch 'master' into merge-2.075
Conflicts:
	runtime/druntime
2017-09-12 19:44:53 +02:00
Martin
e4e7eaa0da Restore additional GEP deref for llvm.dbg.declare for LLVM < 5 2017-09-09 22:02:18 +02:00
Martin
8cc5ff6e79 Fix debuginfos for nested ref/out parameters (use llvm.dbg.declare)
llvm.dbg.value() apparently doesn't like GEP + deref, so use
llvm.dbg.declare() & GEP.
2017-09-09 22:02:14 +02:00
Martin
dc8eb23457 Debuginfos: Get rid of additional deref for the GEP of nested vars
This fixes things on Linux x64 with LLVM 5.0.
2017-09-09 22:01:23 +02:00
Martin
8a5984b7d3 Use llvm.dbg.value for all non-special refs & fix nested refs DI 2017-09-09 22:01:22 +02:00
Martin
2616261fd2 Revise all LDC-specific errors/warnings/deprecs and insert backticks
For DMD's new syntax highlighting. I grepped in all .{h,cpp} files only.
2017-08-03 22:53:49 +02:00
Martin
1fb269f940 Drop support for LLVM < 3.7 2017-07-16 02:18:00 +02:00