diff options
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 18 | ||||
-rw-r--r-- | libcpp/include/line-map.h | 16 |
2 files changed, 34 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index c32b157..65bfe26 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,21 @@ +2016-06-22 David Malcolm <dmalcolm@redhat.com> + + * include/line-map.h (fixit_hint::get_start_loc): New pure virtual + function. + (fixit_hint::maybe_get_end_loc): Likewise. + (fixit_insert::get_start_loc): New function, implementing + fixit_hint::get_start_loc. + (fixit_insert::maybe_get_end_loc): New function, implementing + fixit_hint::maybe_get_end_loc. + (fixit_remove::get_start_loc): New function, implementing + fixit_hint::get_start_loc. + (fixit_remove::maybe_get_end_loc): New function, implementing + fixit_hint::maybe_get_end_loc. + (fixit_replace::get_start_loc): New function, implementing + fixit_hint::get_start_loc. + (fixit_replace::maybe_get_end_loc): New function, implementing + fixit_hint::maybe_get_end_loc. + 2016-06-21 John David Anglin <danglin@gcc.gnu.org> * line-map.c (location_adhoc_data_update): Use int64_t instead of diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h index 292abce..416419c 100644 --- a/libcpp/include/line-map.h +++ b/libcpp/include/line-map.h @@ -1418,6 +1418,8 @@ public: virtual enum kind get_kind () const = 0; virtual bool affects_line_p (const char *file, int line) = 0; + virtual source_location get_start_loc () const = 0; + virtual bool maybe_get_end_loc (source_location *out) const = 0; }; class fixit_insert : public fixit_hint @@ -1428,6 +1430,8 @@ class fixit_insert : public fixit_hint ~fixit_insert (); enum kind get_kind () const { return INSERT; } bool affects_line_p (const char *file, int line); + source_location get_start_loc () const { return m_where; } + bool maybe_get_end_loc (source_location *) const { return false; } source_location get_location () const { return m_where; } const char *get_string () const { return m_bytes; } @@ -1447,6 +1451,12 @@ class fixit_remove : public fixit_hint enum kind get_kind () const { return REMOVE; } bool affects_line_p (const char *file, int line); + source_location get_start_loc () const { return m_src_range.m_start; } + bool maybe_get_end_loc (source_location *out) const + { + *out = m_src_range.m_finish; + return true; + } source_range get_range () const { return m_src_range; } @@ -1463,6 +1473,12 @@ class fixit_replace : public fixit_hint enum kind get_kind () const { return REPLACE; } bool affects_line_p (const char *file, int line); + source_location get_start_loc () const { return m_src_range.m_start; } + bool maybe_get_end_loc (source_location *out) const + { + *out = m_src_range.m_finish; + return true; + } source_range get_range () const { return m_src_range; } const char *get_string () const { return m_bytes; } |