From c0630840b7ea1dce49bfafb7ea9cbe97a1aac968 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Sun, 28 Feb 2021 15:56:58 +0100 Subject: [PATCH] Fix little C++ header regressions --- dmd/globals.h | 4 ++-- dmd/module.h | 2 +- dmd/mtype.h | 3 +++ gen/dcompute/druntime.cpp | 6 ++---- gen/mangling.cpp | 10 ++++------ gen/uda.cpp | 4 ++-- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/dmd/globals.h b/dmd/globals.h index d81dee57c2..5ef6df6873 100644 --- a/dmd/globals.h +++ b/dmd/globals.h @@ -196,8 +196,8 @@ struct Param bool inclusiveInContracts; // 'in' contracts of overridden methods must be a superset of parent contract bool vsafe; // use enhanced @safe checking bool ehnogc; // use @nogc exception handling - bool dtorFields; // destruct fields of partially constructed objects - // https://issues.dlang.org/show_bug.cgi?id=14246 + FeatureState dtorFields; // destruct fields of partially constructed objects + // https://issues.dlang.org/show_bug.cgi?id=14246 bool fieldwise; // do struct equality testing field-wise rather than by memcmp() bool rvalueRefParam; // allow rvalues to be arguments to ref parameters CppStdRevision cplusplus; // version of C++ name mangling to support diff --git a/dmd/module.h b/dmd/module.h index ab850dfd80..83125370e4 100644 --- a/dmd/module.h +++ b/dmd/module.h @@ -188,7 +188,7 @@ struct ModuleDeclaration { Loc loc; Identifier *id; - Identifiers *packages; // array of Identifier's representing packages + DArray packages; // array of Identifier's representing packages bool isdeprecated; // if it is a deprecated module Expression *msg; diff --git a/dmd/mtype.h b/dmd/mtype.h index 30f51ade85..1c530e902b 100644 --- a/dmd/mtype.h +++ b/dmd/mtype.h @@ -101,6 +101,8 @@ enum ENUMTY Tint128, Tuns128, Ttraits, + Tmixin, + Tnoreturn, TMAX }; typedef unsigned char TY; // ENUMTY @@ -186,6 +188,7 @@ public: static Type *tdstring; // immutable(dchar)[] static Type *terror; // for error recovery static Type *tnull; // for null type + static Type *tnoreturn; // for bottom type typeof(*null) static Type *tsize_t; // matches size_t alias static Type *tptrdiff_t; // matches ptrdiff_t alias diff --git a/gen/dcompute/druntime.cpp b/gen/dcompute/druntime.cpp index b00e330bdd..89ec9d3b07 100644 --- a/gen/dcompute/druntime.cpp +++ b/gen/dcompute/druntime.cpp @@ -25,12 +25,10 @@ bool isFromLDC_DCompute(Dsymbol *sym) { auto moduleDecl = mod->md; if (!moduleDecl) return false; - if (!moduleDecl->packages) - return false; - if (moduleDecl->packages->length != 1) + if (moduleDecl->packages.length != 1) return false; - if ((*moduleDecl->packages)[0] != Id::ldc) + if (moduleDecl->packages.ptr[0] != Id::ldc) return false; return moduleDecl->id == Id::dcompute; diff --git a/gen/mangling.cpp b/gen/mangling.cpp index 8c93930787..ce32e829eb 100644 --- a/gen/mangling.cpp +++ b/gen/mangling.cpp @@ -59,12 +59,10 @@ std::string hashSymbolName(llvm::StringRef name, Dsymbol *symb) { { auto moddecl = symb->getModule()->md; assert(moddecl); - if (auto packages = moddecl->packages) { - for (auto package : *packages) { - llvm::StringRef str = package->toChars(); - ret += ldc::to_string(str.size()); - ret += str; - } + for (size_t i = 0; i < moddecl->packages.length; ++i) { + llvm::StringRef str = moddecl->packages.ptr[i]->toChars(); + ret += ldc::to_string(str.size()); + ret += str; } llvm::StringRef str = moddecl->id->toChars(); ret += ldc::to_string(str.size()); diff --git a/gen/uda.cpp b/gen/uda.cpp index 5196d9d580..fef850f99c 100644 --- a/gen/uda.cpp +++ b/gen/uda.cpp @@ -41,8 +41,8 @@ bool isMagicModule(const ModuleDeclaration *moduleDecl, const Identifier *id) { return false; } - if (moduleDecl->packages->length != 1 || - (*moduleDecl->packages)[0] != Id::ldc) { + if (moduleDecl->packages.length != 1 || + moduleDecl->packages.ptr[0] != Id::ldc) { return false; } return true;