diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2022-04-13 13:34:49 +0100 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2022-04-13 15:02:57 +0100 |
commit | 31350635bfd90beea79b0e9220008da12bbb5d22 (patch) | |
tree | 2da5508cabb1f04bde53b7b61398bd21efec8839 /gcc/d/expr.cc | |
parent | ca145c6306f19272ac8756d88c4eba0bfdf01dfb (diff) | |
download | gcc-31350635bfd90beea79b0e9220008da12bbb5d22.zip gcc-31350635bfd90beea79b0e9220008da12bbb5d22.tar.gz gcc-31350635bfd90beea79b0e9220008da12bbb5d22.tar.bz2 |
d: Merge upstream dmd 4d1bfcf14, druntime 9ba9a6ae, phobos c0cc5e917.
D front-end changes:
- Import dmd v2.099.1.
- Added `@mustuse' attribute, implmenting DIP 1038.
- Added `.tupleof` property for static arrays
D runtime changes:
- Import druntime v2.099.1.
Phobos changes:
- Import phobos v2.099.1.
- Zlib bindings have been updated to 1.2.12.
gcc/d/ChangeLog:
* Make-lang.in (D_FRONTEND_OBJS): Add d/common-bitfields.o,
d/mustuse.o.
* d-ctfloat.cc (CTFloat::isIdentical): Don't treat NaN values as
identical.
* dmd/MERGE: Merge upstream dmd 4d1bfcf14.
* expr.cc (ExprVisitor::visit (VoidInitExp *)): New.
libphobos/ChangeLog:
* libdruntime/MERGE: Merge upstream druntime 9ba9a6ae.
* src/MERGE: Merge upstream phobos c0cc5e917.
Diffstat (limited to 'gcc/d/expr.cc')
-rw-r--r-- | gcc/d/expr.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc index 61a2b50..c683d9d 100644 --- a/gcc/d/expr.cc +++ b/gcc/d/expr.cc @@ -3006,6 +3006,16 @@ public: this->result_ = var; } + /* Build an uninitialized value, generated from void initializers. */ + + void visit (VoidInitExp *e) + { + /* The front-end only generates these for the initializer of globals. + Represent `void' as zeroes, regardless of the type's default value. */ + gcc_assert (this->constp_); + this->result_ = build_zero_cst (build_ctype (e->type)); + } + /* These expressions are mainly just a placeholders in the frontend. We shouldn't see them here. */ |