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
24#include "logical-location.h"
25
26/* A subclass of logical_location_manager in which the keys are
27 "tree".
28 Note that there is no integration with the garbage collector,
29 and so logical_location instances can only be short-lived. */
31{
32public:
33 const char *get_short_name (key) const final override;
34 const char *get_name_with_scope (key) const final override;
35 const char *get_internal_name (key) const final override;
36 enum logical_location_kind get_kind (key) const final override;
37 label_text get_name_for_path_output (key) const final override;
38 key get_parent (key) const final override;
39
41 {
42 return const_cast<tree> (k.cast_to<const_tree> ());
43 }
45 {
46 return logical_location::from_ptr (node);
47 }
48};
49
50#endif /* GCC_TREE_LOGICAL_LOCATION_H. */
Definition logical-location.h:99
static key from_ptr(const void *ptr)
Definition logical-location.h:103
T cast_to() const
Definition logical-location.h:114
Definition logical-location.h:91
Definition tree-logical-location.h:31
const char * get_short_name(key) const final override
Definition tree-logical-location.cc:41
const char * get_name_with_scope(key) const final override
Definition tree-logical-location.cc:54
const char * get_internal_name(key) const final override
Definition tree-logical-location.cc:67
key get_parent(key) const final override
Definition tree-logical-location.cc:127
enum logical_location_kind get_kind(key) const final override
Definition tree-logical-location.cc:85
label_text get_name_for_path_output(key) const final override
Definition tree-logical-location.cc:109
static tree tree_from_key(logical_location k)
Definition tree-logical-location.h:40
static logical_location key_from_tree(tree node)
Definition tree-logical-location.h:44
const union tree_node * const_tree
Definition coretypes.h:98
union tree_node * tree
Definition coretypes.h:97
logical_location_manager::key logical_location
Definition logical-location.h:173
logical_location_kind
Definition logical-location.h:33