Debian Codegraph @

gcc/selftest-logical-location.cc

raw
1 /* Concrete subclass of logical_location for use in selftests.
2 Copyright (C) 2024-2025 Free Software Foundation, Inc.
3 Contributed by David Malcolm <[email protected]>.
4
5 This file is part of GCC.
6
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.
11
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.
16
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/>. */
20
21 #include "config.h"
22 #include "system.h"
23 #include "coretypes.h"
24 #include "selftest-logical-location.h"
25
26 #if CHECKING_P
27
28 namespace selftest {
29
30 /* class test_logical_location : public logical_location. */
31
32 test_logical_location::test_logical_location (enum logical_location_kind kind,
33 const char *name)
34 : m_kind (kind),
35 m_name (name)
36 {
37 }
38
39 const char *
40 test_logical_location::get_short_name () const
41 {
42 return m_name;
43 }
44
45 const char *
46 test_logical_location::get_name_with_scope () const
47 {
48 return m_name;
49 }
50
51 const char *
52 test_logical_location::get_internal_name () const
53 {
54 return m_name;
55 }
56
57 enum logical_location_kind
58 test_logical_location::get_kind () const
59 {
60 return m_kind;
61 }
62
63 label_text
64 test_logical_location::get_name_for_path_output () const
65 {
66 return label_text::borrow (m_name);
67 }
68
69 } // namespace selftest
70
71 #endif /* #if CHECKING_P */