Convert diagnostic_override_option_index from macro to inline function
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 5 May 2017 21:05:15 +0000 (21:05 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Fri, 5 May 2017 21:05:15 +0000 (21:05 +0000)
gcc/ChangeLog:
* diagnostic.h (diagnostic_override_option_index): Convert from
macro to inline function.

From-SVN: r247665

gcc/ChangeLog
gcc/diagnostic.h

index 56ec2794652dde6c64f3a7fc03f3a46fdfb6f66a..05f68fd7b490351b177e78216be835984ac42c48 100644 (file)
@@ -1,3 +1,8 @@
+2017-05-05  David Malcolm  <dmalcolm@redhat.com>
+
+       * diagnostic.h (diagnostic_override_option_index): Convert from
+       macro to inline function.
+
 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
 
        * diagnostic.c (last_module_changed_p): New function.
index 89d5a08583c4e26fd8c7eed34eb19f960db46190..c419b000f1615c613517179cf358f3129d9b16c4 100644 (file)
@@ -270,8 +270,12 @@ extern diagnostic_context *global_dc;
 
 /* Override the option index to be used for reporting a
    diagnostic.  */
-#define diagnostic_override_option_index(DI, OPTIDX) \
-    ((DI)->option_index = (OPTIDX))
+
+static inline void
+diagnostic_override_option_index (diagnostic_info *info, int optidx)
+{
+  info->option_index = optidx;
+}
 
 /* Diagnostic related functions.  */
 extern void diagnostic_initialize (diagnostic_context *, int);