public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH 05/12] Placeholder libcpp fixups
Date: Wed, 22 Jun 2022 18:34:40 -0400	[thread overview]
Message-ID: <20220622223447.2462880-6-dmalcolm@redhat.com> (raw)
In-Reply-To: <20220622223447.2462880-1-dmalcolm@redhat.com>

Obviously this isn't quite ready for trunk yet.

libcpp/ChangeLog:
	* include/line-map.h (rich_location::maybe_add_fixit): Make
	public.
	* line-map.cc (linemap_add): Hack away assertion about LC_RENAME
	for now.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
 libcpp/include/line-map.h | 7 ++++---
 libcpp/line-map.cc        | 3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h
index 80335721e03..c27d8a6fdcd 100644
--- a/libcpp/include/line-map.h
+++ b/libcpp/include/line-map.h
@@ -1799,13 +1799,14 @@ class rich_location
   bool escape_on_output_p () const { return m_escape_on_output; }
   void set_escape_on_output (bool flag) { m_escape_on_output = flag; }
 
-private:
-  bool reject_impossible_fixit (location_t where);
-  void stop_supporting_fixits ();
   void maybe_add_fixit (location_t start,
 			location_t next_loc,
 			const char *new_content);
 
+private:
+  bool reject_impossible_fixit (location_t where);
+  void stop_supporting_fixits ();
+
 public:
   static const int STATICALLY_ALLOCATED_RANGES = 3;
 
diff --git a/libcpp/line-map.cc b/libcpp/line-map.cc
index 62077c3857c..82f27280ea7 100644
--- a/libcpp/line-map.cc
+++ b/libcpp/line-map.cc
@@ -496,10 +496,11 @@ linemap_add (line_maps *set, enum lc_reason reason,
   linemap_assert (!LINEMAPS_ORDINARY_USED (set)
 		  || (start_location
 		      >= MAP_START_LOCATION (LINEMAPS_LAST_ORDINARY_MAP (set))));
-
+#if 0
   /* When we enter the file for the first time reason cannot be
      LC_RENAME.  */
   linemap_assert (!(set->depth == 0 && reason == LC_RENAME));
+#endif
 
   /* If we are leaving the main file, return a NULL map.  */
   if (reason == LC_LEAVE
-- 
2.26.3


  parent reply	other threads:[~2022-06-22 22:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22 22:34 [PATCH 00/12] RFC: Replay of serialized diagnostics David Malcolm
2022-06-22 22:34 ` [PATCH 01/12] diagnostics: add ability to associate diagnostics with rules from coding standards David Malcolm
2022-06-23 19:04   ` David Malcolm
2022-06-22 22:34 ` [PATCH 02/12] diagnostics: associate rules with plugins in SARIF output David Malcolm
2022-06-22 22:34 ` [PATCH 03/12] Add more emit_diagnostic overloads David Malcolm
2022-06-23 16:39   ` Joseph Myers
2022-06-22 22:34 ` [PATCH 04/12] json: add json parsing support David Malcolm
2022-06-22 22:34 ` David Malcolm [this message]
2022-06-22 22:34 ` [PATCH 06/12] prune.exp: move multiline-handling to before other pruning David Malcolm
2022-06-22 22:34 ` [PATCH 07/12] Add deferred-locations.h/cc David Malcolm
2022-06-22 22:34 ` [PATCH 08/12] Add json-reader.h/cc David Malcolm
2022-06-22 22:34 ` [PATCH 09/12] Add json frontend David Malcolm
2022-06-22 22:34 ` [PATCH 10/12] Add sarif frontend David Malcolm
2022-06-22 22:34 ` [PATCH 11/12] Fixups to diagnostic-format-sarif.cc David Malcolm
2022-06-22 22:34 ` [PATCH 12/12] Work-in-progress of path remapping David Malcolm
2022-07-08 18:40 ` [PATCH 00/12] RFC: Replay of serialized diagnostics David Malcolm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220622223447.2462880-6-dmalcolm@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).