r279607 - Remove excessive padding from PTHStatData (NFC)

Mehdi Amini via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 23 21:26:58 PDT 2016


Author: mehdi_amini
Date: Tue Aug 23 23:26:57 2016
New Revision: 279607

URL: http://llvm.org/viewvc/llvm-project?rev=279607&view=rev
Log:
Remove excessive padding from PTHStatData (NFC)

This diff reorders the fields and removes excessive padding.
This fixes the following warning:

PTHLexer.cpp:629:7: warning: Excessive padding in 'class (anonymous namespace)::PTHStatData' (14 padding bytes, where 6 is optimal). Optimal fields order: Size, ModTime, UniqueID, HasData, IsDirectory, consider reordering the fields or adding explicit padding members.

Patch by: Alexander Shaposhnikov <shal1t712 at gmail.com>

Differential Revision: https://reviews.llvm.org/D23826

Modified:
    cfe/trunk/lib/Lex/PTHLexer.cpp

Modified: cfe/trunk/lib/Lex/PTHLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PTHLexer.cpp?rev=279607&r1=279606&r2=279607&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PTHLexer.cpp (original)
+++ cfe/trunk/lib/Lex/PTHLexer.cpp Tue Aug 23 23:26:57 2016
@@ -628,15 +628,15 @@ PTHLexer *PTHManager::CreateLexer(FileID
 namespace {
 class PTHStatData {
 public:
-  const bool HasData;
   uint64_t Size;
   time_t ModTime;
   llvm::sys::fs::UniqueID UniqueID;
+  const bool HasData;
   bool IsDirectory;
 
   PTHStatData(uint64_t Size, time_t ModTime, llvm::sys::fs::UniqueID UniqueID,
               bool IsDirectory)
-      : HasData(true), Size(Size), ModTime(ModTime), UniqueID(UniqueID),
+      : Size(Size), ModTime(ModTime), UniqueID(UniqueID), HasData(true),
         IsDirectory(IsDirectory) {}
 
   PTHStatData() : HasData(false) {}




More information about the cfe-commits mailing list