* [committed] d: Remove Wtemplates warnings from the code generation pass
@ 2022-04-03 13:45 Iain Buclaw
0 siblings, 0 replies; only message in thread
From: Iain Buclaw @ 2022-04-03 13:45 UTC (permalink / raw)
To: gcc-patches
Hi,
This patch removes the `-Wtemplate' warnings from the code generation
pass of the D front-end.
These have been superceded by the upstream front-end's own internal
tracking of instantiations, exposed by `-ftransition=templates'.
Bootstrapped on x86_64-linux-gnu, and committed to mainline.
Regards,
Iain.
---
gcc/d/ChangeLog:
* d-lang.cc: Include dmd/template.h.
(d_parse_file): Call printTemplateStats when vtemplates is set.
* decl.cc (start_function): Remove OPT_Wtemplates warning.
* lang.opt (Wtemplates): Remove.
---
gcc/d/d-lang.cc | 4 ++++
gcc/d/decl.cc | 11 +----------
gcc/d/lang.opt | 4 ----
3 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc
index 4a7aa8983b7..69571628336 100644
--- a/gcc/d/d-lang.cc
+++ b/gcc/d/d-lang.cc
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "dmd/module.h"
#include "dmd/mtype.h"
#include "dmd/target.h"
+#include "dmd/template.h"
#include "opts.h"
#include "alias.h"
@@ -1306,6 +1307,9 @@ d_parse_file (void)
}
}
+ if (global.params.vtemplates)
+ printTemplateStats ();
+
/* Generate JSON files. */
if (global.params.doJsonGeneration)
{
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index ea8baef588c..86ea1761f4f 100644
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -1891,16 +1891,7 @@ start_function (FuncDeclaration *fd)
modules not in this compilation, or thunk aliases. */
TemplateInstance *ti = fd->isInstantiated ();
if (ti && ti->needsCodegen ())
- {
- /* Warn about templates instantiated in this compilation. */
- if (ti == fd->parent)
- {
- warning (OPT_Wtemplates, "%s %qs instantiated",
- ti->kind (), ti->toPrettyChars (false));
- }
-
- DECL_EXTERNAL (fndecl) = 0;
- }
+ DECL_EXTERNAL (fndecl) = 0;
else
{
Module *md = fd->getModule ();
diff --git a/gcc/d/lang.opt b/gcc/d/lang.opt
index 7859e1583c8..51e8e5c7e00 100644
--- a/gcc/d/lang.opt
+++ b/gcc/d/lang.opt
@@ -138,10 +138,6 @@ Wspeculative
D
Warn from speculative compiles such as __traits(compiles).
-Wtemplates
-D
-; Documented in C
-
Wunknown-pragmas
D Var(warn_unknown_pragmas) LangEnabledBy(D, Wextra)
; Documented in C
--
2.32.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-03 13:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03 13:45 [committed] d: Remove Wtemplates warnings from the code generation pass Iain Buclaw
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).