https://gcc.gnu.org/g:4e9ee99647ebb9a7cab1497d78477f75d1157ac5

commit r15-7659-g4e9ee99647ebb9a7cab1497d78477f75d1157ac5
Author: David Malcolm <dmalc...@redhat.com>
Date:   Thu Feb 20 17:10:54 2025 -0500

    diagnostics: add comments about global_dc
    
    No functional change intended.
    
    gcc/ChangeLog:
            * diagnostic-core.h: Add comments making clear that these
            functions implicitly use global_dc.
    
    Signed-off-by: David Malcolm <dmalc...@redhat.com>

Diff:
---
 gcc/diagnostic-core.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gcc/diagnostic-core.h b/gcc/diagnostic-core.h
index 8724fa2fd211..1e89c9fac5e6 100644
--- a/gcc/diagnostic-core.h
+++ b/gcc/diagnostic-core.h
@@ -1,6 +1,6 @@
 /* Declarations of core diagnostic functionality for code that does
    not need to deal with diagnostic contexts or diagnostic info
-   structures.
+   structures.  These functions implicitly use global_dc.
    Copyright (C) 1998-2025 Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -39,7 +39,7 @@ typedef enum
   DK_ANY,
 } diagnostic_t;
 
-/* RAII-style class for grouping related diagnostics.  */
+/* RAII-style class for grouping related diagnostics within global_dc.  */
 
 class auto_diagnostic_group
 {
@@ -48,7 +48,7 @@ class auto_diagnostic_group
   ~auto_diagnostic_group ();
 };
 
-/* RAII-style class for nesting hierarchical diagnostics.
+/* RAII-style class for nesting hierarchical diagnostics within global_dc.
    Any diagnostics emitted within the lifetime of this object
    will be treated as one level of nesting deeper than diagnostics
    emitted outside the lifetime of the object.  */
@@ -88,6 +88,9 @@ extern const char *progname;
 
 extern const char *trim_filename (const char *);
 
+/* Various functions for emitting diagnostics follow.
+   All of these implicitly use global_dc.  */
+
 /* If we haven't already defined a front-end-specific diagnostics
    style, use the generic one.  */
 #ifndef GCC_DIAG_STYLE

Reply via email to