]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/analyzer/known-function-manager.h
analyzer: add support for plugin-supplied known function behaviors
[thirdparty/gcc.git] / gcc / analyzer / known-function-manager.h
CommitLineData
07e30160
DM
1/* Support for plugin-supplied behaviors of known functions.
2 Copyright (C) 2022 Free Software Foundation, Inc.
3 Contributed by David Malcolm <dmalcolm@redhat.com>.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it
8under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 3, or (at your option)
10any later version.
11
12GCC is distributed in the hope that it will be useful, but
13WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#ifndef GCC_ANALYZER_KNOWN_FUNCTION_MANAGER_H
22#define GCC_ANALYZER_KNOWN_FUNCTION_MANAGER_H
23
24namespace ana {
25
26class known_function_manager : public log_user
27{
28public:
29 known_function_manager (logger *logger);
30 ~known_function_manager ();
31 void add (const char *name, known_function *kf);
32 const known_function *get_by_identifier (tree identifier);
33 const known_function *get_by_fndecl (tree fndecl);
34
35private:
36 DISABLE_COPY_AND_ASSIGN (known_function_manager);
37
38 /* Map from identifier to known_function instance.
39 Has ownership of the latter. */
40 hash_map<tree, known_function *> m_map_id_to_kf;
41};
42
43} // namespace ana
44
45#endif /* GCC_ANALYZER_KNOWN_FUNCTION_MANAGER_H */