diff options
Diffstat (limited to 'libcpp/include/line-map.h')
-rw-r--r-- | libcpp/include/line-map.h | 16 |
1 files changed, 16 insertions, 0 deletions
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; } |