gcc: Make exec-tool.in handle missing Binutils more gracefully
[official-gcc.git] / gcc / tree-logical-location.h
blob8634f3a49c03f6109e50b61f42dea18bf039e713
1 /* Subclasses of logical_location with knowledge of "tree".
2 Copyright (C) 2022-2024 Free Software Foundation, Inc.
3 Contributed by David Malcolm <dmalcolm@redhat.com>.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
10 version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
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/>. */
21 #ifndef GCC_TREE_LOGICAL_LOCATION_H
22 #define GCC_TREE_LOGICAL_LOCATION_H
24 #include "logical-location.h"
26 /* Abstract subclass of logical_location, with knowledge of "tree", but
27 for no specific tree. */
29 class compiler_logical_location : public logical_location
31 protected:
32 static const char *get_short_name_for_tree (tree);
33 static const char *get_name_with_scope_for_tree (tree);
34 static const char *get_internal_name_for_tree (tree);
35 static enum logical_location_kind get_kind_for_tree (tree);
36 static label_text get_name_for_tree_for_path_output (tree);
39 /* Concrete subclass of logical_location, with reference to a specific
40 tree. */
42 class tree_logical_location : public compiler_logical_location
44 public:
45 tree_logical_location (tree decl) : m_decl (decl) {}
47 const char *get_short_name () const final override;
48 const char *get_name_with_scope () const final override;
49 const char *get_internal_name () const final override;
50 enum logical_location_kind get_kind () const final override;
51 label_text get_name_for_path_output () const final override;
53 private:
54 tree m_decl;
57 /* Concrete subclass of logical_location, with reference to
58 current_function_decl. */
60 class current_fndecl_logical_location : public compiler_logical_location
62 public:
63 const char *get_short_name () const final override;
64 const char *get_name_with_scope () const final override;
65 const char *get_internal_name () const final override;
66 enum logical_location_kind get_kind () const final override;
67 label_text get_name_for_path_output () const final override;
70 #endif /* GCC_TREE_LOGICAL_LOCATION_H. */