1 /* Producer string parsers for GDB.
3 Copyright (C) 2012-2024 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 /* Check for GCC >= 4.x according to the symtab->producer string. Return minor
24 version (x) of 4.x in such case. If it is not GCC or it is GCC older than
25 4.x return -1. If it is GCC 5.x or higher return INT_MAX. */
26 extern int producer_is_gcc_ge_4 (const char *producer
);
28 /* Returns nonzero if the given PRODUCER string is GCC and sets the MAJOR
29 and MINOR versions when not NULL. Returns zero if the given PRODUCER
30 is NULL or it isn't GCC. */
31 extern int producer_is_gcc (const char *producer
, int *major
, int *minor
);
33 /* Returns nonzero if the given PRODUCER string is GAS and sets the MAJOR
34 and MINOR versions when not NULL. Returns zero if the given PRODUCER
35 is NULL or it isn't GAS. */
36 bool producer_is_gas (const char *producer
, int *major
, int *minor
);
38 /* Check for Intel compilers >= 19.0. */
39 extern bool producer_is_icc_ge_19 (const char *producer
);
41 /* Returns true if the given PRODUCER string is Intel or false
42 otherwise. Sets the MAJOR and MINOR versions when not NULL. */
43 extern bool producer_is_icc (const char *producer
, int *major
, int *minor
);
45 /* Returns true if the given PRODUCER string is LLVM (clang/flang) or
47 extern bool producer_is_llvm (const char *producer
);
49 /* Returns true if the given PRODUCER string is clang, false otherwise.
50 Sets MAJOR and MINOR accordingly, if not NULL. */
51 extern bool producer_is_clang (const char *producer
, int *major
, int *minor
);