1*4c3eb207Smrg /* Sets of function names. 2*4c3eb207Smrg Copyright (C) 2019-2020 Free Software Foundation, Inc. 3*4c3eb207Smrg Contributed by David Malcolm <dmalcolm@redhat.com>. 4*4c3eb207Smrg 5*4c3eb207Smrg This file is part of GCC. 6*4c3eb207Smrg 7*4c3eb207Smrg GCC is free software; you can redistribute it and/or modify it 8*4c3eb207Smrg under the terms of the GNU General Public License as published by 9*4c3eb207Smrg the Free Software Foundation; either version 3, or (at your option) 10*4c3eb207Smrg any later version. 11*4c3eb207Smrg 12*4c3eb207Smrg GCC is distributed in the hope that it will be useful, but 13*4c3eb207Smrg WITHOUT ANY WARRANTY; without even the implied warranty of 14*4c3eb207Smrg MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15*4c3eb207Smrg General Public License for more details. 16*4c3eb207Smrg 17*4c3eb207Smrg You should have received a copy of the GNU General Public License 18*4c3eb207Smrg along with GCC; see the file COPYING3. If not see 19*4c3eb207Smrg <http://www.gnu.org/licenses/>. */ 20*4c3eb207Smrg 21*4c3eb207Smrg #ifndef GCC_ANALYZER_FUNCTION_SET_H 22*4c3eb207Smrg #define GCC_ANALYZER_FUNCTION_SET_H 23*4c3eb207Smrg 24*4c3eb207Smrg namespace ana { 25*4c3eb207Smrg 26*4c3eb207Smrg /* A set of names. */ 27*4c3eb207Smrg 28*4c3eb207Smrg class function_set 29*4c3eb207Smrg { 30*4c3eb207Smrg public: 31*4c3eb207Smrg /* Construct from a sorted array NAMES of size COUNT. */ function_set(const char * const * names,size_t count)32*4c3eb207Smrg function_set (const char * const *names, size_t count) 33*4c3eb207Smrg : m_names (names), m_count (count) 34*4c3eb207Smrg { 35*4c3eb207Smrg } 36*4c3eb207Smrg 37*4c3eb207Smrg bool contains_name_p (const char *name) const; 38*4c3eb207Smrg bool contains_decl_p (tree fndecl) const; 39*4c3eb207Smrg 40*4c3eb207Smrg void assert_sorted () const; 41*4c3eb207Smrg void assert_sane () const; 42*4c3eb207Smrg 43*4c3eb207Smrg private: 44*4c3eb207Smrg const char * const *m_names; // must be sorted 45*4c3eb207Smrg size_t m_count; 46*4c3eb207Smrg }; 47*4c3eb207Smrg 48*4c3eb207Smrg } // namespace ana 49*4c3eb207Smrg 50*4c3eb207Smrg #endif /* GCC_ANALYZER_FUNCTION_SET_H */ 51