r275095 - [NFC] Reorder fields of VersionTuple to reduce size

Erik Pilkington via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 11 13:00:48 PDT 2016


Author: epilk
Date: Mon Jul 11 15:00:48 2016
New Revision: 275095

URL: http://llvm.org/viewvc/llvm-project?rev=275095&view=rev
Log:
[NFC] Reorder fields of VersionTuple to reduce size

Differential revision: http://reviews.llvm.org/D19934

Modified:
    cfe/trunk/include/clang/Basic/VersionTuple.h

Modified: cfe/trunk/include/clang/Basic/VersionTuple.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/VersionTuple.h?rev=275095&r1=275094&r2=275095&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/VersionTuple.h (original)
+++ cfe/trunk/include/clang/Basic/VersionTuple.h Mon Jul 11 15:00:48 2016
@@ -25,39 +25,44 @@ namespace clang {
 /// \brief Represents a version number in the form major[.minor[.subminor[.build]]].
 class VersionTuple {
   unsigned Major : 31;
+
+  unsigned UsesUnderscores : 1;
+
   unsigned Minor : 31;
-  unsigned Subminor : 31;
-  unsigned Build : 31;
   unsigned HasMinor : 1;
+
+  unsigned Subminor : 31;
   unsigned HasSubminor : 1;
+
+  unsigned Build : 31;
   unsigned HasBuild : 1;
-  unsigned UsesUnderscores : 1;
 
 public:
   VersionTuple()
-      : Major(0), Minor(0), Subminor(0), Build(0), HasMinor(false),
-        HasSubminor(false), HasBuild(false), UsesUnderscores(false) {}
+      : Major(0), UsesUnderscores(false), Minor(0), HasMinor(false),
+        Subminor(0), HasSubminor(false), Build(0), HasBuild(false) {}
 
   explicit VersionTuple(unsigned Major)
-      : Major(Major), Minor(0), Subminor(0), Build(0), HasMinor(false),
-        HasSubminor(false), HasBuild(false), UsesUnderscores(false) {}
+      : Major(Major), UsesUnderscores(false), Minor(0), HasMinor(false),
+        Subminor(0), HasSubminor(false), Build(0), HasBuild(false) {}
 
   explicit VersionTuple(unsigned Major, unsigned Minor,
                         bool UsesUnderscores = false)
-      : Major(Major), Minor(Minor), Subminor(0), Build(0), HasMinor(true),
-        HasSubminor(false), HasBuild(false), UsesUnderscores(UsesUnderscores) {}
+      : Major(Major), UsesUnderscores(UsesUnderscores), Minor(Minor),
+        HasMinor(true), Subminor(0), HasSubminor(false), Build(0),
+        HasBuild(false) {}
 
   explicit VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor,
                         bool UsesUnderscores = false)
-      : Major(Major), Minor(Minor), Subminor(Subminor), Build(0),
-        HasMinor(true), HasSubminor(true), HasBuild(false),
-        UsesUnderscores(UsesUnderscores) {}
+      : Major(Major), UsesUnderscores(UsesUnderscores), Minor(Minor),
+        HasMinor(true), Subminor(Subminor), HasSubminor(true), Build(0),
+        HasBuild(false) {}
 
   explicit VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor,
                         unsigned Build, bool UsesUnderscores = false)
-      : Major(Major), Minor(Minor), Subminor(Subminor), Build(Build),
-        HasMinor(true), HasSubminor(true), HasBuild(true),
-        UsesUnderscores(UsesUnderscores) {}
+      : Major(Major), UsesUnderscores(UsesUnderscores), Minor(Minor),
+        HasMinor(true), Subminor(Subminor), HasSubminor(true), Build(Build),
+        HasBuild(true) {}
 
   /// \brief Determine whether this version information is empty
   /// (e.g., all version components are zero).




More information about the cfe-commits mailing list