Commit graph

2358 commits

Author SHA1 Message Date
Dennis
31bc99fd05
Merge pull request #20594 from dkorpel/sema3cache-general
Cache expressionSemantic() more consistently
2024-12-23 23:06:14 +01:00
Dennis
128f23b132
Replace scope(success) with scope(exit) (#20593) 2024-12-24 05:47:05 +08:00
Dennis Korpel
a804a41b7e Remove redundant exp.type checks 2024-12-23 14:18:02 +01:00
Dennis Korpel
60182ac9d7 Cache expressionSemantic() more consistently 2024-12-23 14:02:02 +01:00
Dennis Korpel
f0b8b68bb4 Rename isExp to isIsExp 2024-12-23 13:08:43 +01:00
Walter Bright
cdc7334e44
fix issue 20562 returning __rvalue should move-construct the NRVO value (#20585) 2024-12-23 13:08:50 +08:00
Nicholas Wilson
0338300cfc
[parse.d] factor out parsing of align(n). (#20588) 2024-12-23 09:00:20 +08:00
Walter Bright
32a6dfe3b0
rewrite non-POD copies (#20581) 2024-12-19 19:37:52 -08:00
Dennis
16c013abb9
Merge pull request #20580 from WalterBright/elstreq
optimize s=s where s is a struct
2024-12-19 21:40:08 +01:00
Walter Bright
2e9c280872 refactor cgelem.eleq() for readability 2024-12-18 17:00:21 -08:00
Walter Bright
bf3f49ac79 optimize s=s where s is a struct 2024-12-18 16:51:23 -08:00
Walter Bright
b7a3a1942c
fix Issue 20567 returning the result of a constructor should be NRVO (#20568) 2024-12-18 00:48:52 -08:00
Walter Bright
85fe931daa
fix github issue 20754 replace a?b:b with a,b when optimized (#20575) 2024-12-17 23:59:42 -08:00
Nicholas Wilson
76312ece85
Fix #19369 - use _getcwd on windows (#20561) 2024-12-18 09:59:28 +02:00
Royal Simpson Pinto
59883ab71e
feat(errors): implement verrors=simple to skip context printing (#20566)
Signed-off-by: royalpinto007 <royalpinto007@gmail.com>
2024-12-18 11:53:37 +08:00
Anca Maxim
0acada30cb
Extract dsymbol.addComment to dsymbolsem and turn it into a visitor (#17110)
Implemented a visitor in dsymbolsem.d to successfully relocate addComment functions from attrib.d.
2024-12-16 06:42:30 +08:00
The Dlang Bot
059b1ab407
Merge pull request #20559 from KitsunebiGames/objc
Objective-C Improvements

Signed-off-by: Dennis <dkorpel@users.noreply.github.com>
Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Merged-on-behalf-of: Dennis <dkorpel@users.noreply.github.com>
2024-12-15 22:48:39 +01:00
Walter Bright
a99a3894be
add __rvalue(expression) builtin (#17050) 2024-12-15 12:13:28 -08:00
Nicholas Wilson
13775eb2d1
Fix #18235 - Add offending member to "no size because of forward reference" error (#20557)
Co-authored-by: Nick Treleaven <ntrel002@gmail.com>
2024-12-15 18:23:36 +08:00
LunaTheFoxgirl
ad0c250c21 Fix wrongly placed delimiters in selectors 2024-12-14 19:51:03 +01:00
LunaTheFoxgirl
8a7108f8c9 Skip selector-gen for templates 2024-12-14 17:30:26 +01:00
LunaTheFoxgirl
5df19d9231 Trim whitespace 2024-12-14 17:00:32 +01:00
LunaTheFoxgirl
57d4a5c2cb Only try to auto-apply selectors to objc linkage functions 2024-12-14 16:23:13 +01:00
LunaTheFoxgirl
c2469afed8 opDollar is not present for paramlist. 2024-12-14 15:26:40 +01:00
LunaTheFoxgirl
ee281bf0d9 Use extractSlice instead. 2024-12-14 15:25:10 +01:00
LunaTheFoxgirl
f9a36823a0 Fix smaller syntax snafus 2024-12-14 15:19:01 +01:00
LunaTheFoxgirl
0e98192ce1 Only generate ending colon if there's parameters. 2024-12-14 15:13:46 +01:00
LunaTheFoxgirl
aac4c5f53c Add proper selector generation 2024-12-14 15:09:20 +01:00
Paul Backus
6a7bd45a8e Enable -preview=fieldwise by default
Introduced in PR #9331, this was changed from a normal bug fix to a
-preview switch because enabling it triggered a suprious "statement is
not reachable" warning in Phobos. That warning has since been removed
(in PR #15568).
2024-12-08 21:19:17 +01:00
Nick Treleaven
a7f6b04a0c
Don't allow short constructor with non-void expression except this() and super() (#17489) 2024-12-08 17:21:42 +08:00
Dennis Korpel
869ed9c6b9 Fix bugzilla 24891 - Two scope attributes emitted as part of .di generation 2024-12-05 15:03:54 +01:00
Dennis Korpel
4f2ae0e24a hdrgen.d: Deduplicate if/whilte/switch condition printing 2024-12-05 14:08:36 +01:00
Dennis Korpel
56eb579a45 Allow shortened method syntax for constructors 2024-12-04 12:16:44 +01:00
Nicholas Wilson
f28b1a0f0a
make deinitializeDMD reset onlyOneMain check (#17080) 2024-12-04 13:16:31 +02:00
Dennis
b076573644
Merge pull request #17102 from yanok/lambda-mangle2
Make lambda symbols stable post a3abf1187e
2024-12-04 11:46:48 +01:00
Ilya Yanok
451c1596be Make lambda symbols stable post a3abf1187e
Commit a3abf1187e fixes some cases of
lambdas having unstable symbol names between compilation units by
using `generateIdWithLoc` to generate stable lambda names, however since
LOC doesn't uniquely identify a lambda instance (because templates,
mixins, static foreach and foreach unrolling), `generateIdWithLoc`
adds a counter, so there is still some instability going on.

`generateIdWithLoc` makes the name uniq per file+loc, by adding adding a
numeric suffix. But the order of instantiations might be different
across compilation units, so with this counting scheme we are back to
unstable names, so one module might have

`t!0.__lambda_LOC` and
`t!1.__lambda_LOC_1`

while another one has

`t!1.__lambda_LOC`

This is not a critical problem, but at very least the code gets
duplicated for no reason. I also have an example where it leads to
linking error, but since it's not a small one and fails to minimize
further, I suspect it's a result of interaction with some other bug.

The thing is we don't even need uniqueness for those lambdas inside
templates/mixins: their final names will have the instantiation prefix anyway.
But we can't also just disable this uniqueness check completely: `static
foreach` as well as unrollings of the normal `foreach` with lambdas in
the loop body will have several copies of a single lambda with the same
file+loc. So here we do want to keep making them unique. Fortunately, I
don't think a `foreach` could be iterated in different order in
different compilation units, so hopefully if we limit the counting to
this case only, it won't make symbols unstable.

To implement this idea, I've added an extra `parent` argument to
`generateIdWithLoc`: it works like using `parent ~ prefix` prefix, but
without adding `parent` to the final output.

Fixes since last review:
 1. Changed `fromStringz` to `toDString`
 2. Added a test to showcase the problem
2024-12-04 11:04:26 +01:00
Dennis Korpel
bfae7828a9 Cache TypeIdExp::semantic 2024-12-03 23:10:11 +01:00
Walter Bright
d8c0e79bfb
made small improvement to fix 24884 (#17101) 2024-12-02 16:23:34 +08:00
Emmanuel Ferdman
82a5d2a7c4
Fix typo in DMD README (#17100)
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2024-12-01 17:54:52 +08:00
Dennis Korpel
1f0c1c22e9 Remove C++ bitflags / _padding fields from SCOPE 2024-12-01 00:56:02 +01:00
Dennis
f7530ca9e4
Merge pull request #17084 from andreirusanescu/_d_newThrowable_to_lowering
Moved _d_newThrowable in the semantic phase to lowering
2024-11-30 16:33:54 +01:00
Dennis Korpel
74c40e9be0 Merge branch 'stable' into master 2024-11-29 12:46:40 +01:00
Richard (Rikki) Andrew Cattermole
6567f6f4a4 Fix bugzilla issue 24882 - COM class is allocated using GC not malloc 2024-11-29 08:37:07 +01:00
Dennis Korpel
1a44210ffb Fix bugzilla 24883 - Speculative template overload error escapes with -preview=rvaluerefparam 2024-11-29 08:36:13 +01:00
Dennis Korpel
8b1eb80d25 Fix bugzilla 24884 - backend generates wrong 32-bit code after inlining math with double[4] 2024-11-29 08:35:16 +01:00
Walter Bright
347c883586
Implement Safer D (#17044) 2024-11-27 22:59:29 -08:00
Andrei Rusanescu
7c95c88896 Moved _d_newThrowable in the semantic phase to lowering
Pr #14837 added templated lowering for _d_newclass and
lowering field to NewExp. Pr #13494 added templated lowering
for _d_newThroable. This Pr merges those two.

In expressionsem.d, instead of giving up the expression node and
keeping just the id.expressionSemantic of it, the result is the
whole node with all its previous fields and a new one, lowering,
that is set to the previously returned value.

In e2ir.d, for a newExpression, the expression is already created
in the semantic phase with all the arguments needed, so the visitor
will not recreate it, therefore the assert at line 1153 is no longer
necessary.

Signed-off-by: Andrei Rusanescu <andreirusanescu154@gmail.com>
2024-11-27 06:09:07 -05:00
Dennis
a3abf1187e
Fix 23722 - Lambdas are mangled incorrectly when using multiple compi… (#15343)
* Fix 23722 - Lambdas are mangled incorrectly when using multiple compilation units, resulting in incorrect code

* Update test cases
2024-11-27 12:03:16 +01:00
Dennis Korpel
519d388498 Fix bugzilla 24845 - Compiler error when trying to assign to an AA value of an enum instance 2024-11-25 22:54:52 +01:00
The Dlang Bot
949cb11c41
Merge pull request #17082 from ArthaTi/fix-24871
Fix bugzilla issue 24871 - DDoc strips indent in triple slash comments

Signed-off-by: Dennis <dkorpel@users.noreply.github.com>
Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2024-11-25 09:35:14 +01:00