[llvm] r255554 - Reordering fields to reduce padding in LLVM. NFC

Ben Craig via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 13:57:05 PST 2015


Author: bcraig
Date: Mon Dec 14 15:57:05 2015
New Revision: 255554

URL: http://llvm.org/viewvc/llvm-project?rev=255554&view=rev
Log:
Reordering fields to reduce padding in LLVM.  NFC

Modified:
    llvm/trunk/lib/Support/TargetParser.cpp
    llvm/trunk/utils/PerfectShuffle/PerfectShuffle.cpp
    llvm/trunk/utils/unittest/googletest/src/gtest-internal-inl.h

Modified: llvm/trunk/lib/Support/TargetParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/TargetParser.cpp?rev=255554&r1=255553&r2=255554&view=diff
==============================================================================
--- llvm/trunk/lib/Support/TargetParser.cpp (original)
+++ llvm/trunk/lib/Support/TargetParser.cpp Mon Dec 14 15:57:05 2015
@@ -54,14 +54,14 @@ static const struct {
 static const struct {
   const char *NameCStr;
   size_t NameLength;
-  ARM::ArchKind ID;
   const char *CPUAttrCStr;
   size_t CPUAttrLength;
   const char *SubArchCStr;
   size_t SubArchLength;
-  ARMBuildAttrs::CPUArch ArchAttr; // Arch ID in build attributes.
   unsigned DefaultFPU;
   unsigned ArchBaseExtensions;
+  ARM::ArchKind ID;
+  ARMBuildAttrs::CPUArch ArchAttr; // Arch ID in build attributes.
 
   StringRef getName() const { return StringRef(NameCStr, NameLength); }
 
@@ -72,8 +72,8 @@ static const struct {
   StringRef getSubArch() const { return StringRef(SubArchCStr, SubArchLength); }
 } ARCHNames[] = {
 #define ARM_ARCH(NAME, ID, CPU_ATTR, SUB_ARCH, ARCH_ATTR, ARCH_FPU, ARCH_BASE_EXT)       \
-  {NAME, sizeof(NAME) - 1, ID, CPU_ATTR, sizeof(CPU_ATTR) - 1, SUB_ARCH,       \
-   sizeof(SUB_ARCH) - 1, ARCH_ATTR, ARCH_FPU, ARCH_BASE_EXT},
+  {NAME, sizeof(NAME) - 1, CPU_ATTR, sizeof(CPU_ATTR) - 1, SUB_ARCH,       \
+   sizeof(SUB_ARCH) - 1, ARCH_FPU, ARCH_BASE_EXT, ID, ARCH_ATTR},
 #include "llvm/Support/ARMTargetParser.def"
 };
 

Modified: llvm/trunk/utils/PerfectShuffle/PerfectShuffle.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/PerfectShuffle/PerfectShuffle.cpp?rev=255554&r1=255553&r2=255554&view=diff
==============================================================================
--- llvm/trunk/utils/PerfectShuffle/PerfectShuffle.cpp (original)
+++ llvm/trunk/utils/PerfectShuffle/PerfectShuffle.cpp Mon Dec 14 15:57:05 2015
@@ -85,8 +85,8 @@ static void PrintMask(unsigned i, std::o
 
 /// ShuffleVal - This represents a shufflevector operation.
 struct ShuffleVal {
-  unsigned Cost;  // Number of instrs used to generate this value.
   Operator *Op;   // The Operation used to generate this value.
+  unsigned Cost;  // Number of instrs used to generate this value.
   unsigned short Arg0, Arg1;  // Input operands for this value.
 
   ShuffleVal() : Cost(1000000) {}
@@ -102,14 +102,14 @@ static std::vector<Operator*> TheOperato
 
 /// Operator - This is a vector operation that is available for use.
 struct Operator {
+  const char *Name;
   unsigned short ShuffleMask;
   unsigned short OpNum;
-  const char *Name;
   unsigned Cost;
 
   Operator(unsigned short shufflemask, const char *name, unsigned opnum,
            unsigned cost = 1)
-    : ShuffleMask(shufflemask), OpNum(opnum), Name(name), Cost(cost) {
+    :  Name(name), ShuffleMask(shufflemask), OpNum(opnum),Cost(cost) {
     TheOperators.push_back(this);
   }
   ~Operator() {

Modified: llvm/trunk/utils/unittest/googletest/src/gtest-internal-inl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/unittest/googletest/src/gtest-internal-inl.h?rev=255554&r1=255553&r2=255554&view=diff
==============================================================================
--- llvm/trunk/utils/unittest/googletest/src/gtest-internal-inl.h (original)
+++ llvm/trunk/utils/unittest/googletest/src/gtest-internal-inl.h Mon Dec 14 15:57:05 2015
@@ -151,63 +151,67 @@ class GTestFlagSaver {
  public:
   // The c'tor.
   GTestFlagSaver() {
-    also_run_disabled_tests_ = GTEST_FLAG(also_run_disabled_tests);
-    break_on_failure_ = GTEST_FLAG(break_on_failure);
-    catch_exceptions_ = GTEST_FLAG(catch_exceptions);
     color_ = GTEST_FLAG(color);
     death_test_style_ = GTEST_FLAG(death_test_style);
-    death_test_use_fork_ = GTEST_FLAG(death_test_use_fork);
     filter_ = GTEST_FLAG(filter);
     internal_run_death_test_ = GTEST_FLAG(internal_run_death_test);
-    list_tests_ = GTEST_FLAG(list_tests);
     output_ = GTEST_FLAG(output);
-    print_time_ = GTEST_FLAG(print_time);
+    stream_result_to_ = GTEST_FLAG(stream_result_to);
+
     random_seed_ = GTEST_FLAG(random_seed);
     repeat_ = GTEST_FLAG(repeat);
-    shuffle_ = GTEST_FLAG(shuffle);
     stack_trace_depth_ = GTEST_FLAG(stack_trace_depth);
-    stream_result_to_ = GTEST_FLAG(stream_result_to);
+
+    also_run_disabled_tests_ = GTEST_FLAG(also_run_disabled_tests);
+    break_on_failure_ = GTEST_FLAG(break_on_failure);
+    catch_exceptions_ = GTEST_FLAG(catch_exceptions);
+    death_test_use_fork_ = GTEST_FLAG(death_test_use_fork);
+    list_tests_ = GTEST_FLAG(list_tests);
+    print_time_ = GTEST_FLAG(print_time);
+    shuffle_ = GTEST_FLAG(shuffle);
     throw_on_failure_ = GTEST_FLAG(throw_on_failure);
   }
 
   // The d'tor is not virtual.  DO NOT INHERIT FROM THIS CLASS.
   ~GTestFlagSaver() {
-    GTEST_FLAG(also_run_disabled_tests) = also_run_disabled_tests_;
-    GTEST_FLAG(break_on_failure) = break_on_failure_;
-    GTEST_FLAG(catch_exceptions) = catch_exceptions_;
     GTEST_FLAG(color) = color_;
     GTEST_FLAG(death_test_style) = death_test_style_;
-    GTEST_FLAG(death_test_use_fork) = death_test_use_fork_;
     GTEST_FLAG(filter) = filter_;
     GTEST_FLAG(internal_run_death_test) = internal_run_death_test_;
-    GTEST_FLAG(list_tests) = list_tests_;
     GTEST_FLAG(output) = output_;
-    GTEST_FLAG(print_time) = print_time_;
+    GTEST_FLAG(stream_result_to) = stream_result_to_;
+
     GTEST_FLAG(random_seed) = random_seed_;
     GTEST_FLAG(repeat) = repeat_;
-    GTEST_FLAG(shuffle) = shuffle_;
     GTEST_FLAG(stack_trace_depth) = stack_trace_depth_;
-    GTEST_FLAG(stream_result_to) = stream_result_to_;
+
+    GTEST_FLAG(also_run_disabled_tests) = also_run_disabled_tests_;
+    GTEST_FLAG(break_on_failure) = break_on_failure_;
+    GTEST_FLAG(catch_exceptions) = catch_exceptions_;
+    GTEST_FLAG(death_test_use_fork) = death_test_use_fork_;
+    GTEST_FLAG(list_tests) = list_tests_;
+    GTEST_FLAG(print_time) = print_time_;
+    GTEST_FLAG(shuffle) = shuffle_;
     GTEST_FLAG(throw_on_failure) = throw_on_failure_;
   }
  private:
   // Fields for saving the original values of flags.
-  bool also_run_disabled_tests_;
-  bool break_on_failure_;
-  bool catch_exceptions_;
   String color_;
   String death_test_style_;
-  bool death_test_use_fork_;
   String filter_;
   String internal_run_death_test_;
-  bool list_tests_;
   String output_;
-  bool print_time_;
+  String stream_result_to_;
   internal::Int32 random_seed_;
   internal::Int32 repeat_;
-  bool shuffle_;
   internal::Int32 stack_trace_depth_;
-  String stream_result_to_;
+  bool also_run_disabled_tests_;
+  bool break_on_failure_;
+  bool catch_exceptions_;
+  bool death_test_use_fork_;
+  bool list_tests_;
+  bool print_time_;
+  bool shuffle_;
   bool throw_on_failure_;
 } GTEST_ATTRIBUTE_UNUSED_;
 




More information about the llvm-commits mailing list