Reordering fields to reduce padding in LLVM. NFC
authorBen Craig <ben.craig@codeaurora.org>
Mon, 14 Dec 2015 21:57:05 +0000 (21:57 +0000)
committerBen Craig <ben.craig@codeaurora.org>
Mon, 14 Dec 2015 21:57:05 +0000 (21:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255554 91177308-0d34-0410-b5e6-96231b3b80d8

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

index aa3a423..337532e 100644 (file)
@@ -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"
 };
 
index f80d885..5c142a5 100644 (file)
@@ -85,8 +85,8 @@ static void PrintMask(unsigned i, std::ostream &OS) {
 
 /// 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*> TheOperators;
 
 /// 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() {
index 35e865f..f610cfd 100644 (file)
@@ -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_;