]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Move producer_is_realview to producer.c
authorTom Tromey <tom@tromey.com>
Fri, 31 Jan 2025 18:28:48 +0000 (11:28 -0700)
committerTom Tromey <tom@tromey.com>
Thu, 20 Feb 2025 00:57:15 +0000 (17:57 -0700)
This moves the producer_is_realview to producer.c.

gdb/dwarf2/frame.c
gdb/producer.c
gdb/producer.h
gdb/symtab.c
gdb/symtab.h

index 17f3932a99020c2eb43fc6fb3fafdea89e602601..c11e45bc2bfea8687d86b0aafaac8cde52701178 100644 (file)
@@ -32,6 +32,7 @@
 #include "value.h"
 #include "record.h"
 #include "extract-store-integer.h"
+#include "producer.h"
 
 #include "complaints.h"
 #include "dwarf2/frame.h"
index 2ca701f5c7ca0bf819eb9de1b330bc40929c5b2f..ad3a3541e737091cc24e53134eb2225456bd27c1 100644 (file)
@@ -195,6 +195,30 @@ producer_is_clang (const char *producer, int *major, int *minor)
   return false;
 }
 
+/* See producer.h.  */
+
+bool
+producer_is_realview (const char *producer)
+{
+  static const char *const arm_idents[] = {
+    "ARM C Compiler, ADS",
+    "Thumb C Compiler, ADS",
+    "ARM C++ Compiler, ADS",
+    "Thumb C++ Compiler, ADS",
+    "ARM/Thumb C/C++ Compiler, RVCT",
+    "ARM C/C++ Compiler, RVCT"
+  };
+
+  if (producer == NULL)
+    return false;
+
+  for (const char *ident : arm_idents)
+    if (startswith (producer, ident))
+      return true;
+
+  return false;
+}
+
 #if defined GDB_SELF_TEST
 namespace selftests {
 namespace producer {
index 5cdb7ee3435b01d2bb020fece2dccac9c9de31c4..1f85bda1ed659e7497039e56f3e84feceeb15ef8 100644 (file)
@@ -50,4 +50,8 @@ extern bool producer_is_llvm (const char *producer);
    Sets MAJOR and MINOR accordingly, if not NULL.  */
 extern bool producer_is_clang (const char *producer, int *major, int *minor);
 
+/* Return true if the supplied producer string matches the ARM
+   RealView compiler (armcc).  */
+extern bool producer_is_realview (const char *producer);
+
 #endif /* GDB_PRODUCER_H */
index c8bcab7f8ffaa55cfe36f7b8eac6e8422559e4db..e6f6a99679034042b6014f4d9858683b1dda0e67 100644 (file)
@@ -6636,31 +6636,6 @@ main_language (void)
   return info->language_of_main;
 }
 
-/* Return 1 if the supplied producer string matches the ARM RealView
-   compiler (armcc).  */
-
-bool
-producer_is_realview (const char *producer)
-{
-  static const char *const arm_idents[] = {
-    "ARM C Compiler, ADS",
-    "Thumb C Compiler, ADS",
-    "ARM C++ Compiler, ADS",
-    "Thumb C++ Compiler, ADS",
-    "ARM/Thumb C/C++ Compiler, RVCT",
-    "ARM C/C++ Compiler, RVCT"
-  };
-
-  if (producer == NULL)
-    return false;
-
-  for (const char *ident : arm_idents)
-    if (startswith (producer, ident))
-      return true;
-
-  return false;
-}
-
 \f
 
 /* The next index to hand out in response to a registration request.  */
index cd9220c319e714786518f3d1feecf2d46addb9c2..7927380fca3f115fd43ecdaf683ecc07a0ff22e0 100644 (file)
@@ -2750,10 +2750,6 @@ extern struct block_symbol
                                     const char *name,
                                     const domain_search_flags domain);
 
-/* Return 1 if the supplied producer string matches the ARM RealView
-   compiler (armcc).  */
-bool producer_is_realview (const char *producer);
-
 extern unsigned int symtab_create_debug;
 
 /* Print a "symtab-create" debug statement.  */