From patchwork Sun Jun 7 14:40:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1304724 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=LgEXoQXM; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49fzZ95hKjz9sRR for ; Mon, 8 Jun 2020 00:40:15 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 76A1A386F83D; Sun, 7 Jun 2020 14:40:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76A1A386F83D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591540813; bh=4QLw8qPA/Nxj4wOcU/VVSIDc1rsjwOyw5cmgTAokLzA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=LgEXoQXMi58r2+SuQcj70WNAeEu6DbSj6tzCVR6E06nqj8XzVufMxXEbzgjpDcVlt FnWlxGC5ds4H2ZYBDI7VYPbX6Y8Q9jdGl1L8Uce6aFC6wq+dndcVMayE4++5oVYbYu vgEfJDWsspNGo57IExA9I1ang4JMfx+kk+tXt4X4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050::465:201]) by sourceware.org (Postfix) with ESMTPS id 24DC33851C34 for ; Sun, 7 Jun 2020 14:40:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 24DC33851C34 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 49fzZ00NShzQl1t; Sun, 7 Jun 2020 16:40:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id np5uyB30qyAh; Sun, 7 Jun 2020 16:40:04 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed] d: Merge upstream dmd 1831b24ff. Date: Sun, 7 Jun 2020 16:40:02 +0200 Message-Id: <20200607144002.20892-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: DD5BA175F X-Rspamd-Score: 0.29 / 15.00 / 15.00 X-Spam-Status: No, score=-17.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Buclaw via Gcc-patches From: Iain Buclaw Reply-To: Iain Buclaw Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, This patch merges the D front-end implementation with upstream dmd 1831b24ff. Converts some global and param fields from pointers to value types. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 1831b24ff. * d-lang.cc (d_init_options): Remove initialization of updated fields. (d_handle_option): Adjust for new field types. --- gcc/d/d-lang.cc | 10 ++-------- gcc/d/dmd/MERGE | 2 +- gcc/d/dmd/dmodule.c | 2 +- gcc/d/dmd/doc.c | 6 +++--- gcc/d/dmd/globals.h | 12 ++++++------ 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc index c4477cd90cb..41921934fdd 100644 --- a/gcc/d/d-lang.cc +++ b/gcc/d/d-lang.cc @@ -297,18 +297,12 @@ d_init_options (unsigned int, cl_decoded_option *decoded_options) /* Default extern(C++) mangling to C++14. */ global.params.cplusplus = CppStdRevisionCpp14; - global.params.linkswitches = new Strings (); - global.params.libfiles = new Strings (); - global.params.objfiles = new Strings (); - global.params.ddocfiles = new Strings (); - /* Warnings and deprecations are disabled by default. */ global.params.useDeprecated = DIAGNOSTICoff; global.params.warnings = DIAGNOSTICoff; global.params.imppath = new Strings (); global.params.fileImppath = new Strings (); - global.params.modFileAliasStrings = new Strings (); /* Extra GDC-specific options. */ d_option.fonly = NULL; @@ -474,7 +468,7 @@ d_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value, break; case OPT_fdoc_inc_: - global.params.ddocfiles->push (arg); + global.params.ddocfiles.push (arg); break; case OPT_fdruntime: @@ -502,7 +496,7 @@ d_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value, break; case OPT_fmodule_file_: - global.params.modFileAliasStrings->push (arg); + global.params.modFileAliasStrings.push (arg); if (!strchr (arg, '=')) error ("bad argument for %<-fmodule-file%>: %qs", arg); break; diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE index fa94d63e471..56a47bb61a3 100644 --- a/gcc/d/dmd/MERGE +++ b/gcc/d/dmd/MERGE @@ -1,4 +1,4 @@ -cef1e7991121a22f50e9966ea407805015922bc7 +1831b24fffe35fd0e332c194fdf8723ba3c930a5 The first line of this file holds the git revision number of the last merge done from the dlang/dmd repository. diff --git a/gcc/d/dmd/dmodule.c b/gcc/d/dmd/dmodule.c index 09e95472330..5bb544746ec 100644 --- a/gcc/d/dmd/dmodule.c +++ b/gcc/d/dmd/dmodule.c @@ -228,7 +228,7 @@ Module *Module::load(Loc loc, Identifiers *packages, Identifier *ident) { OutBuffer buf; OutBuffer dotmods; - Array *ms = global.params.modFileAliasStrings; + Array *ms = &global.params.modFileAliasStrings; const size_t msdim = ms ? ms->length : 0; for (size_t i = 0; i < packages->length; i++) diff --git a/gcc/d/dmd/doc.c b/gcc/d/dmd/doc.c index 7c21ab2efe7..e0bf94086d9 100644 --- a/gcc/d/dmd/doc.c +++ b/gcc/d/dmd/doc.c @@ -351,12 +351,12 @@ void gendocfile(Module *m) // Override with DDOCFILE specified in the sc.ini file char *p = getenv("DDOCFILE"); if (p) - global.params.ddocfiles->shift(p); + global.params.ddocfiles.shift(p); // Override with the ddoc macro files from the command line - for (size_t i = 0; i < global.params.ddocfiles->length; i++) + for (size_t i = 0; i < global.params.ddocfiles.length; i++) { - FileName f((*global.params.ddocfiles)[i]); + FileName f(global.params.ddocfiles[i]); File file(&f); readFile(m->loc, &file); // BUG: convert file contents to UTF-8 before use diff --git a/gcc/d/dmd/globals.h b/gcc/d/dmd/globals.h index 5b5aac3ab68..8a2ffdc2a56 100644 --- a/gcc/d/dmd/globals.h +++ b/gcc/d/dmd/globals.h @@ -145,7 +145,7 @@ struct Param CHECKACTION checkAction; // action to take when bounds, asserts or switch defaults are violated DString argv0; // program name - Array *modFileAliasStrings; // array of char*'s of -I module filename alias strings + Array modFileAliasStrings; // array of char*'s of -I module filename alias strings Array *imppath; // array of char*'s of where to look for import modules Array *fileImppath; // array of char*'s of where to look for file import modules DString objdir; // .obj/.lib file output directory @@ -155,7 +155,7 @@ struct Param bool doDocComments; // process embedded documentation comments DString docdir; // write documentation file to docdir directory DString docname; // write documentation file to docname - Array *ddocfiles; // macro include files for Ddoc + Array ddocfiles; // macro include files for Ddoc bool doHdrGeneration; // process embedded documentation comments DString hdrdir; // write 'header' file to docdir directory @@ -190,10 +190,10 @@ struct Param Strings runargs; // arguments for executable // Linker stuff - Array *objfiles; - Array *linkswitches; - Array *libfiles; - Array *dllfiles; + Array objfiles; + Array linkswitches; + Array libfiles; + Array dllfiles; DString deffile; DString resfile; DString exefile;