]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/analyzer/analyzer-language.h
Update copyright years.
[thirdparty/gcc.git] / gcc / analyzer / analyzer-language.h
1 /* Interface between analyzer and frontends.
2 Copyright (C) 2022-2023 Free Software Foundation, Inc.
3 Contributed by David Malcolm <dmalcolm@redhat.com>.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11
12 GCC is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
20
21 #ifndef GCC_ANALYZER_LANGUAGE_H
22 #define GCC_ANALYZER_LANGUAGE_H
23
24 #if ENABLE_ANALYZER
25
26 namespace ana {
27
28 /* Abstract base class for representing a specific TU
29 to the analyzer. */
30
31 class translation_unit
32 {
33 public:
34 /* Attempt to look up an value for identifier ID (e.g. in the headers that
35 have been seen). If it is defined and an integer (e.g. either as a
36 macro or enum), return the INTEGER_CST value, otherwise return NULL. */
37 virtual tree lookup_constant_by_id (tree id) const = 0;
38 };
39
40 /* Analyzer hook for frontends to call at the end of the TU. */
41
42 void on_finish_translation_unit (const translation_unit &tu);
43
44 } // namespace ana
45
46 #endif /* #if ENABLE_ANALYZER */
47
48 #endif /* GCC_ANALYZER_LANGUAGE_H */