GCC Middle and Back End API Reference
diagnostic-context-rich-location.h
Go to the documentation of this file.
1/* A rich_location subclass that lazily populates a diagnostic_path
2 with diagnostic context events, but only if the path is actually to be
3 used.
4 Copyright (C) 2025 Free Software Foundation, Inc.
5 Contributed by Qing Zhao<qing.zhao@oracle.com>
6
7This file is part of GCC.
8
9GCC is free software; you can redistribute it and/or modify it under
10the terms of the GNU General Public License as published by the Free
11Software Foundation; either version 3, or (at your option) any later
12version.
13
14GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15WARRANTY; without even the implied warranty of MERCHANTABILITY or
16FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17for more details.
18
19You should have received a copy of the GNU General Public License
20along with GCC; see the file COPYING3. If not see
21<http://www.gnu.org/licenses/>. */
22
23#ifndef GCC_DIAGNOSTIC_CONTEXT_RICH_LOCATION_H
24#define GCC_DIAGNOSTIC_CONTEXT_RICH_LOCATION_H
25
26#include "gcc-rich-location.h"
29
31{
32public:
34 &logical_loc_mgr,
35 location_t location, gimple *stmt)
36 : diagnostics::paths::lazy_path (logical_loc_mgr),
37 m_logical_loc_mgr (logical_loc_mgr),
38 m_location (location), m_stmt (stmt)
39 {
40 }
41
42 std::unique_ptr<diagnostics::paths::path>
43 make_inner_path () const final override;
44 /* This method will be called on demand if a diagnostic is actually
45 emitted for this rich_location. */
46
48 location_t m_location;
50};
51
53{
54public:
55 rich_location_with_details (location_t location, gimple *stmt)
56 : gcc_rich_location (location),
58 {
60 }
61
62 rich_location_with_details (location_t location, tree exp ATTRIBUTE_UNUSED)
63 : gcc_rich_location (location),
65 {
66 }
67
68private:
71};
72
73#endif // GCC_DIAGNOSTIC_CONTEXT_RICH_LOCATION_H
Definition lazy-paths.h:39
lazy_path(const logical_locations::manager &logical_loc_mgr)
Definition lazy-paths.h:55
gcc_rich_location(location_t loc)
Definition gcc-rich-location.h:37
Definition diagnostic-context-rich-location.h:31
std::unique_ptr< diagnostics::paths::path > make_inner_path() const final override
Definition diagnostic-context-rich-location.cc:41
lazy_diagnostic_context_path(const tree_logical_location_manager &logical_loc_mgr, location_t location, gimple *stmt)
Definition diagnostic-context-rich-location.h:33
const tree_logical_location_manager & m_logical_loc_mgr
Definition diagnostic-context-rich-location.h:47
gimple * m_stmt
Definition diagnostic-context-rich-location.h:49
location_t m_location
Definition diagnostic-context-rich-location.h:48
const tree_logical_location_manager m_logical_loc_mgr
Definition diagnostic-context-rich-location.h:69
rich_location_with_details(location_t location, gimple *stmt)
Definition diagnostic-context-rich-location.h:55
lazy_diagnostic_context_path m_lazy_diagnostic_context_path
Definition diagnostic-context-rich-location.h:70
rich_location_with_details(location_t location, tree exp)
Definition diagnostic-context-rich-location.h:62
Definition tree-logical-location.h:32
union tree_node * tree
Definition coretypes.h:97
void final(rtx_insn *first, FILE *file, int optimize_p)
Definition final.cc:2009
double exp(double)
Definition coretypes.h:167
Definition gimple.h:221