Commit graph

812 commits

Author SHA1 Message Date
Nicholas Wilson
b5bc517249
Remove final use of getPointerElementType (#4143) 2022-09-13 15:16:46 +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
7d8638c27a
Make DtoIndexAggregate return a DLValue (#4112) 2022-09-04 21:34:31 +08:00
Nicholas Wilson
891d2f6f3c
Use typed gep in toir.cpp (#4100) 2022-09-03 09:30:56 +08:00
Nicholas Wilson
27d8343fe9
Use typed gep in toir.cpp (#4099) 2022-09-03 07:31:53 +08:00
Nicholas Wilson
f8aaca4bd3
Use typed gep in toir.cpp (#4088) 2022-09-02 19:20:49 +08:00
Nicholas Wilson
f2155c6dd9
Use type gep in initializeArrayLiteral (#4092) 2022-09-01 17:14:57 +08:00
Nicholas Wilson
34b830f6e7
Use typed gep in gen/toir.cpp (#4087) 2022-09-01 14:33:03 +08:00
Nicholas Wilson
ab6aa68d51
Used typed gep in toir visit TypeidExp (#4086) 2022-09-01 12:16:22 +08:00
Nicholas Wilson
d8d105fb1b
Use typed gep in DtoFinalizeScopeClass (#4081) 2022-08-31 11:14:23 +08:00
Nicholas Wilson
c9b902e670
Use typed GEP in DtoComplexSet (#4069) 2022-08-28 21:18:25 +08:00
Nicholas Wilson
311b1a5120
Used typed loads in gen/toir.cpp (#4058) 2022-08-28 16:10:03 +08:00
Nicholas Wilson
6daf215b3c
Remove getPointeeType from DtoSetArrayToNull (#4032) 2022-08-21 13:15:30 +08:00
Martin Kinkelin
5f1f3ecc3b Support 'elaborate' bit fields
By merging consecutive bit fields to a group for as long as they share
storage bytes. This means that the new groups can contain members of
diverging byte offsets, requiring extra care.
2022-08-14 22:23:18 +02:00
Martin Kinkelin
e8a41f475a [revise write_struct_literal(), mainly wrt. logging] 2022-08-06 14:33:45 +02:00
Martin Kinkelin
37894dd3d0 Refactor via new DBitFieldLValue type
This enables BinAssignExp with bit fields as left-hand-sides and
should generally be more robust.
2022-08-05 15:15:44 +02:00
Martin Kinkelin
8f4c3ff287 Support bit fields in AssignExp codegen 2022-08-04 22:12:14 +02:00
Martin Kinkelin
8e83842479 Support bit fields in write_struct_literal() 2022-08-04 20:12:57 +02:00
Martin Kinkelin
ac1a6c1722 [revert to lval semantics for DtoIndexAggregate] 2022-08-04 17:13:09 +02:00
Martin Kinkelin
aee1bedacb WIP: Bit fields 2022-08-01 20:25:39 +02:00
Martin Kinkelin
be9d5817a1 Adapt glue layer to renamed/changed Declaration::linkage 2022-05-06 19:42:18 +02:00
Martin Kinkelin
be20833b22 codegen: Support {Not,Logical,Identity,Cmp}Exp with non-bool type (for importC AST)
Fixing failing LDC assertions.
2022-04-30 23:46:47 +02:00
Martin Kinkelin
e4878f2169 codegen: Support EqualExp with non-bool type (for importC AST)
This fixes a bunch of importC dmd-testsuite tests.
2022-04-30 18:28:30 +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
5c9f1e5fd6 Handle new throw expressions 2022-02-19 19:28:08 +01:00
Martin Kinkelin
9d2d891f95 Adapt to new PASS enum class 2022-02-16 20:52:07 +01:00
Martin Kinkelin
4bd8dcd91b Adapt to new TOK and EXP enum classes 2022-02-16 20:52:07 +01:00
Martin Kinkelin
9e71551a61 [little optimizations] 2022-02-12 02:59:27 +01:00
Martin Kinkelin
1adf50fb17 Simplify union handling for non-const literals too 2022-02-12 02:50:42 +01:00
Martin Kinkelin
e8997308f9 Always specify a pointee type for llvm::ConstantExpr::getGetElementPtr()
As required by LLVM 13.
2021-10-11 19:21:37 +02:00
Martin Kinkelin
9858cfb01c Simplify dmd/ldcbindings.{d,h} 2021-09-17 03:49:28 +02:00
Martin Kinkelin
50fb6c8638 Add support for StringExp typed as pointer to static array
E.g., "456" typed as `char[4]*` encountered in dmd-testsuite's
runnable/test22070_2.c, and a similar constant case in
compilable/testcstuff1.c.
2021-09-10 21:56:45 +02:00
Martin Kinkelin
fab82436dd Use new druntime hooks _d_arraybounds_{slice,index} for more informative RangeErrors
Fixing dmd-testsuite's runnable/testbounds.d.
2021-09-09 17:37:38 +02:00
Martin Kinkelin
598b615e77 Fix switch case with const runtime variable assuming a *constant* initializer
As the initializer might just as well not be computable at compile-time.
Fixes such a case in `bug6985()` in dmd-testsuite's
`compilable/interpret3.d`.
2021-09-08 17:56:23 +02:00
Martin Kinkelin
e9f40d8a1a Adapt to removed custom (de)allocators 2021-09-07 16:51:19 +02:00
Martin Kinkelin
369cfd13ce Adapt to TY enum class 2021-09-07 16:51:19 +02:00
Martin Kinkelin
c6bce7e673
Fix #3778 - in-place construct <temporary>.ctor(args) (#3779) 2021-07-14 16:34:33 +00:00
Martin Kinkelin
c6096a7d27
Add __traits(initSymbol, <aggregate type>) (#3774)
A clean way of directly accessing struct and class init symbols. It
yields a `const(void[])` slice; the length reflecting the struct/class
instance size, and the pointer either pointing to the init symbol or
being null for zero-initialized structs.

Paves the way for resolving #3773 in druntime as well as accessing class
init symbols without `TypeInfo_Class.initializer()` indirection, and so
with -betterC as well.
2021-06-28 18:40:28 +02:00
Martin Kinkelin
2cbdf2d9a7 Fix bad assumption of FuncGenStates stack reflecting lexical parent/child relationships 2021-06-18 16:37:20 +02:00
Martin Kinkelin
724f3b8157 Support type noreturn in ternary expressions (CondExp)
Fixes runnable/noreturn1.d.
2021-06-01 15:28:27 +02:00
Martin Kinkelin
693e764787 Treat temporaries as rvalue expressions when ABI-rewriting function call arguments
Thus preventing bitcopies for IndirectByvalRewrite, passing the
temporary directly by ref instead.

This fixes druntime's stdcpp-memory test.
2021-04-04 18:46:11 +02: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
0c079fbdf9 Silence 2 C++ compiler warnings for builds with disabled assertions 2021-02-10 03:27:43 +01:00
Martin Kinkelin
261aad423a Fix C++ header regressions 2021-01-07 15:55:00 +01:00
Martin Kinkelin
b0834a5039 Little merge fix 2021-01-07 01:51:08 +01:00
Martin Kinkelin
fe5a1776ac Merge remote-tracking branch 'origin/master' into merge-2.095 2021-01-06 23:58:20 +01:00
Martin Kinkelin
0ae530f966 Merge upstream stable (dlang/dmd@ebd5e81dc9) 2021-01-06 23:34:36 +01:00
Martin Kinkelin
d3574b9835 DtoTypeInfoOf(): Make Loc param mandatory and move to 1st position 2020-12-13 15:15:37 +01:00
Martin Kinkelin
a9aafac862 Glue layer: Make all mutable Loc & params const 2020-12-13 15:01:19 +01:00