[pushed] diagnostics: convert diagnostic_ready_p to an inline function

Message ID 20231114191309.3709363-1-dmalcolm@redhat.com
State Accepted
Headers
Series [pushed] diagnostics: convert diagnostic_ready_p to an inline function |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

David Malcolm Nov. 14, 2023, 7:13 p.m. UTC
  No functional change intended.

Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r14-5457-gd0bfd6ba3ba77f.

gcc/ChangeLog:
	* diagnostic.h (diagnostic_ready_p): Convert from macro to inline
	function.
---
 gcc/diagnostic.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index 7ae7cebf02ed..2489855ae4a4 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -764,7 +764,11 @@  extern diagnostic_context *global_dc;
 
 /* Returns whether the diagnostic framework has been intialized already and is
    ready for use.  */
-#define diagnostic_ready_p() (global_dc->printer != NULL)
+inline bool
+diagnostic_ready_p ()
+{
+  return global_dc->printer != nullptr;
+}
 
 /* The number of errors that have been issued so far.  Ideally, these
    would take a diagnostic_context as an argument.  */