public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6671] pack fields in line-map data structures
@ 2022-01-18 13:33 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-01-18 13:33 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4288b57affe34fbc60badf798eb0c19892e69980

commit r12-6671-g4288b57affe34fbc60badf798eb0c19892e69980
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Jan 18 12:17:19 2022 +0100

    pack fields in line-map data structures
    
    As pointed out by pahole.
    
    2022-01-18  Richard Biener  <rguenther@suse.de>
    
    libcpp/
            * include/line-map.h (class line_maps): Re-arrange fields
            to minimize padding.
            (class rich_location): Likewise.
            * line-map.cc (rich_location::rich_location): Adjust.

Diff:
---
 libcpp/include/line-map.h | 14 +++++++-------
 libcpp/line-map.cc        |  6 +++---
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h
index 3f39eb43866..80335721e03 100644
--- a/libcpp/include/line-map.h
+++ b/libcpp/include/line-map.h
@@ -792,6 +792,9 @@ public:
   /* If true, prints an include trace a la -H.  */
   bool trace_includes;
 
+  /* True if we've seen a #line or # 44 "file" directive.  */
+  bool seen_line_directive;
+
   /* Highest location_t "given out".  */
   location_t highest_location;
 
@@ -815,9 +818,6 @@ public:
      built-in tokens.  */
   location_t builtin_location;
 
-  /* True if we've seen a #line or # 44 "file" directive.  */
-  bool seen_line_directive;
-
   /* The default value of range_bits in ordinary line maps.  */
   unsigned int default_range_bits;
 
@@ -1816,16 +1816,16 @@ protected:
   int m_column_override;
 
   bool m_have_expanded_location;
+  bool m_seen_impossible_fixit;
+  bool m_fixits_cannot_be_auto_applied;
+  bool m_escape_on_output;
+
   expanded_location m_expanded_location;
 
   static const int MAX_STATIC_FIXIT_HINTS = 2;
   semi_embedded_vec <fixit_hint *, MAX_STATIC_FIXIT_HINTS> m_fixit_hints;
 
-  bool m_seen_impossible_fixit;
-  bool m_fixits_cannot_be_auto_applied;
-
   const diagnostic_path *m_path;
-  bool m_escape_on_output;
 };
 
 /* A struct for the result of range_label::get_text: a NUL-terminated buffer
diff --git a/libcpp/line-map.cc b/libcpp/line-map.cc
index b18cb67cb6b..62077c3857c 100644
--- a/libcpp/line-map.cc
+++ b/libcpp/line-map.cc
@@ -2083,11 +2083,11 @@ rich_location::rich_location (line_maps *set, location_t loc,
   m_ranges (),
   m_column_override (0),
   m_have_expanded_location (false),
-  m_fixit_hints (),
   m_seen_impossible_fixit (false),
   m_fixits_cannot_be_auto_applied (false),
-  m_path (NULL),
-  m_escape_on_output (false)
+  m_escape_on_output (false),
+  m_fixit_hints (),
+  m_path (NULL)
 {
   add_range (loc, SHOW_RANGE_WITH_CARET, label);
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-18 13:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18 13:33 [gcc r12-6671] pack fields in line-map data structures Richard Biener

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).