aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog8
-rw-r--r--libcpp/include/line-map.h7
-rw-r--r--libcpp/line-map.c3
3 files changed, 17 insertions, 1 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index f8c539f..fc22011 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,11 @@
+2020-01-10 David Malcolm <dmalcolm@redhat.com>
+
+ * include/line-map.h (class diagnostic_path): New forward decl.
+ (rich_location::get_path): New accessor.
+ (rich_location::set_path): New function.
+ (rich_location::m_path): New field.
+ * line-map.c (rich_location::rich_location): Initialize m_path.
+
2020-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h
index 191bd42..dbbc137 100644
--- a/libcpp/include/line-map.h
+++ b/libcpp/include/line-map.h
@@ -1432,6 +1432,7 @@ semi_embedded_vec<T, NUM_EMBEDDED>::truncate (int len)
}
class fixit_hint;
+class diagnostic_path;
/* A "rich" source code location, for use when printing diagnostics.
A rich_location has one or more carets&ranges, where the carets
@@ -1727,6 +1728,10 @@ class rich_location
return !m_fixits_cannot_be_auto_applied;
}
+ /* An optional path through the code. */
+ const diagnostic_path *get_path () const { return m_path; }
+ void set_path (const diagnostic_path *path) { m_path = path; }
+
private:
bool reject_impossible_fixit (location_t where);
void stop_supporting_fixits ();
@@ -1751,6 +1756,8 @@ protected:
bool m_seen_impossible_fixit;
bool m_fixits_cannot_be_auto_applied;
+
+ const diagnostic_path *m_path;
};
/* A struct for the result of range_label::get_text: a NUL-terminated buffer
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 2e12bf7..8a390d0 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -2006,7 +2006,8 @@ rich_location::rich_location (line_maps *set, location_t loc,
m_have_expanded_location (false),
m_fixit_hints (),
m_seen_impossible_fixit (false),
- m_fixits_cannot_be_auto_applied (false)
+ m_fixits_cannot_be_auto_applied (false),
+ m_path (NULL)
{
add_range (loc, SHOW_RANGE_WITH_CARET, label);
}