GCC Middle and Back End API Reference
tree-logical-location.h
Go to the documentation of this file.
1/* Subclass of logical_location_manager with knowledge of "tree".
2 Copyright (C) 2022-2025 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 under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 3, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for 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_TREE_LOGICAL_LOCATION_H
22#define GCC_TREE_LOGICAL_LOCATION_H
23
25
26/* A subclass of diagnostics::logical_locations::manager in which the
27 keys are "tree".
28 Note that there is no integration with the garbage collector,
29 and so key instances can only be short-lived. */
32{
33public:
36
37 void dump (FILE *out, int indent) const final override;
38
39 const char *get_short_name (key) const final override;
40 const char *get_name_with_scope (key) const final override;
41 const char *get_internal_name (key) const final override;
42 kind get_kind (key) const final override;
43 label_text get_name_for_path_output (key) const final override;
44 key get_parent (key) const final override;
45
47 {
48 return const_cast<tree> (k.cast_to<const_tree> ());
49 }
50 static key key_from_tree (tree node)
51 {
52 return key::from_ptr (node);
53 }
54};
55
56#endif /* GCC_TREE_LOGICAL_LOCATION_H. */
Definition logical-locations.h:101
T cast_to() const
Definition logical-locations.h:116
static key from_ptr(const void *ptr)
Definition logical-locations.h:105
Definition logical-locations.h:147
void DEBUG_FUNCTION dump() const
Definition logical-locations.h:152
Definition tree-logical-location.h:32
const char * get_short_name(key) const final override
Definition tree-logical-location.cc:52
kind get_kind(key) const final override
Definition tree-logical-location.cc:96
key get_parent(key) const final override
Definition tree-logical-location.cc:138
const char * get_name_with_scope(key) const final override
Definition tree-logical-location.cc:65
const char * get_internal_name(key) const final override
Definition tree-logical-location.cc:78
diagnostics::logical_locations::key key
Definition tree-logical-location.h:34
static tree tree_from_key(key k)
Definition tree-logical-location.h:46
diagnostics::logical_locations::kind kind
Definition tree-logical-location.h:35
label_text get_name_for_path_output(key) const final override
Definition tree-logical-location.cc:120
static key key_from_tree(tree node)
Definition tree-logical-location.h:50
const union tree_node * const_tree
Definition coretypes.h:98
union tree_node * tree
Definition coretypes.h:97
kind
Definition logical-locations.h:36