Subzero: Use a "known" version of clang-format.

There are two problems with "make format" and "make format-diff" in
Makefile.standalone:

1. You have to make sure clang-format and clang-format-diff.py are
available in $PATH.

2. Different users may have different versions installed (even for the
same user on different machines), leading to whitespace wars.  Can't we
all just get along?

Since the normal LLVM build that Subzero depends on also exposes and
builds clang-format and friends, we might as well use it.  The
clang-format binary is found in $LLVM_BIN_PATH, and clang-format-diff.py
is found relative to $LLVM_SRC_PATH.  As long as the user's LLVM build
is fairly up to date, whitespace wars are unlikely.

Given this, there's a much higher incentive to use "make format"
regularly instead of "make format-diff".  In particular, inline comments
on variable/field declaration lists can get lined up more nicely by
looking at the entire context, rather than the small diff window.

BUG= none
R=jvoung@chromium.org

Review URL: https://codereview.chromium.org/877003003
diff --git a/Makefile.standalone b/Makefile.standalone
index be60dc6..1b24d11 100644
--- a/Makefile.standalone
+++ b/Makefile.standalone
@@ -157,7 +157,7 @@
 	$(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \
                -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib)
 
-# TODO: Be more precise than "*.h" here and elsewhere.
+# TODO(stichnot): Be more precise than "*.h" here and elsewhere.
 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def
 	$(CXX) -c $(CXXFLAGS) $< -o $@
 
@@ -197,24 +197,18 @@
 	(cd crosstest; ./runtests.sh)
 endif
 
-# TODO: Fix the use of wildcards.
-# Assumes clang-format is within $PATH.
+FORMAT_BLACKLIST =
+# Add one of the following lines for each source file to ignore.
+FORMAT_BLACKLIST += ! -name IceParseInstsTest.cpp
 format:
-	clang-format -style=LLVM -i src/*.h src/*.cpp
+	$(LLVM_BIN_PATH)/clang-format -style=LLVM -i \
+	`find . -regex '.*\.\(c\|h\|cpp\)' $(FORMAT_BLACKLIST)`
 
-# Assumes clang-format-diff.py is within $PATH, and that the
-# clang-format it calls is also within $PATH.  This may require adding
-# a component to $PATH, or creating symlinks within some existing
-# $PATH component.  Uses the one in /usr/lib/clang-format/ if it
-# exists.
-ifeq (,$(wildcard /usr/lib/clang-format/clang-format-diff.py))
-  CLANG_FORMAT_DIFF = clang-format-diff.py
-else
-  CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py
-endif
 format-diff:
 	git diff -U0 `git merge-base HEAD master` | \
-	$(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i
+	PATH=$(LLVM_BIN_PATH):$(PATH) \
+	$(LLVM_SRC_PATH)/../clang/tools/clang-format/clang-format-diff.py \
+	-p1 -style=LLVM -i
 
 clean:
 	rm -rf llvm2ice *.o $(OBJDIR)
diff --git a/crosstest/mem_intrin.cpp b/crosstest/mem_intrin.cpp
index 4a65995..612edce 100644
--- a/crosstest/mem_intrin.cpp
+++ b/crosstest/mem_intrin.cpp
@@ -14,9 +14,8 @@
 /*
  * Reset buf to the sequence of bytes: n, n+1, n+2 ... length - 1
  */
-static void __attribute__((noinline)) reset_buf(uint8_t *buf,
-                                                uint8_t init,
-                                                size_t length) {
+static void __attribute__((noinline))
+reset_buf(uint8_t *buf, uint8_t init, size_t length) {
   size_t i;
   size_t v = init;
   for (i = 0; i < length; ++i)
@@ -27,8 +26,8 @@
  * (Not doing a fletcher-32 checksum, since we are working with
  * smaller buffers, whose total won't approach 2**16).
  */
-static int __attribute__((noinline)) fletcher_checksum(uint8_t *buf,
-                                                       size_t length) {
+static int __attribute__((noinline))
+fletcher_checksum(uint8_t *buf, size_t length) {
   size_t i;
   int sum = 0;
   int sum_of_sums = 0;
diff --git a/crosstest/mem_intrin_main.cpp b/crosstest/mem_intrin_main.cpp
index b529273..70e3a67 100644
--- a/crosstest/mem_intrin_main.cpp
+++ b/crosstest/mem_intrin_main.cpp
@@ -13,22 +13,22 @@
 #define STR(s) #s
 
 void testFixedLen(size_t &TotalTests, size_t &Passes, size_t &Failures) {
-#define do_test_fixed(test_func)                                        \
-  for (uint8_t init_val = 0; init_val < 100; ++init_val) {              \
-    ++TotalTests;                                                       \
-    int llc_result = test_func(init_val);                               \
-    int sz_result = Subzero_::test_func(init_val);                      \
-    if (llc_result == sz_result) {                                      \
-      ++Passes;                                                         \
-    } else {                                                            \
-      ++Failures;                                                       \
-      printf("Failure (%s): init_val=%d, llc=%d, sz=%d\n",              \
-             STR(test_func), init_val, llc_result, sz_result);          \
-    }                                                                   \
+#define do_test_fixed(test_func)                                               \
+  for (uint8_t init_val = 0; init_val < 100; ++init_val) {                     \
+    ++TotalTests;                                                              \
+    int llc_result = test_func(init_val);                                      \
+    int sz_result = Subzero_::test_func(init_val);                             \
+    if (llc_result == sz_result) {                                             \
+      ++Passes;                                                                \
+    } else {                                                                   \
+      ++Failures;                                                              \
+      printf("Failure (%s): init_val=%d, llc=%d, sz=%d\n", STR(test_func),     \
+             init_val, llc_result, sz_result);                                 \
+    }                                                                          \
   }
 
-  do_test_fixed(memcpy_test_fixed_len)
-  do_test_fixed(memmove_test_fixed_len)
+  do_test_fixed(memcpy_test_fixed_len);
+  do_test_fixed(memmove_test_fixed_len);
   do_test_fixed(memset_test_fixed_len)
 #undef do_test_fixed
 }
@@ -36,24 +36,24 @@
 void testVariableLen(size_t &TotalTests, size_t &Passes, size_t &Failures) {
   uint8_t buf[256];
   uint8_t buf2[256];
-#define do_test_variable(test_func)                                     \
-  for (size_t len = 4; len < 128; ++len) {                              \
-    for (uint8_t init_val = 0; init_val < 100; ++init_val) {            \
-      ++TotalTests;                                                     \
-      int llc_result = test_func(buf, buf2, init_val, len);             \
-      int sz_result = Subzero_::test_func(buf, buf2, init_val, len);    \
-      if (llc_result == sz_result) {                                    \
-        ++Passes;                                                       \
-      } else {                                                          \
-        ++Failures;                                                     \
-        printf("Failure (%s): init_val=%d, len=%d, llc=%d, sz=%d\n",    \
-               STR(test_func), init_val, len, llc_result, sz_result);   \
-      }                                                                 \
-    }                                                                   \
+#define do_test_variable(test_func)                                            \
+  for (size_t len = 4; len < 128; ++len) {                                     \
+    for (uint8_t init_val = 0; init_val < 100; ++init_val) {                   \
+      ++TotalTests;                                                            \
+      int llc_result = test_func(buf, buf2, init_val, len);                    \
+      int sz_result = Subzero_::test_func(buf, buf2, init_val, len);           \
+      if (llc_result == sz_result) {                                           \
+        ++Passes;                                                              \
+      } else {                                                                 \
+        ++Failures;                                                            \
+        printf("Failure (%s): init_val=%d, len=%d, llc=%d, sz=%d\n",           \
+               STR(test_func), init_val, len, llc_result, sz_result);          \
+      }                                                                        \
+    }                                                                          \
   }
 
-  do_test_variable(memcpy_test)
-  do_test_variable(memmove_test)
+  do_test_variable(memcpy_test);
+  do_test_variable(memmove_test);
   do_test_variable(memset_test)
 #undef do_test_variable
 }
diff --git a/crosstest/test_arith_main.cpp b/crosstest/test_arith_main.cpp
index 16b2c5e..49aa662 100644
--- a/crosstest/test_arith_main.cpp
+++ b/crosstest/test_arith_main.cpp
@@ -64,14 +64,14 @@
 #define X(inst, op, isdiv, isshift)                                            \
   { STR(inst), test##inst, Subzero_::test##inst, NULL, NULL, isdiv }           \
   ,
-      UINTOP_TABLE
+        UINTOP_TABLE
 #undef X
 #define X(inst, op, isdiv, isshift)                                            \
   { STR(inst), NULL, NULL, test##inst, Subzero_::test##inst, isdiv }           \
   ,
-      SINTOP_TABLE
+            SINTOP_TABLE
 #undef X
-  };
+    };
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
 
   if (sizeof(TypeUnsigned) <= sizeof(uint32_t)) {
@@ -175,20 +175,16 @@
     bool MaskShiftOperations;  // for shift related tests
   } Funcs[] = {
 #define X(inst, op, isdiv, isshift)                                            \
-  {                                                                            \
-    STR(inst), test##inst, Subzero_::test##inst, NULL, NULL, isdiv, isshift    \
-  }                                                                            \
+  { STR(inst), test##inst, Subzero_::test##inst, NULL, NULL, isdiv, isshift }  \
   ,
         UINTOP_TABLE
 #undef X
 #define X(inst, op, isdiv, isshift)                                            \
-  {                                                                            \
-    STR(inst), NULL, NULL, test##inst, Subzero_::test##inst, isdiv, isshift    \
-  }                                                                            \
+  { STR(inst), NULL, NULL, test##inst, Subzero_::test##inst, isdiv, isshift }  \
   ,
-        SINTOP_TABLE
+            SINTOP_TABLE
 #undef X
-  };
+    };
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
   const static size_t NumElementsInType = Vectors<TypeUnsigned>::NumElements;
   for (size_t f = 0; f < NumFuncs; ++f) {
@@ -251,9 +247,9 @@
 #define X(inst, op, func)                                                      \
   { STR(inst), (FuncType)test##inst, (FuncType)Subzero_::test##inst }          \
   ,
-      FPOP_TABLE
+        FPOP_TABLE
 #undef X
-  };
+    };
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
 
   for (size_t f = 0; f < NumFuncs; ++f) {
@@ -310,9 +306,9 @@
 #define X(inst, op, func)                                                      \
   { STR(inst), (FuncType)test##inst, (FuncType)Subzero_::test##inst }          \
   ,
-      FPOP_TABLE
+        FPOP_TABLE
 #undef X
-  };
+    };
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
   const static size_t NumElementsInType = 4;
   for (size_t f = 0; f < NumFuncs; ++f) {
@@ -363,4 +359,3 @@
             << " Failures=" << Failures << "\n";
   return Failures;
 }
-
diff --git a/crosstest/test_bitmanip.h b/crosstest/test_bitmanip.h
index c24c679..274fb5b 100644
--- a/crosstest/test_bitmanip.h
+++ b/crosstest/test_bitmanip.h
@@ -14,10 +14,10 @@
 
 #include "test_bitmanip.def"
 
-#define X(inst, type)                                                         \
-  type test_##inst(type a);                                                   \
-  type test_alloca_##inst(type a);                                            \
-  type test_const_##inst(type ignored);                                       \
+#define X(inst, type)                                                          \
+  type test_##inst(type a);                                                    \
+  type test_alloca_##inst(type a);                                             \
+  type test_const_##inst(type ignored);                                        \
   type my_##inst(type a);
 
 FOR_ALL_BMI_OP_TYPES(X)
diff --git a/crosstest/test_bitmanip_main.cpp b/crosstest/test_bitmanip_main.cpp
index 592ad7e..4901462 100644
--- a/crosstest/test_bitmanip_main.cpp
+++ b/crosstest/test_bitmanip_main.cpp
@@ -64,19 +64,13 @@
     FuncType FuncLlc;
     FuncType FuncSz;
   } Funcs[] = {
-#define X(inst)                                                             \
-  {                                                                         \
-    STR(inst), test_##inst, Subzero_::test_##inst                           \
-  },                                                                        \
-  {                                                                         \
-    STR(inst) "_alloca", test_alloca_##inst, Subzero_::test_alloca_##inst   \
-  },                                                                        \
-  {                                                                         \
-    STR(inst) "_const", test_const_##inst, Subzero_::test_const_##inst      \
-  },
-      BMI_OPS
+#define X(inst)                                                                \
+  { STR(inst), test_##inst, Subzero_::test_##inst }                            \
+  , {STR(inst) "_alloca", test_alloca_##inst, Subzero_::test_alloca_##inst},   \
+      {STR(inst) "_const", test_const_##inst, Subzero_::test_const_##inst},
+        BMI_OPS
 #undef X
-  };
+    };
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
 
   for (size_t f = 0; f < NumFuncs; ++f) {
@@ -89,12 +83,10 @@
         ++Passes;
       } else {
         ++Failures;
-        std::cout << "test_" << Funcs[f].Name
-                  << (CHAR_BIT * sizeof(Type)) << "("
-                  << static_cast<uint64_t>(Value)
+        std::cout << "test_" << Funcs[f].Name << (CHAR_BIT * sizeof(Type))
+                  << "(" << static_cast<uint64_t>(Value)
                   << "): sz=" << static_cast<uint64_t>(ResultSz)
-                  << " llc=" << static_cast<uint64_t>(ResultLlc)
-                  << "\n";
+                  << " llc=" << static_cast<uint64_t>(ResultLlc) << "\n";
       }
     }
   }
diff --git a/crosstest/test_calling_conv.cpp b/crosstest/test_calling_conv.cpp
index 57bfa6f..e7fa616 100644
--- a/crosstest/test_calling_conv.cpp
+++ b/crosstest/test_calling_conv.cpp
@@ -75,9 +75,9 @@
 }
 
 void __attribute__((noinline))
-callee_vlvlivfvdviv(v4f32 arg1, int64_t arg2, v4f32 arg3, int64_t arg4, int arg5,
-                    v4f32 arg6, float arg7, v4f32 arg8, double arg9, v4f32 arg10,
-                    int arg11, v4f32 arg12) {
+callee_vlvlivfvdviv(v4f32 arg1, int64_t arg2, v4f32 arg3, int64_t arg4,
+                    int arg5, v4f32 arg6, float arg7, v4f32 arg8, double arg9,
+                    v4f32 arg10, int arg11, v4f32 arg12) {
   switch (ArgNum) {
     HANDLE_ARG(1);
     HANDLE_ARG(2);
diff --git a/crosstest/test_calling_conv.h b/crosstest/test_calling_conv.h
index cd4a9d9..6cff49b 100644
--- a/crosstest/test_calling_conv.h
+++ b/crosstest/test_calling_conv.h
@@ -27,10 +27,10 @@
 callee_i_Ty callee_alloca_i;
 
 void caller_vvvvv();
-typedef void (callee_vvvvv_Ty)(v4si32, v4si32, v4si32, v4si32, v4si32);
+typedef void(callee_vvvvv_Ty)(v4si32, v4si32, v4si32, v4si32, v4si32);
 callee_vvvvv_Ty callee_vvvvv;
 
 void caller_vlvlivfvdviv();
 typedef void(callee_vlvlivfvdviv_Ty)(v4f32, int64_t, v4f32, int64_t, int, v4f32,
-                                    float, v4f32, double, v4f32, int, v4f32);
+                                     float, v4f32, double, v4f32, int, v4f32);
 callee_vlvlivfvdviv_Ty callee_vlvlivfvdviv;
diff --git a/crosstest/test_calling_conv_main.cpp b/crosstest/test_calling_conv_main.cpp
index 9a6c2f6..f319a49 100644
--- a/crosstest/test_calling_conv_main.cpp
+++ b/crosstest/test_calling_conv_main.cpp
@@ -56,7 +56,7 @@
   for (size_t i = 0; i < BUF_SIZE; ++i) {
     if (i > 0)
       OS << " ";
-    OS << (unsigned) Buf[i];
+    OS << (unsigned)Buf[i];
   }
   return OS.str();
 }
@@ -75,9 +75,9 @@
         reinterpret_cast<CalleePtrTy>(&callee),                                \
   }                                                                            \
   ,
-    TEST_FUNC_TABLE
+        TEST_FUNC_TABLE
 #undef X
-  };
+    };
 
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
 
@@ -125,9 +125,9 @@
         reinterpret_cast<CalleePtrTy>(&Subzero_::callee)                       \
   }                                                                            \
   ,
-    TEST_FUNC_TABLE
+        TEST_FUNC_TABLE
 #undef X
-  };
+    };
 
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
 
diff --git a/crosstest/test_cast_main.cpp b/crosstest/test_cast_main.cpp
index fd50011..dbd93aa 100644
--- a/crosstest/test_cast_main.cpp
+++ b/crosstest/test_cast_main.cpp
@@ -115,66 +115,62 @@
   size_t Passes = 0;
   size_t Failures = 0;
 
-  volatile bool ValsUi1[] = { false, true };
+  volatile bool ValsUi1[] = {false, true};
   static const size_t NumValsUi1 = sizeof(ValsUi1) / sizeof(*ValsUi1);
-  volatile uint8_t ValsUi8[] = { 0, 1, 0x7e, 0x7f, 0x80, 0x81, 0xfe, 0xff };
+  volatile uint8_t ValsUi8[] = {0, 1, 0x7e, 0x7f, 0x80, 0x81, 0xfe, 0xff};
   static const size_t NumValsUi8 = sizeof(ValsUi8) / sizeof(*ValsUi8);
 
-  volatile myint8_t ValsSi8[] = { 0, 1, 0x7e, 0x7f, 0x80, 0x81, 0xfe, 0xff };
+  volatile myint8_t ValsSi8[] = {0, 1, 0x7e, 0x7f, 0x80, 0x81, 0xfe, 0xff};
   static const size_t NumValsSi8 = sizeof(ValsSi8) / sizeof(*ValsSi8);
 
-  volatile uint16_t ValsUi16[] = { 0,      1,      0x7e,   0x7f,   0x80,
-                                   0x81,   0xfe,   0xff,   0x7ffe, 0x7fff,
-                                   0x8000, 0x8001, 0xfffe, 0xffff };
+  volatile uint16_t ValsUi16[] = {0,      1,      0x7e,   0x7f,   0x80,
+                                  0x81,   0xfe,   0xff,   0x7ffe, 0x7fff,
+                                  0x8000, 0x8001, 0xfffe, 0xffff};
   static const size_t NumValsUi16 = sizeof(ValsUi16) / sizeof(*ValsUi16);
 
-  volatile int16_t ValsSi16[] = { 0,      1,      0x7e,   0x7f,   0x80,
-                                  0x81,   0xfe,   0xff,   0x7ffe, 0x7fff,
-                                  0x8000, 0x8001, 0xfffe, 0xffff };
+  volatile int16_t ValsSi16[] = {0,      1,      0x7e,   0x7f,   0x80,
+                                 0x81,   0xfe,   0xff,   0x7ffe, 0x7fff,
+                                 0x8000, 0x8001, 0xfffe, 0xffff};
   static const size_t NumValsSi16 = sizeof(ValsSi16) / sizeof(*ValsSi16);
 
-  volatile size_t ValsUi32[] = {
-    0,          1,          0x7e,       0x7f,       0x80,
-    0x81,       0xfe,       0xff,       0x7ffe,     0x7fff,
-    0x8000,     0x8001,     0xfffe,     0xffff,     0x7ffffffe,
-    0x7fffffff, 0x80000000, 0x80000001, 0xfffffffe, 0xffffffff
-  };
+  volatile size_t ValsUi32[] = {0,          1,          0x7e,       0x7f,
+                                0x80,       0x81,       0xfe,       0xff,
+                                0x7ffe,     0x7fff,     0x8000,     0x8001,
+                                0xfffe,     0xffff,     0x7ffffffe, 0x7fffffff,
+                                0x80000000, 0x80000001, 0xfffffffe, 0xffffffff};
   static const size_t NumValsUi32 = sizeof(ValsUi32) / sizeof(*ValsUi32);
 
-  volatile size_t ValsSi32[] = {
-    0,          1,          0x7e,       0x7f,       0x80,
-    0x81,       0xfe,       0xff,       0x7ffe,     0x7fff,
-    0x8000,     0x8001,     0xfffe,     0xffff,     0x7ffffffe,
-    0x7fffffff, 0x80000000, 0x80000001, 0xfffffffe, 0xffffffff
-  };
+  volatile size_t ValsSi32[] = {0,          1,          0x7e,       0x7f,
+                                0x80,       0x81,       0xfe,       0xff,
+                                0x7ffe,     0x7fff,     0x8000,     0x8001,
+                                0xfffe,     0xffff,     0x7ffffffe, 0x7fffffff,
+                                0x80000000, 0x80000001, 0xfffffffe, 0xffffffff};
   static const size_t NumValsSi32 = sizeof(ValsSi32) / sizeof(*ValsSi32);
 
   volatile uint64_t ValsUi64[] = {
-    0,                     1,                     0x7e,
-    0x7f,                  0x80,                  0x81,
-    0xfe,                  0xff,                  0x7ffe,
-    0x7fff,                0x8000,                0x8001,
-    0xfffe,                0xffff,                0x7ffffffe,
-    0x7fffffff,            0x80000000,            0x80000001,
-    0xfffffffe,            0xffffffff,            0x100000000ull,
-    0x100000001ull,        0x7ffffffffffffffeull, 0x7fffffffffffffffull,
-    0x8000000000000000ull, 0x8000000000000001ull, 0xfffffffffffffffeull,
-    0xffffffffffffffffull
-  };
+      0,                     1,                     0x7e,
+      0x7f,                  0x80,                  0x81,
+      0xfe,                  0xff,                  0x7ffe,
+      0x7fff,                0x8000,                0x8001,
+      0xfffe,                0xffff,                0x7ffffffe,
+      0x7fffffff,            0x80000000,            0x80000001,
+      0xfffffffe,            0xffffffff,            0x100000000ull,
+      0x100000001ull,        0x7ffffffffffffffeull, 0x7fffffffffffffffull,
+      0x8000000000000000ull, 0x8000000000000001ull, 0xfffffffffffffffeull,
+      0xffffffffffffffffull};
   static const size_t NumValsUi64 = sizeof(ValsUi64) / sizeof(*ValsUi64);
 
   volatile int64_t ValsSi64[] = {
-    0,                    1,                    0x7e,
-    0x7f,                 0x80,                 0x81,
-    0xfe,                 0xff,                 0x7ffe,
-    0x7fff,               0x8000,               0x8001,
-    0xfffe,               0xffff,               0x7ffffffe,
-    0x7fffffff,           0x80000000,           0x80000001,
-    0xfffffffe,           0xffffffff,           0x100000000ll,
-    0x100000001ll,        0x7ffffffffffffffell, 0x7fffffffffffffffll,
-    0x8000000000000000ll, 0x8000000000000001ll, 0xfffffffffffffffell,
-    0xffffffffffffffffll
-  };
+      0,                    1,                    0x7e,
+      0x7f,                 0x80,                 0x81,
+      0xfe,                 0xff,                 0x7ffe,
+      0x7fff,               0x8000,               0x8001,
+      0xfffe,               0xffff,               0x7ffffffe,
+      0x7fffffff,           0x80000000,           0x80000001,
+      0xfffffffe,           0xffffffff,           0x100000000ll,
+      0x100000001ll,        0x7ffffffffffffffell, 0x7fffffffffffffffll,
+      0x8000000000000000ll, 0x8000000000000001ll, 0xfffffffffffffffell,
+      0xffffffffffffffffll};
   static const size_t NumValsSi64 = sizeof(ValsSi64) / sizeof(*ValsSi64);
 
   static const double NegInf = -1.0 / 0.0;
diff --git a/crosstest/test_fcmp_main.cpp b/crosstest/test_fcmp_main.cpp
index b15d91f..359ecc0 100644
--- a/crosstest/test_fcmp_main.cpp
+++ b/crosstest/test_fcmp_main.cpp
@@ -51,7 +51,7 @@
   assert(NegInf < PosInf);
   assert(Zero < PosInf);
   static volatile double InitValues[] =
-    FP_VALUE_ARRAY(NegInf, PosInf, NegNan, Nan);
+      FP_VALUE_ARRAY(NegInf, PosInf, NegNan, Nan);
   NumValues = sizeof(InitValues) / sizeof(*InitValues);
   Values = InitValues;
 }
@@ -72,7 +72,7 @@
         Subzero_fcmp##cmp##Double, fcmp##cmp##Double                           \
   }                                                                            \
   ,
-      FCMP_TABLE
+        FCMP_TABLE
 #undef X
     };
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
diff --git a/crosstest/test_global.cpp b/crosstest/test_global.cpp
index f28afb8..b2f52b0 100644
--- a/crosstest/test_global.cpp
+++ b/crosstest/test_global.cpp
@@ -29,7 +29,7 @@
 int ArrayInitPartial[10] = {60, 70, 80, 90, 100};
 int ArrayInitFull[] = {10, 20, 30, 40, 50};
 const int ArrayConst[] = {-10, -20, -30};
-static double ArrayDouble[10] = { 0.5, 1.5, 2.5, 3.5 };
+static double ArrayDouble[10] = {0.5, 1.5, 2.5, 3.5};
 
 static struct {
   int Array1[5];
@@ -43,12 +43,12 @@
   } NestedStuff;
   uint8_t *Pointer5;
 } StructEx = {
-  { 10, 20, 30, 40, 50 },
-  ExternName1,
-  { 0.5, 1.5, 2.5 },
-  ExternName4,
-  { ExternName3, {1000, 1010, 1020}, ExternName2 },
-  ExternName5,
+      {10, 20, 30, 40, 50},
+      ExternName1,
+      {0.5, 1.5, 2.5},
+      ExternName4,
+      {ExternName3, {1000, 1010, 1020}, ExternName2},
+      ExternName5,
 };
 
 #define ARRAY(a)                                                               \
@@ -67,7 +67,7 @@
       ARRAY(ArrayDouble),
       {(uint8_t *)(ArrayInitPartial + 2),
        sizeof(ArrayInitPartial) - 2 * sizeof(int)},
-      { (uint8_t*)(&StructEx), sizeof(StructEx) },
+      {(uint8_t *)(&StructEx), sizeof(StructEx)},
 };
 size_t NumArraysElements = sizeof(Arrays) / sizeof(*Arrays);
 
diff --git a/crosstest/test_global_main.cpp b/crosstest/test_global_main.cpp
index f34b3c9..5383cb7 100644
--- a/crosstest/test_global_main.cpp
+++ b/crosstest/test_global_main.cpp
@@ -68,8 +68,7 @@
       } else {
         ++Failures;
         std::cout << i << ":LlcArray[" << i << "] = " << (int)LlcArray[i]
-                  << ", SzArray[" << i << "] = " << (int)SzArray[i]
-                  << "\n";
+                  << ", SzArray[" << i << "] = " << (int)SzArray[i] << "\n";
       }
     }
   }
diff --git a/crosstest/test_icmp_main.cpp b/crosstest/test_icmp_main.cpp
index fa2eebd..dbfe515 100644
--- a/crosstest/test_icmp_main.cpp
+++ b/crosstest/test_icmp_main.cpp
@@ -27,12 +27,12 @@
 #include "test_icmp.h"
 }
 
-volatile unsigned Values[] = { 0x0,        0x1,        0x7ffffffe, 0x7fffffff,
-                               0x80000000, 0x80000001, 0xfffffffe, 0xffffffff,
-                               0x7e,       0x7f,       0x80,       0x81,
-                               0xfe,       0xff,       0x100,      0x101,
-                               0x7ffe,     0x7fff,     0x8000,     0x8001,
-                               0xfffe,     0xffff,     0x10000,    0x10001, };
+volatile unsigned Values[] = {
+    0x0,        0x1,        0x7ffffffe, 0x7fffffff, 0x80000000, 0x80000001,
+    0xfffffffe, 0xffffffff, 0x7e,       0x7f,       0x80,       0x81,
+    0xfe,       0xff,       0x100,      0x101,      0x7ffe,     0x7fff,
+    0x8000,     0x8001,     0xfffe,     0xffff,     0x10000,    0x10001,
+};
 const static size_t NumValues = sizeof(Values) / sizeof(*Values);
 
 template <typename TypeUnsigned, typename TypeSigned>
@@ -54,13 +54,13 @@
 #undef X
 #define X(cmp, op)                                                             \
   {                                                                            \
-    STR(cmp), (FuncTypeUnsigned)(FuncTypeSigned)icmp##cmp,                     \
-        (FuncTypeUnsigned)(FuncTypeSigned)Subzero_::icmp##cmp                  \
+    STR(cmp), (FuncTypeUnsigned)(FuncTypeSigned) icmp##cmp,                    \
+        (FuncTypeUnsigned)(FuncTypeSigned) Subzero_::icmp##cmp                 \
   }                                                                            \
   ,
-        ICMP_S_TABLE
+            ICMP_S_TABLE
 #undef X
-  };
+    };
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
 
   if (sizeof(TypeUnsigned) <= sizeof(uint32_t)) {
@@ -141,13 +141,13 @@
 #undef X
 #define X(cmp, op)                                                             \
   {                                                                            \
-    STR(cmp), (FuncTypeUnsigned)(FuncTypeSigned)icmp##cmp,                     \
-        (FuncTypeUnsigned)(FuncTypeSigned)Subzero_::icmp##cmp                  \
+    STR(cmp), (FuncTypeUnsigned)(FuncTypeSigned) icmp##cmp,                    \
+        (FuncTypeUnsigned)(FuncTypeSigned) Subzero_::icmp##cmp                 \
   }                                                                            \
   ,
-        ICMP_S_TABLE
+            ICMP_S_TABLE
 #undef X
-  };
+    };
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
   const static size_t NumElementsInType = Vectors<TypeUnsigned>::NumElements;
   for (size_t f = 0; f < NumFuncs; ++f) {
@@ -206,9 +206,7 @@
 #define X(cmp, op)                                                             \
   { STR(cmp), (FuncType)icmpi1##cmp, (FuncType)Subzero_::icmpi1##cmp }         \
   ,
-        ICMP_U_TABLE
-        ICMP_S_TABLE
-  };
+        ICMP_U_TABLE ICMP_S_TABLE};
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
   const static size_t NumElements = Vectors<T>::NumElements;
   const static size_t MAX_NUMBER_OF_ELEMENTS_FOR_EXHAUSTIVE_TESTING = 8;
diff --git a/crosstest/test_select_main.cpp b/crosstest/test_select_main.cpp
index 36d6c7e..5ccdcfb 100644
--- a/crosstest/test_select_main.cpp
+++ b/crosstest/test_select_main.cpp
@@ -32,13 +32,10 @@
   typedef typename Vectors<T>::Ty Ty;
   typedef typename Vectors<TI1>::Ty TyI1;
   volatile unsigned Values[] = {
-    0x0,        0x1,        0x7ffffffe, 0x7fffffff,
-    0x80000000, 0x80000001, 0xfffffffe, 0xffffffff,
-    0x7e,       0x7f,       0x80,       0x81,
-    0xfe,       0xff,       0x100,      0x101,
-    0x7ffe,     0x7fff,     0x8000,     0x8001,
-    0xfffe,     0xffff,     0x10000,    0x10001
-  };
+      0x0,        0x1,        0x7ffffffe, 0x7fffffff, 0x80000000, 0x80000001,
+      0xfffffffe, 0xffffffff, 0x7e,       0x7f,       0x80,       0x81,
+      0xfe,       0xff,       0x100,      0x101,      0x7ffe,     0x7fff,
+      0x8000,     0x8001,     0xfffe,     0xffff,     0x10000,    0x10001};
   static const size_t NumValues = sizeof(Values) / sizeof(*Values);
   static const size_t NumElements = Vectors<T>::NumElements;
   PRNG Index;
@@ -67,8 +64,9 @@
   }
 }
 
-template<> void
-testSelect<v4f32, v4i1>(size_t &TotalTests, size_t &Passes, size_t &Failures) {
+template <>
+void testSelect<v4f32, v4i1>(size_t &TotalTests, size_t &Passes,
+                             size_t &Failures) {
   static const float NegInf = -1.0 / 0.0;
   static const float PosInf = 1.0 / 0.0;
   static const float Nan = 0.0 / 0.0;
@@ -102,7 +100,7 @@
   }
 }
 
-template<typename T>
+template <typename T>
 void testSelectI1(size_t &TotalTests, size_t &Passes, size_t &Failures) {
   typedef typename Vectors<T>::Ty Ty;
   static const size_t NumElements = Vectors<T>::NumElements;
diff --git a/crosstest/test_stacksave.c b/crosstest/test_stacksave.c
index b0e9b5e..6654880 100644
--- a/crosstest/test_stacksave.c
+++ b/crosstest/test_stacksave.c
@@ -29,9 +29,7 @@
   return (vla[start] << 2) + (vla[mid] << 1) + vla[size - 1];
 }
 
-static uint32_t __attribute__((noinline)) foo(uint32_t x) {
-  return x * x;
-}
+static uint32_t __attribute__((noinline)) foo(uint32_t x) { return x * x; }
 
 /* NOTE: This has 1 stacksave, because the vla is in a loop and should
  * be freed before the next iteration.
diff --git a/crosstest/test_stacksave.h b/crosstest/test_stacksave.h
index 8d0af01..cb4684d 100644
--- a/crosstest/test_stacksave.h
+++ b/crosstest/test_stacksave.h
@@ -15,12 +15,12 @@
 #ifndef TEST_STACKSAVE_H
 #define TEST_STACKSAVE_H
 
-#define DECLARE_TESTS(PREFIX)                                            \
-  uint32_t PREFIX##test_basic_vla(uint32_t size, uint32_t start,         \
-                                  uint32_t inc);                         \
-  uint32_t PREFIX##test_vla_in_loop(uint32_t size, uint32_t start,       \
-                                    uint32_t inc);                       \
-  uint32_t PREFIX##test_two_vlas_in_loops(uint32_t size, uint32_t start, \
+#define DECLARE_TESTS(PREFIX)                                                  \
+  uint32_t PREFIX##test_basic_vla(uint32_t size, uint32_t start,               \
+                                  uint32_t inc);                               \
+  uint32_t PREFIX##test_vla_in_loop(uint32_t size, uint32_t start,             \
+                                    uint32_t inc);                             \
+  uint32_t PREFIX##test_two_vlas_in_loops(uint32_t size, uint32_t start,       \
                                           uint32_t inc);
 
 #endif
diff --git a/crosstest/test_stacksave_main.c b/crosstest/test_stacksave_main.c
index a5ab248..0691025 100644
--- a/crosstest/test_stacksave_main.c
+++ b/crosstest/test_stacksave_main.c
@@ -31,12 +31,10 @@
     const char *Name;
     FuncType FuncLlc;
     FuncType FuncSz;
-  } Funcs[] = {
-    { "test_basic_vla", test_basic_vla, Subzero_test_basic_vla },
-    { "test_vla_in_loop", test_vla_in_loop, Subzero_test_vla_in_loop },
-    { "test_two_vlas_in_loops", test_two_vlas_in_loops,
-      Subzero_test_two_vlas_in_loops }
-  };
+  } Funcs[] = {{"test_basic_vla", test_basic_vla, Subzero_test_basic_vla},
+               {"test_vla_in_loop", test_vla_in_loop, Subzero_test_vla_in_loop},
+               {"test_two_vlas_in_loops", test_two_vlas_in_loops,
+                Subzero_test_two_vlas_in_loops}};
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
   const uint32_t size_to_test = 128;
   for (size_t f = 0; f < NumFuncs; ++f) {
@@ -55,7 +53,7 @@
       }
     }
   }
-  printf("TotalTests=%zu Passes=%zu Failures=%zu\n",
-         TotalTests, Passes, Failures);
+  printf("TotalTests=%zu Passes=%zu Failures=%zu\n", TotalTests, Passes,
+         Failures);
   return Failures;
 }
diff --git a/crosstest/test_sync_atomic.cpp b/crosstest/test_sync_atomic.cpp
index 9cfb963..d1578eb 100644
--- a/crosstest/test_sync_atomic.cpp
+++ b/crosstest/test_sync_atomic.cpp
@@ -19,36 +19,36 @@
 
 #include "test_sync_atomic.h"
 
-#define X(inst, type)                                                   \
-  type test_##inst(bool fetch_first, volatile type *ptr, type a) {      \
-    if (fetch_first) {                                                  \
-      return __sync_fetch_and_##inst(ptr, a);                           \
-    } else {                                                            \
-      return __sync_##inst##_and_fetch(ptr, a);                         \
-    }                                                                   \
-  }                                                                     \
-  type test_alloca_##inst(bool fetch, volatile type *ptr, type a) {     \
-    const size_t buf_size = 8;                                          \
-    type buf[buf_size];                                                 \
-    for (size_t i = 0; i < buf_size; ++i) {                             \
-      if (fetch) {                                                      \
-        buf[i] = __sync_fetch_and_##inst(ptr, a);                       \
-      } else {                                                          \
-        buf[i] = __sync_##inst##_and_fetch(ptr, a);                     \
-      }                                                                 \
-    }                                                                   \
-    type sum = 0;                                                       \
-    for (size_t i = 0; i < buf_size; ++i) {                             \
-      sum += buf[i];                                                    \
-    }                                                                   \
-    return sum;                                                         \
-  }                                                                     \
-  type test_const_##inst(bool fetch, volatile type *ptr, type ign) {    \
-    if (fetch) {                                                        \
-      return __sync_fetch_and_##inst(ptr, 42);                          \
-    } else {                                                            \
-      return __sync_##inst##_and_fetch(ptr, 99);                        \
-    }                                                                   \
+#define X(inst, type)                                                          \
+  type test_##inst(bool fetch_first, volatile type *ptr, type a) {             \
+    if (fetch_first) {                                                         \
+      return __sync_fetch_and_##inst(ptr, a);                                  \
+    } else {                                                                   \
+      return __sync_##inst##_and_fetch(ptr, a);                                \
+    }                                                                          \
+  }                                                                            \
+  type test_alloca_##inst(bool fetch, volatile type *ptr, type a) {            \
+    const size_t buf_size = 8;                                                 \
+    type buf[buf_size];                                                        \
+    for (size_t i = 0; i < buf_size; ++i) {                                    \
+      if (fetch) {                                                             \
+        buf[i] = __sync_fetch_and_##inst(ptr, a);                              \
+      } else {                                                                 \
+        buf[i] = __sync_##inst##_and_fetch(ptr, a);                            \
+      }                                                                        \
+    }                                                                          \
+    type sum = 0;                                                              \
+    for (size_t i = 0; i < buf_size; ++i) {                                    \
+      sum += buf[i];                                                           \
+    }                                                                          \
+    return sum;                                                                \
+  }                                                                            \
+  type test_const_##inst(bool fetch, volatile type *ptr, type ign) {           \
+    if (fetch) {                                                               \
+      return __sync_fetch_and_##inst(ptr, 42);                                 \
+    } else {                                                                   \
+      return __sync_##inst##_and_fetch(ptr, 99);                               \
+    }                                                                          \
   }
 
 FOR_ALL_RMWOP_TYPES(X)
diff --git a/crosstest/test_sync_atomic.h b/crosstest/test_sync_atomic.h
index ce24a07..3db2c3d 100644
--- a/crosstest/test_sync_atomic.h
+++ b/crosstest/test_sync_atomic.h
@@ -14,9 +14,9 @@
 
 #include "test_sync_atomic.def"
 
-#define X(inst, type)                                                   \
-  type test_##inst(bool fetch_first, volatile type *ptr, type a);       \
-  type test_alloca_##inst(bool fetch, volatile type *ptr, type a);      \
+#define X(inst, type)                                                          \
+  type test_##inst(bool fetch_first, volatile type *ptr, type a);              \
+  type test_alloca_##inst(bool fetch, volatile type *ptr, type a);             \
   type test_const_##inst(bool fetch, volatile type *ptr, type ignored);
 
 FOR_ALL_RMWOP_TYPES(X)
diff --git a/crosstest/test_sync_atomic_main.cpp b/crosstest/test_sync_atomic_main.cpp
index 6a00f31..c9bf579 100644
--- a/crosstest/test_sync_atomic_main.cpp
+++ b/crosstest/test_sync_atomic_main.cpp
@@ -33,27 +33,27 @@
 }
 
 volatile uint64_t Values[] = {
-    0,                    1,                    0x7e,
-    0x7f,                 0x80,                 0x81,
-    0xfe,                 0xff,                 0x7ffe,
-    0x7fff,               0x8000,               0x8001,
-    0xfffe,               0xffff,
-    0x007fffff /*Max subnormal + */,
-    0x00800000 /*Min+ */, 0x7f7fffff /*Max+ */,
-    0x7f800000 /*+Inf*/,  0xff800000 /*-Inf*/,
-    0x7fa00000 /*SNaN*/,  0x7fc00000 /*QNaN*/,
-    0x7ffffffe,           0x7fffffff,           0x80000000,
-    0x80000001,           0xfffffffe,           0xffffffff,
-    0x100000000ll,        0x100000001ll,
-    0x000fffffffffffffll /*Max subnormal + */,
-    0x0010000000000000ll /*Min+ */,
-    0x7fefffffffffffffll /*Max+ */,
-    0x7ff0000000000000ll /*+Inf*/,
-    0xfff0000000000000ll /*-Inf*/,
-    0x7ff0000000000001ll /*SNaN*/,
-    0x7ff8000000000000ll /*QNaN*/,
-    0x7ffffffffffffffell, 0x7fffffffffffffffll, 0x8000000000000000ll,
-    0x8000000000000001ll, 0xfffffffffffffffell, 0xffffffffffffffffll };
+    0,                               1,
+    0x7e,                            0x7f,
+    0x80,                            0x81,
+    0xfe,                            0xff,
+    0x7ffe,                          0x7fff,
+    0x8000,                          0x8001,
+    0xfffe,                          0xffff,
+    0x007fffff /*Max subnormal + */, 0x00800000 /*Min+ */,
+    0x7f7fffff /*Max+ */,            0x7f800000 /*+Inf*/,
+    0xff800000 /*-Inf*/,             0x7fa00000 /*SNaN*/,
+    0x7fc00000 /*QNaN*/,             0x7ffffffe,
+    0x7fffffff,                      0x80000000,
+    0x80000001,                      0xfffffffe,
+    0xffffffff,                      0x100000000ll,
+    0x100000001ll,                   0x000fffffffffffffll /*Max subnormal + */,
+    0x0010000000000000ll /*Min+ */,  0x7fefffffffffffffll /*Max+ */,
+    0x7ff0000000000000ll /*+Inf*/,   0xfff0000000000000ll /*-Inf*/,
+    0x7ff0000000000001ll /*SNaN*/,   0x7ff8000000000000ll /*QNaN*/,
+    0x7ffffffffffffffell,            0x7fffffffffffffffll,
+    0x8000000000000000ll,            0x8000000000000001ll,
+    0xfffffffffffffffell,            0xffffffffffffffffll};
 
 const static size_t NumValues = sizeof(Values) / sizeof(*Values);
 
@@ -65,27 +65,21 @@
 } AtomicLocs;
 
 template <typename Type>
-void testAtomicRMW(volatile Type *AtomicLoc,
-                   size_t &TotalTests, size_t &Passes, size_t &Failures) {
-  typedef Type (*FuncType)(bool, volatile Type*, Type);
+void testAtomicRMW(volatile Type *AtomicLoc, size_t &TotalTests, size_t &Passes,
+                   size_t &Failures) {
+  typedef Type (*FuncType)(bool, volatile Type *, Type);
   static struct {
     const char *Name;
     FuncType FuncLlc;
     FuncType FuncSz;
   } Funcs[] = {
-#define X(inst)                                                             \
-  {                                                                         \
-    STR(inst), test_##inst, Subzero_::test_##inst                           \
-  },                                                                        \
-  {                                                                         \
-    STR(inst) "_alloca", test_alloca_##inst, Subzero_::test_alloca_##inst   \
-  },                                                                        \
-  {                                                                         \
-    STR(inst) "_const", test_const_##inst, Subzero_::test_const_##inst      \
-  },
-      RMWOP_TABLE
+#define X(inst)                                                                \
+  { STR(inst), test_##inst, Subzero_::test_##inst }                            \
+  , {STR(inst) "_alloca", test_alloca_##inst, Subzero_::test_alloca_##inst},   \
+      {STR(inst) "_const", test_const_##inst, Subzero_::test_const_##inst},
+        RMWOP_TABLE
 #undef X
-  };
+    };
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
 
   for (size_t f = 0; f < NumFuncs; ++f) {
@@ -97,26 +91,22 @@
           bool fetch_first = k;
           ++TotalTests;
           *AtomicLoc = Value1;
-          Type ResultSz1 = Funcs[f].FuncSz(
-              fetch_first, AtomicLoc, Value2);
+          Type ResultSz1 = Funcs[f].FuncSz(fetch_first, AtomicLoc, Value2);
           Type ResultSz2 = *AtomicLoc;
           *AtomicLoc = Value1;
-          Type ResultLlc1 = Funcs[f].FuncLlc(
-              fetch_first, AtomicLoc, Value2);
+          Type ResultLlc1 = Funcs[f].FuncLlc(fetch_first, AtomicLoc, Value2);
           Type ResultLlc2 = *AtomicLoc;
           if (ResultSz1 == ResultLlc1 && ResultSz2 == ResultLlc2) {
             ++Passes;
           } else {
             ++Failures;
-            std::cout << "test_" << Funcs[f].Name
-                      << (CHAR_BIT * sizeof(Type)) << "("
-                      << static_cast<uint64_t>(Value1) << ", "
+            std::cout << "test_" << Funcs[f].Name << (CHAR_BIT * sizeof(Type))
+                      << "(" << static_cast<uint64_t>(Value1) << ", "
                       << static_cast<uint64_t>(Value2)
                       << "): sz1=" << static_cast<uint64_t>(ResultSz1)
                       << " llc1=" << static_cast<uint64_t>(ResultLlc1)
                       << " sz2=" << static_cast<uint64_t>(ResultSz2)
-                      << " llc2=" << static_cast<uint64_t>(ResultLlc2)
-                      << "\n";
+                      << " llc2=" << static_cast<uint64_t>(ResultLlc2) << "\n";
           }
         }
       }
@@ -170,18 +160,16 @@
   }
 }
 
-template <typename Type>
-struct ThreadData {
-  Type (*FuncPtr)(bool, volatile Type*, Type);
+template <typename Type> struct ThreadData {
+  Type (*FuncPtr)(bool, volatile Type *, Type);
   bool Fetch;
   volatile Type *Ptr;
   Type Adjustment;
 };
 
-template <typename Type>
-void *threadWrapper(void *Data) {
+template <typename Type> void *threadWrapper(void *Data) {
   const size_t NumReps = 8000;
-  ThreadData<Type> *TData = reinterpret_cast<ThreadData<Type>*>(Data);
+  ThreadData<Type> *TData = reinterpret_cast<ThreadData<Type> *>(Data);
   for (size_t i = 0; i < NumReps; ++i) {
     (void)TData->FuncPtr(TData->Fetch, TData->Ptr, TData->Adjustment);
   }
@@ -191,26 +179,22 @@
 template <typename Type>
 void testAtomicRMWThreads(volatile Type *AtomicLoc, size_t &TotalTests,
                           size_t &Passes, size_t &Failures) {
-  typedef Type (*FuncType)(bool, volatile Type*, Type);
+  typedef Type (*FuncType)(bool, volatile Type *, Type);
   static struct {
     const char *Name;
     FuncType FuncLlc;
     FuncType FuncSz;
   } Funcs[] = {
-#define X(inst)                                                             \
-  {                                                                         \
-    STR(inst), test_##inst, Subzero_::test_##inst                           \
-  },                                                                        \
-  {                                                                         \
-    STR(inst) "_alloca", test_alloca_##inst, Subzero_::test_alloca_##inst   \
-  },
-      RMWOP_TABLE
+#define X(inst)                                                                \
+  { STR(inst), test_##inst, Subzero_::test_##inst }                            \
+  , {STR(inst) "_alloca", test_alloca_##inst, Subzero_::test_alloca_##inst},
+        RMWOP_TABLE
 #undef X
-  };
+    };
   const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
 
   // Just test a few values, otherwise it takes a *really* long time.
-  volatile uint64_t ValuesSubset[] = { 1, 0x7e, 0x000fffffffffffffffll };
+  volatile uint64_t ValuesSubset[] = {1, 0x7e, 0x000fffffffffffffffll};
   const size_t NumValuesSubset = sizeof(ValuesSubset) / sizeof(*ValuesSubset);
 
   for (size_t f = 0; f < NumFuncs; ++f) {
@@ -219,10 +203,10 @@
       for (size_t j = 0; j < NumValuesSubset; ++j) {
         Type Value2 = static_cast<Type>(ValuesSubset[j]);
         bool fetch_first = true;
-        ThreadData<Type> TDataSz = {
-          Funcs[f].FuncSz, fetch_first, AtomicLoc, Value2 };
-        ThreadData<Type> TDataLlc = {
-          Funcs[f].FuncLlc, fetch_first, AtomicLoc, Value2 };
+        ThreadData<Type> TDataSz = {Funcs[f].FuncSz, fetch_first, AtomicLoc,
+                                    Value2};
+        ThreadData<Type> TDataLlc = {Funcs[f].FuncLlc, fetch_first, AtomicLoc,
+                                     Value2};
         ++TotalTests;
         const size_t NumThreads = 4;
         pthread_t t[NumThreads];
@@ -243,8 +227,8 @@
         for (size_t m = 0; m < NumThreads; ++m) {
           if (pthread_create(&t[m], NULL, &threadWrapper<Type>,
                              m % 2 == 0
-                             ? reinterpret_cast<void *>(&TDataLlc)
-                             : reinterpret_cast<void *>(&TDataSz)) != 0) {
+                                 ? reinterpret_cast<void *>(&TDataLlc)
+                                 : reinterpret_cast<void *>(&TDataSz)) != 0) {
             ++Failures;
             std::cout << "pthread_create failed w/ " << strerror(errno) << "\n";
             abort();
@@ -268,8 +252,7 @@
                     << static_cast<uint64_t>(Value1) << ", "
                     << static_cast<uint64_t>(Value2)
                     << "): llc=" << static_cast<uint64_t>(ResultLlc)
-                    << " mixed=" << static_cast<uint64_t>(ResultMixed)
-                    << "\n";
+                    << " mixed=" << static_cast<uint64_t>(ResultMixed) << "\n";
         }
       }
     }
@@ -285,22 +268,17 @@
   testAtomicRMW<uint16_t>(&AtomicLocs.l16, TotalTests, Passes, Failures);
   testAtomicRMW<uint32_t>(&AtomicLocs.l32, TotalTests, Passes, Failures);
   testAtomicRMW<uint64_t>(&AtomicLocs.l64, TotalTests, Passes, Failures);
-  testValCompareAndSwap<uint8_t>(
-      &AtomicLocs.l8, TotalTests, Passes, Failures);
-  testValCompareAndSwap<uint16_t>(
-      &AtomicLocs.l16, TotalTests, Passes, Failures);
-  testValCompareAndSwap<uint32_t>(
-      &AtomicLocs.l32, TotalTests, Passes, Failures);
-  testValCompareAndSwap<uint64_t>(
-      &AtomicLocs.l64, TotalTests, Passes, Failures);
-  testAtomicRMWThreads<uint8_t>(
-      &AtomicLocs.l8, TotalTests, Passes, Failures);
-  testAtomicRMWThreads<uint16_t>(
-      &AtomicLocs.l16, TotalTests, Passes, Failures);
-  testAtomicRMWThreads<uint32_t>(
-      &AtomicLocs.l32, TotalTests, Passes, Failures);
-  testAtomicRMWThreads<uint64_t>(
-      &AtomicLocs.l64, TotalTests, Passes, Failures);
+  testValCompareAndSwap<uint8_t>(&AtomicLocs.l8, TotalTests, Passes, Failures);
+  testValCompareAndSwap<uint16_t>(&AtomicLocs.l16, TotalTests, Passes,
+                                  Failures);
+  testValCompareAndSwap<uint32_t>(&AtomicLocs.l32, TotalTests, Passes,
+                                  Failures);
+  testValCompareAndSwap<uint64_t>(&AtomicLocs.l64, TotalTests, Passes,
+                                  Failures);
+  testAtomicRMWThreads<uint8_t>(&AtomicLocs.l8, TotalTests, Passes, Failures);
+  testAtomicRMWThreads<uint16_t>(&AtomicLocs.l16, TotalTests, Passes, Failures);
+  testAtomicRMWThreads<uint32_t>(&AtomicLocs.l32, TotalTests, Passes, Failures);
+  testAtomicRMWThreads<uint64_t>(&AtomicLocs.l64, TotalTests, Passes, Failures);
 
   std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes
             << " Failures=" << Failures << "\n";
diff --git a/runtime/szrt.c b/runtime/szrt.c
index 3596db3..d9d578a 100644
--- a/runtime/szrt.c
+++ b/runtime/szrt.c
@@ -15,57 +15,31 @@
 #include <stdint.h>
 #include <stdlib.h>
 
-void ice_unreachable(void) {
-  abort();
-}
+void ice_unreachable(void) { abort(); }
 
-uint32_t cvtftoui32(float value) {
-  return (uint32_t) value;
-}
+uint32_t cvtftoui32(float value) { return (uint32_t)value; }
 
-uint32_t cvtdtoui32(double value) {
-  return (uint32_t) value;
-}
+uint32_t cvtdtoui32(double value) { return (uint32_t)value; }
 
-int64_t cvtftosi64(float value) {
-  return (int64_t) value;
-}
+int64_t cvtftosi64(float value) { return (int64_t)value; }
 
-int64_t cvtdtosi64(double value) {
-  return (int64_t) value;
-}
+int64_t cvtdtosi64(double value) { return (int64_t)value; }
 
-uint64_t cvtftoui64(float value) {
-  return (uint64_t) value;
-}
+uint64_t cvtftoui64(float value) { return (uint64_t)value; }
 
-uint64_t cvtdtoui64(double value) {
-  return (uint64_t) value;
-}
+uint64_t cvtdtoui64(double value) { return (uint64_t)value; }
 
-float cvtui32tof(uint32_t value) {
-  return (float) value;
-}
+float cvtui32tof(uint32_t value) { return (float)value; }
 
-float cvtsi64tof(int64_t value) {
-  return (float) value;
-}
+float cvtsi64tof(int64_t value) { return (float)value; }
 
-float cvtui64tof(uint64_t value) {
-  return (float) value;
-}
+float cvtui64tof(uint64_t value) { return (float)value; }
 
-double cvtui32tod(uint32_t value) {
-  return (double) value;
-}
+double cvtui32tod(uint32_t value) { return (double)value; }
 
-double cvtsi64tod(int64_t value) {
-  return (double) value;
-}
+double cvtsi64tod(int64_t value) { return (double)value; }
 
-double cvtui64tod(uint64_t value) {
-  return (double) value;
-}
+double cvtui64tod(uint64_t value) { return (double)value; }
 
 /* TODO(stichnot):
    Sz_bitcast_v8i1_to_i8
diff --git a/src/IceCfg.h b/src/IceCfg.h
index 5f827f5..71f0a0d 100644
--- a/src/IceCfg.h
+++ b/src/IceCfg.h
@@ -95,9 +95,7 @@
   const IceString &getIdentifierName(IdentifierIndexType Index) const {
     return IdentifierNames[Index];
   }
-  enum {
-    IdentifierIndexInvalid = -1
-  };
+  enum { IdentifierIndexInvalid = -1 };
 
   // Manage instruction numbering.
   InstNumberT newInstNumber() { return NextInstNumber++; }
@@ -201,7 +199,7 @@
   std::vector<IceString> IdentifierNames;
   InstNumberT NextInstNumber;
   VarList Variables;
-  VarList Args; // subset of Variables, in argument order
+  VarList Args;         // subset of Variables, in argument order
   VarList ImplicitArgs; // subset of Variables
   std::unique_ptr<ArenaAllocator<>> Allocator;
   std::unique_ptr<Liveness> Live;
diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp
index 7f96454..8fb06b8 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -820,8 +820,7 @@
     for (SizeT J = 0; J < NumVars; ++J) {
       const Variable *Var = Src->getVar(J);
       if (Var->hasReg()) {
-        if (Instr->isLastUse(Var) &&
-            --LiveRegCount[Var->getRegNum()] == 0) {
+        if (Instr->isLastUse(Var) && --LiveRegCount[Var->getRegNum()] == 0) {
           if (First)
             Str << " \t# END=";
           else
@@ -943,8 +942,9 @@
         Variable *Var = Liveness->getVariable(i, this);
         Str << " %" << Var->getName(Func);
         if (Func->isVerbose(IceV_RegOrigins) && Var->hasReg()) {
-          Str << ":" << Func->getTarget()->getRegName(Var->getRegNum(),
-                                                      Var->getType());
+          Str << ":"
+              << Func->getTarget()->getRegName(Var->getRegNum(),
+                                               Var->getType());
         }
       }
     }
@@ -968,8 +968,9 @@
         Variable *Var = Liveness->getVariable(i, this);
         Str << " %" << Var->getName(Func);
         if (Func->isVerbose(IceV_RegOrigins) && Var->hasReg()) {
-          Str << ":" << Func->getTarget()->getRegName(Var->getRegNum(),
-                                                      Var->getType());
+          Str << ":"
+              << Func->getTarget()->getRegName(Var->getRegNum(),
+                                               Var->getType());
         }
       }
     }
diff --git a/src/IceCfgNode.h b/src/IceCfgNode.h
index c5b9ac5..e3c3ee7 100644
--- a/src/IceCfgNode.h
+++ b/src/IceCfgNode.h
@@ -91,15 +91,15 @@
 private:
   CfgNode(Cfg *Func, SizeT LabelIndex);
   Cfg *const Func;
-  const SizeT Number; // label index
+  const SizeT Number;                 // label index
   Cfg::IdentifierIndexType NameIndex; // index into Cfg::NodeNames table
-  bool HasReturn;     // does this block need an epilog?
+  bool HasReturn;                     // does this block need an epilog?
   bool NeedsPlacement;
   InstNumberT InstCountEstimate; // rough instruction count estimate
-  NodeList InEdges;   // in no particular order
-  NodeList OutEdges;  // in no particular order
-  PhiList Phis;       // unordered set of phi instructions
-  InstList Insts;     // ordered list of non-phi instructions
+  NodeList InEdges;              // in no particular order
+  NodeList OutEdges;             // in no particular order
+  PhiList Phis;                  // unordered set of phi instructions
+  InstList Insts;                // ordered list of non-phi instructions
 };
 
 } // end of namespace Ice
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp
index 0bbcfb7..0be0f28 100644
--- a/src/IceConverter.cpp
+++ b/src/IceConverter.cpp
@@ -690,7 +690,7 @@
     const GlobalVariable *GV = I;
 
     Ice::GlobalDeclaration *Var = getConverter().getGlobalDeclaration(GV);
-    Ice::VariableDeclaration* VarDecl = cast<Ice::VariableDeclaration>(Var);
+    Ice::VariableDeclaration *VarDecl = cast<Ice::VariableDeclaration>(Var);
     VariableDeclarations.push_back(VarDecl);
 
     if (!GV->hasInternalLinkage() && GV->hasInitializer()) {
diff --git a/src/IceDefs.h b/src/IceDefs.h
index 051edbb..55e09ac 100644
--- a/src/IceDefs.h
+++ b/src/IceDefs.h
@@ -126,9 +126,7 @@
 // Use alignas(MaxCacheLineSize) to isolate variables/fields that
 // might be contended while multithreading.  Assumes the maximum cache
 // line size is 64.
-enum {
-  MaxCacheLineSize = 64
-};
+enum { MaxCacheLineSize = 64 };
 // Use ICE_CACHELINE_BOUNDARY to force the next field in a declaration
 // list to be aligned to the next cache line.
 #define ICE_CACHELINE_BOUNDARY                                                 \
@@ -179,12 +177,7 @@
 
 typedef std::mutex GlobalLockType;
 
-enum ErrorCodes {
-  EC_None = 0,
-  EC_Args,
-  EC_Bitcode,
-  EC_Translation
-};
+enum ErrorCodes { EC_None = 0, EC_Args, EC_Bitcode, EC_Translation };
 
 // Wrapper around std::error_code for allowing multiple errors to be
 // folded into one.  The current implementation keeps track of the
diff --git a/src/IceELFObjectWriter.cpp b/src/IceELFObjectWriter.cpp
index f1b698b..c4ff4f0 100644
--- a/src/IceELFObjectWriter.cpp
+++ b/src/IceELFObjectWriter.cpp
@@ -34,7 +34,7 @@
 #define X(tag, str, is_elf64, e_machine, e_flags)                              \
   { is_elf64, e_machine, e_flags }                                             \
   ,
-    TARGETARCH_TABLE
+      TARGETARCH_TABLE
 #undef X
 };
 
diff --git a/src/IceGlobalContext.h b/src/IceGlobalContext.h
index dfa665b..ac321e6 100644
--- a/src/IceGlobalContext.h
+++ b/src/IceGlobalContext.h
@@ -209,11 +209,7 @@
   }
 
   // These are predefined TimerStackIdT values.
-  enum TimerStackKind {
-    TSK_Default = 0,
-    TSK_Funcs,
-    TSK_Num
-  };
+  enum TimerStackKind { TSK_Default = 0, TSK_Funcs, TSK_Num };
 
   TimerStackIdT newTimerStackID(const IceString &Name);
   TimerIdT getTimerID(TimerStackIdT StackID, const IceString &Name);
diff --git a/src/IceGlobalInits.cpp b/src/IceGlobalInits.cpp
index 4f209f8..c9bdf99 100644
--- a/src/IceGlobalInits.cpp
+++ b/src/IceGlobalInits.cpp
@@ -123,8 +123,9 @@
 void VariableDeclaration::dump(GlobalContext *Ctx, Ostream &Stream) const {
   if (!ALLOW_DUMP)
     return;
-  Stream << "@" << ((Ctx && !getSuppressMangling())
-                    ? Ctx->mangleName(Name) : Name) << " = ";
+  Stream << "@"
+         << ((Ctx && !getSuppressMangling()) ? Ctx->mangleName(Name) : Name)
+         << " = ";
   ::dumpLinkage(Stream, Linkage);
   Stream << " " << (IsConstant ? "constant" : "global") << " ";
 
@@ -158,8 +159,8 @@
   Stream << "[" << getNumBytes() << " x " << Ice::IceType_i8 << "]";
 }
 
-void VariableDeclaration::DataInitializer::dump(
-    GlobalContext *, Ostream &Stream) const {
+void VariableDeclaration::DataInitializer::dump(GlobalContext *,
+                                                Ostream &Stream) const {
   if (!ALLOW_DUMP)
     return;
   dumpType(Stream);
@@ -176,8 +177,8 @@
   Stream << "\"";
 }
 
-void VariableDeclaration::ZeroInitializer::dump(
-    GlobalContext *, Ostream &Stream) const {
+void VariableDeclaration::ZeroInitializer::dump(GlobalContext *,
+                                                Ostream &Stream) const {
   if (!ALLOW_DUMP)
     return;
   dumpType(Stream);
@@ -190,8 +191,8 @@
   Stream << Ice::IceType_i32;
 }
 
-void VariableDeclaration::RelocInitializer::dump(
-    GlobalContext *Ctx, Ostream &Stream) const {
+void VariableDeclaration::RelocInitializer::dump(GlobalContext *Ctx,
+                                                 Ostream &Stream) const {
   if (!ALLOW_DUMP)
     return;
   if (Offset != 0) {
diff --git a/src/IceGlobalInits.h b/src/IceGlobalInits.h
index 0d560a1..3478a98 100644
--- a/src/IceGlobalInits.h
+++ b/src/IceGlobalInits.h
@@ -107,9 +107,7 @@
   }
   void dumpType(Ostream &Stream) const final;
   void dump(GlobalContext *Ctx, Ostream &Stream) const final;
-  bool getSuppressMangling() const final {
-    return isExternal() && IsProto;
-  }
+  bool getSuppressMangling() const final { return isExternal() && IsProto; }
 
 private:
   const Ice::FuncSigType Signature;
@@ -127,6 +125,7 @@
 class VariableDeclaration : public GlobalDeclaration {
   VariableDeclaration(const VariableDeclaration &) = delete;
   VariableDeclaration &operator=(const VariableDeclaration &) = delete;
+
 public:
   /// Base class for a global variable initializer.
   class Initializer {
diff --git a/src/IceInst.cpp b/src/IceInst.cpp
index 86886a6..3327455 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -30,9 +30,9 @@
 #define X(tag, str, commutative)                                               \
   { str, commutative }                                                         \
   ,
-    ICEINSTARITHMETIC_TABLE
+      ICEINSTARITHMETIC_TABLE
 #undef X
-  };
+};
 
 // Using non-anonymous struct so that array_lengthof works.
 const struct InstCastAttributes_ {
@@ -41,9 +41,9 @@
 #define X(tag, str)                                                            \
   { str }                                                                      \
   ,
-    ICEINSTCAST_TABLE
+      ICEINSTCAST_TABLE
 #undef X
-  };
+};
 
 // Using non-anonymous struct so that array_lengthof works.
 const struct InstFcmpAttributes_ {
@@ -52,9 +52,9 @@
 #define X(tag, str)                                                            \
   { str }                                                                      \
   ,
-    ICEINSTFCMP_TABLE
+      ICEINSTFCMP_TABLE
 #undef X
-  };
+};
 
 // Using non-anonymous struct so that array_lengthof works.
 const struct InstIcmpAttributes_ {
@@ -63,9 +63,9 @@
 #define X(tag, str)                                                            \
   { str }                                                                      \
   ,
-    ICEINSTICMP_TABLE
+      ICEINSTICMP_TABLE
 #undef X
-  };
+};
 
 } // end of anonymous namespace
 
diff --git a/src/IceInstX8632.cpp b/src/IceInstX8632.cpp
index 9bb136d..30edb9e 100644
--- a/src/IceInstX8632.cpp
+++ b/src/IceInstX8632.cpp
@@ -34,9 +34,9 @@
 #define X(tag, encode, opp, dump, emit)                                        \
   { CondX86::opp, dump, emit }                                                 \
   ,
-    ICEINSTX8632BR_TABLE
+      ICEINSTX8632BR_TABLE
 #undef X
-  };
+};
 
 const struct InstX8632CmppsAttributes_ {
   const char *EmitString;
@@ -44,9 +44,9 @@
 #define X(tag, emit)                                                           \
   { emit }                                                                     \
   ,
-    ICEINSTX8632CMPPS_TABLE
+      ICEINSTX8632CMPPS_TABLE
 #undef X
-  };
+};
 
 const struct TypeX8632Attributes_ {
   const char *CvtString;   // i (integer), s (single FP), d (double FP)
@@ -58,9 +58,9 @@
 #define X(tag, elementty, cvt, sdss, pack, width, fld)                         \
   { cvt, sdss, pack, width, fld }                                              \
   ,
-    ICETYPEX8632_TABLE
+      ICETYPEX8632_TABLE
 #undef X
-  };
+};
 
 const char *InstX8632SegmentRegNames[] = {
 #define X(val, name, prefix) name,
@@ -900,7 +900,8 @@
 // Inplace GPR ops
 template <>
 const x86::AssemblerX86::GPREmitterOneOp InstX8632Bswap::Emitter = {
-    &x86::AssemblerX86::bswap, nullptr /* only a reg form exists */};
+    &x86::AssemblerX86::bswap, nullptr /* only a reg form exists */
+};
 template <>
 const x86::AssemblerX86::GPREmitterOneOp InstX8632Neg::Emitter = {
     &x86::AssemblerX86::neg, &x86::AssemblerX86::neg};
@@ -926,8 +927,7 @@
 // Unary XMM ops
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Sqrtss::Emitter = {
-  &x86::AssemblerX86::sqrtss, &x86::AssemblerX86::sqrtss
-};
+    &x86::AssemblerX86::sqrtss, &x86::AssemblerX86::sqrtss};
 
 // Binary GPR ops
 template <>
@@ -969,76 +969,58 @@
 // Binary XMM ops
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Addss::Emitter = {
-  &x86::AssemblerX86::addss, &x86::AssemblerX86::addss
-};
+    &x86::AssemblerX86::addss, &x86::AssemblerX86::addss};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Addps::Emitter = {
-  &x86::AssemblerX86::addps, &x86::AssemblerX86::addps
-};
+    &x86::AssemblerX86::addps, &x86::AssemblerX86::addps};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Divss::Emitter = {
-  &x86::AssemblerX86::divss, &x86::AssemblerX86::divss
-};
+    &x86::AssemblerX86::divss, &x86::AssemblerX86::divss};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Divps::Emitter = {
-  &x86::AssemblerX86::divps, &x86::AssemblerX86::divps
-};
+    &x86::AssemblerX86::divps, &x86::AssemblerX86::divps};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Mulss::Emitter = {
-  &x86::AssemblerX86::mulss, &x86::AssemblerX86::mulss
-};
+    &x86::AssemblerX86::mulss, &x86::AssemblerX86::mulss};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Mulps::Emitter = {
-  &x86::AssemblerX86::mulps, &x86::AssemblerX86::mulps
-};
+    &x86::AssemblerX86::mulps, &x86::AssemblerX86::mulps};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Padd::Emitter = {
-  &x86::AssemblerX86::padd, &x86::AssemblerX86::padd
-};
+    &x86::AssemblerX86::padd, &x86::AssemblerX86::padd};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Pand::Emitter = {
-  &x86::AssemblerX86::pand, &x86::AssemblerX86::pand
-};
+    &x86::AssemblerX86::pand, &x86::AssemblerX86::pand};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Pandn::Emitter = {
-  &x86::AssemblerX86::pandn, &x86::AssemblerX86::pandn
-};
+    &x86::AssemblerX86::pandn, &x86::AssemblerX86::pandn};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Pcmpeq::Emitter = {
-  &x86::AssemblerX86::pcmpeq, &x86::AssemblerX86::pcmpeq
-};
+    &x86::AssemblerX86::pcmpeq, &x86::AssemblerX86::pcmpeq};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Pcmpgt::Emitter = {
-  &x86::AssemblerX86::pcmpgt, &x86::AssemblerX86::pcmpgt
-};
+    &x86::AssemblerX86::pcmpgt, &x86::AssemblerX86::pcmpgt};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Pmull::Emitter = {
-  &x86::AssemblerX86::pmull, &x86::AssemblerX86::pmull
-};
+    &x86::AssemblerX86::pmull, &x86::AssemblerX86::pmull};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Pmuludq::Emitter = {
-  &x86::AssemblerX86::pmuludq, &x86::AssemblerX86::pmuludq
-};
+    &x86::AssemblerX86::pmuludq, &x86::AssemblerX86::pmuludq};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Por::Emitter = {
-  &x86::AssemblerX86::por, &x86::AssemblerX86::por
-};
+    &x86::AssemblerX86::por, &x86::AssemblerX86::por};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Psub::Emitter = {
-  &x86::AssemblerX86::psub, &x86::AssemblerX86::psub
-};
+    &x86::AssemblerX86::psub, &x86::AssemblerX86::psub};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Pxor::Emitter = {
-  &x86::AssemblerX86::pxor, &x86::AssemblerX86::pxor
-};
+    &x86::AssemblerX86::pxor, &x86::AssemblerX86::pxor};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Subss::Emitter = {
-  &x86::AssemblerX86::subss, &x86::AssemblerX86::subss
-};
+    &x86::AssemblerX86::subss, &x86::AssemblerX86::subss};
 template <>
 const x86::AssemblerX86::XmmEmitterRegOp InstX8632Subps::Emitter = {
-  &x86::AssemblerX86::subps, &x86::AssemblerX86::subps
-};
+    &x86::AssemblerX86::subps, &x86::AssemblerX86::subps};
 
 // Binary XMM Shift ops
 template <>
@@ -1756,11 +1738,10 @@
   const Operand *Src1 = getSrc(1);
   Type Ty = Src0->getType();
   static const x86::AssemblerX86::GPREmitterRegOp RegEmitter = {
-    &x86::AssemblerX86::cmp, &x86::AssemblerX86::cmp, &x86::AssemblerX86::cmp
-  };
+      &x86::AssemblerX86::cmp, &x86::AssemblerX86::cmp,
+      &x86::AssemblerX86::cmp};
   static const x86::AssemblerX86::GPREmitterAddrOp AddrEmitter = {
-    &x86::AssemblerX86::cmp, &x86::AssemblerX86::cmp
-  };
+      &x86::AssemblerX86::cmp, &x86::AssemblerX86::cmp};
   if (const auto SrcVar0 = llvm::dyn_cast<Variable>(Src0)) {
     if (SrcVar0->hasReg()) {
       emitIASRegOpTyGPR(Func, Ty, SrcVar0, Src1, RegEmitter);
@@ -1798,8 +1779,7 @@
   const auto Src0Var = llvm::cast<Variable>(getSrc(0));
   Type Ty = Src0Var->getType();
   const static x86::AssemblerX86::XmmEmitterRegOp Emitter = {
-    &x86::AssemblerX86::ucomiss, &x86::AssemblerX86::ucomiss
-  };
+      &x86::AssemblerX86::ucomiss, &x86::AssemblerX86::ucomiss};
   emitIASRegOpTyXMM(Func, Ty, Src0Var, getSrc(1), Emitter);
 }
 
@@ -1851,8 +1831,7 @@
   static const x86::AssemblerX86::GPREmitterRegOp RegEmitter = {
       &x86::AssemblerX86::test, nullptr, &x86::AssemblerX86::test};
   static const x86::AssemblerX86::GPREmitterAddrOp AddrEmitter = {
-    &x86::AssemblerX86::test, &x86::AssemblerX86::test
-  };
+      &x86::AssemblerX86::test, &x86::AssemblerX86::test};
   if (const auto SrcVar0 = llvm::dyn_cast<Variable>(Src0)) {
     if (SrcVar0->hasReg()) {
       emitIASRegOpTyGPR(Func, Ty, SrcVar0, Src1, RegEmitter);
@@ -2181,9 +2160,8 @@
   const Variable *Dest = getDest();
   const Operand *Src = getSrc(0);
   const static x86::AssemblerX86::XmmEmitterMovOps Emitter = {
-    &x86::AssemblerX86::movups, &x86::AssemblerX86::movups,
-    &x86::AssemblerX86::movups
-  };
+      &x86::AssemblerX86::movups, &x86::AssemblerX86::movups,
+      &x86::AssemblerX86::movups};
   emitIASMovlikeXMM(Func, Dest, Src, Emitter);
 }
 
@@ -2207,8 +2185,8 @@
   const Variable *Dest = getDest();
   const Operand *Src = getSrc(0);
   const static x86::AssemblerX86::XmmEmitterMovOps Emitter = {
-    &x86::AssemblerX86::movq, &x86::AssemblerX86::movq, &x86::AssemblerX86::movq
-  };
+      &x86::AssemblerX86::movq, &x86::AssemblerX86::movq,
+      &x86::AssemblerX86::movq};
   emitIASMovlikeXMM(Func, Dest, Src, Emitter);
 }
 
@@ -2432,10 +2410,10 @@
   // pextrb and pextrd are SSE4.1 instructions.
   assert(getSrc(0)->getType() == IceType_v8i16 ||
          getSrc(0)->getType() == IceType_v8i1 ||
-         static_cast<TargetX8632 *>(Func->getTarget())->getInstructionSet()
-             >= TargetX8632::SSE4_1);
-  Str << "\t" << Opcode
-      << TypeX8632Attributes[getSrc(0)->getType()].PackString << "\t";
+         static_cast<TargetX8632 *>(Func->getTarget())->getInstructionSet() >=
+             TargetX8632::SSE4_1);
+  Str << "\t" << Opcode << TypeX8632Attributes[getSrc(0)->getType()].PackString
+      << "\t";
   getSrc(1)->emit(Func);
   Str << ", ";
   getSrc(0)->emit(Func);
@@ -2478,10 +2456,10 @@
   // pinsrb and pinsrd are SSE4.1 instructions.
   assert(getDest()->getType() == IceType_v8i16 ||
          getDest()->getType() == IceType_v8i1 ||
-         static_cast<TargetX8632 *>(Func->getTarget())->getInstructionSet()
-             >= TargetX8632::SSE4_1);
-  Str << "\t" << Opcode
-      << TypeX8632Attributes[getDest()->getType()].PackString << "\t";
+         static_cast<TargetX8632 *>(Func->getTarget())->getInstructionSet() >=
+             TargetX8632::SSE4_1);
+  Str << "\t" << Opcode << TypeX8632Attributes[getDest()->getType()].PackString
+      << "\t";
   getSrc(2)->emit(Func);
   Str << ", ";
   Operand *Src1 = getSrc(1);
diff --git a/src/IceInstX8632.h b/src/IceInstX8632.h
index e63e628..7725ad7 100644
--- a/src/IceInstX8632.h
+++ b/src/IceInstX8632.h
@@ -34,11 +34,7 @@
   OperandX8632 &operator=(const OperandX8632 &) = delete;
 
 public:
-  enum OperandKindX8632 {
-    k__Start = Operand::kTarget,
-    kMem,
-    kSplit
-  };
+  enum OperandKindX8632 { k__Start = Operand::kTarget, kMem, kSplit };
   using Operand::dump;
   void dump(const Cfg *, Ostream &Str) const override {
     if (ALLOW_DUMP)
@@ -110,10 +106,7 @@
   VariableSplit &operator=(const VariableSplit &) = delete;
 
 public:
-  enum Portion {
-    Low,
-    High
-  };
+  enum Portion { Low, High };
   static VariableSplit *create(Cfg *Func, Variable *Var, Portion Part) {
     return new (Func->allocate<VariableSplit>()) VariableSplit(Func, Var, Part);
   }
@@ -1464,8 +1457,7 @@
 
 public:
   static InstX8632Push *create(Cfg *Func, Variable *Source) {
-    return new (Func->allocate<InstX8632Push>())
-        InstX8632Push(Func, Source);
+    return new (Func->allocate<InstX8632Push>()) InstX8632Push(Func, Source);
   }
   void emit(const Cfg *Func) const override;
   void emitIAS(const Cfg *Func) const override;
diff --git a/src/IceIntrinsics.cpp b/src/IceIntrinsics.cpp
index 16d07e1..29b8ad2 100644
--- a/src/IceIntrinsics.cpp
+++ b/src/IceIntrinsics.cpp
@@ -28,7 +28,8 @@
 
 namespace {
 
-#define INTRIN(ID, SE, RT) { Intrinsics::ID, Intrinsics::SE, Intrinsics::RT }
+#define INTRIN(ID, SE, RT)                                                     \
+  { Intrinsics::ID, Intrinsics::SE, Intrinsics::RT }
 
 // Build list of intrinsics with their attributes and expected prototypes.
 // List is sorted alphabetically.
@@ -40,163 +41,169 @@
 #define AtomicCmpxchgInit(Overload, NameSuffix)                                \
   {                                                                            \
     {                                                                          \
-      INTRIN(AtomicCmpxchg, SideEffects_T, ReturnsTwice_F),                    \
-      { Overload, IceType_i32, Overload, Overload, IceType_i32, IceType_i32 }, \
-      6 },                                                                     \
-    "nacl.atomic.cmpxchg." NameSuffix                                          \
+      INTRIN(AtomicCmpxchg, SideEffects_T, ReturnsTwice_F), {Overload,         \
+                                                             IceType_i32,      \
+                                                             Overload,         \
+                                                             Overload,         \
+                                                             IceType_i32,      \
+                                                             IceType_i32},     \
+          6                                                                    \
+    }                                                                          \
+    , "nacl.atomic.cmpxchg." NameSuffix                                        \
   }
-    AtomicCmpxchgInit(IceType_i8, "i8"),
-    AtomicCmpxchgInit(IceType_i16, "i16"),
-    AtomicCmpxchgInit(IceType_i32, "i32"),
-    AtomicCmpxchgInit(IceType_i64, "i64"),
+      AtomicCmpxchgInit(IceType_i8, "i8"),
+      AtomicCmpxchgInit(IceType_i16, "i16"),
+      AtomicCmpxchgInit(IceType_i32, "i32"),
+      AtomicCmpxchgInit(IceType_i64, "i64"),
 #undef AtomicCmpxchgInit
 
-    { { INTRIN(AtomicFence, SideEffects_T, ReturnsTwice_F),
-        { IceType_void, IceType_i32 }, 2 },
-      "nacl.atomic.fence" },
-    { { INTRIN(AtomicFenceAll, SideEffects_T, ReturnsTwice_F),
-        { IceType_void }, 1 },
-      "nacl.atomic.fence.all" },
-    { { INTRIN(AtomicIsLockFree, SideEffects_F, ReturnsTwice_F),
-        { IceType_i1, IceType_i32, IceType_i32 }, 3 },
-      "nacl.atomic.is.lock.free" },
+      {{INTRIN(AtomicFence, SideEffects_T, ReturnsTwice_F),
+        {IceType_void, IceType_i32},
+        2},
+       "nacl.atomic.fence"},
+      {{INTRIN(AtomicFenceAll, SideEffects_T, ReturnsTwice_F),
+        {IceType_void},
+        1},
+       "nacl.atomic.fence.all"},
+      {{INTRIN(AtomicIsLockFree, SideEffects_F, ReturnsTwice_F),
+        {IceType_i1, IceType_i32, IceType_i32},
+        3},
+       "nacl.atomic.is.lock.free"},
 
 #define AtomicLoadInit(Overload, NameSuffix)                                   \
   {                                                                            \
     {                                                                          \
       INTRIN(AtomicLoad, SideEffects_T, ReturnsTwice_F),                       \
-      { Overload, IceType_i32, IceType_i32 }, 3 },                             \
-    "nacl.atomic.load." NameSuffix                                             \
+          {Overload, IceType_i32, IceType_i32}, 3                              \
+    }                                                                          \
+    , "nacl.atomic.load." NameSuffix                                           \
   }
-    AtomicLoadInit(IceType_i8, "i8"),
-    AtomicLoadInit(IceType_i16, "i16"),
-    AtomicLoadInit(IceType_i32, "i32"),
-    AtomicLoadInit(IceType_i64, "i64"),
+      AtomicLoadInit(IceType_i8, "i8"),
+      AtomicLoadInit(IceType_i16, "i16"),
+      AtomicLoadInit(IceType_i32, "i32"),
+      AtomicLoadInit(IceType_i64, "i64"),
 #undef AtomicLoadInit
 
 #define AtomicRMWInit(Overload, NameSuffix)                                    \
   {                                                                            \
     {                                                                          \
       INTRIN(AtomicRMW, SideEffects_T, ReturnsTwice_F)                         \
-      , { Overload, IceType_i32, IceType_i32, Overload, IceType_i32 }, 5       \
+      , {Overload, IceType_i32, IceType_i32, Overload, IceType_i32}, 5         \
     }                                                                          \
     , "nacl.atomic.rmw." NameSuffix                                            \
   }
-    AtomicRMWInit(IceType_i8, "i8"),
-    AtomicRMWInit(IceType_i16, "i16"),
-    AtomicRMWInit(IceType_i32, "i32"),
-    AtomicRMWInit(IceType_i64, "i64"),
+      AtomicRMWInit(IceType_i8, "i8"),
+      AtomicRMWInit(IceType_i16, "i16"),
+      AtomicRMWInit(IceType_i32, "i32"),
+      AtomicRMWInit(IceType_i64, "i64"),
 #undef AtomicRMWInit
 
 #define AtomicStoreInit(Overload, NameSuffix)                                  \
   {                                                                            \
     {                                                                          \
       INTRIN(AtomicStore, SideEffects_T, ReturnsTwice_F)                       \
-      , { IceType_void, Overload, IceType_i32, IceType_i32 }, 4                \
+      , {IceType_void, Overload, IceType_i32, IceType_i32}, 4                  \
     }                                                                          \
     , "nacl.atomic.store." NameSuffix                                          \
   }
-    AtomicStoreInit(IceType_i8, "i8"),
-    AtomicStoreInit(IceType_i16, "i16"),
-    AtomicStoreInit(IceType_i32, "i32"),
-    AtomicStoreInit(IceType_i64, "i64"),
+      AtomicStoreInit(IceType_i8, "i8"),
+      AtomicStoreInit(IceType_i16, "i16"),
+      AtomicStoreInit(IceType_i32, "i32"),
+      AtomicStoreInit(IceType_i64, "i64"),
 #undef AtomicStoreInit
 
 #define BswapInit(Overload, NameSuffix)                                        \
   {                                                                            \
     {                                                                          \
       INTRIN(Bswap, SideEffects_F, ReturnsTwice_F)                             \
-      , { Overload, Overload }, 2                                              \
+      , {Overload, Overload}, 2                                                \
     }                                                                          \
     , "bswap." NameSuffix                                                      \
   }
-    BswapInit(IceType_i16, "i16"),
-    BswapInit(IceType_i32, "i32"),
-    BswapInit(IceType_i64, "i64"),
+      BswapInit(IceType_i16, "i16"),
+      BswapInit(IceType_i32, "i32"),
+      BswapInit(IceType_i64, "i64"),
 #undef BswapInit
 
 #define CtlzInit(Overload, NameSuffix)                                         \
   {                                                                            \
     {                                                                          \
       INTRIN(Ctlz, SideEffects_F, ReturnsTwice_F)                              \
-      , { Overload, Overload, IceType_i1 }, 3                                  \
+      , {Overload, Overload, IceType_i1}, 3                                    \
     }                                                                          \
     , "ctlz." NameSuffix                                                       \
   }
-    CtlzInit(IceType_i32, "i32"),
-    CtlzInit(IceType_i64, "i64"),
+      CtlzInit(IceType_i32, "i32"),
+      CtlzInit(IceType_i64, "i64"),
 #undef CtlzInit
 
 #define CtpopInit(Overload, NameSuffix)                                        \
   {                                                                            \
     {                                                                          \
       INTRIN(Ctpop, SideEffects_F, ReturnsTwice_F)                             \
-      , { Overload, Overload }, 2                                              \
+      , {Overload, Overload}, 2                                                \
     }                                                                          \
     , "ctpop." NameSuffix                                                      \
   }
-    CtpopInit(IceType_i32, "i32"),
-    CtpopInit(IceType_i64, "i64"),
+      CtpopInit(IceType_i32, "i32"),
+      CtpopInit(IceType_i64, "i64"),
 #undef CtpopInit
 
 #define CttzInit(Overload, NameSuffix)                                         \
   {                                                                            \
     {                                                                          \
       INTRIN(Cttz, SideEffects_F, ReturnsTwice_F)                              \
-      , { Overload, Overload, IceType_i1 }, 3                                  \
+      , {Overload, Overload, IceType_i1}, 3                                    \
     }                                                                          \
     , "cttz." NameSuffix                                                       \
   }
-    CttzInit(IceType_i32, "i32"),
-    CttzInit(IceType_i64, "i64"),
+      CttzInit(IceType_i32, "i32"),
+      CttzInit(IceType_i64, "i64"),
 #undef CttzInit
 
-    { { INTRIN(Longjmp, SideEffects_T, ReturnsTwice_F),
-        { IceType_void, IceType_i32, IceType_i32 }, 3 },
-      "nacl.longjmp" },
-    { { INTRIN(Memcpy, SideEffects_T, ReturnsTwice_F),
-        { IceType_void, IceType_i32, IceType_i32, IceType_i32, IceType_i32,
-          IceType_i1},
-        6 },
-      "memcpy.p0i8.p0i8.i32" },
-    { { INTRIN(Memmove, SideEffects_T, ReturnsTwice_F),
-        { IceType_void, IceType_i32, IceType_i32, IceType_i32, IceType_i32,
-          IceType_i1 },
-        6 },
-      "memmove.p0i8.p0i8.i32" },
-    { { INTRIN(Memset, SideEffects_T, ReturnsTwice_F),
-        { IceType_void, IceType_i32, IceType_i8, IceType_i32, IceType_i32,
-          IceType_i1 },
-        6 },
-      "memset.p0i8.i32" },
-    { { INTRIN(NaClReadTP, SideEffects_F, ReturnsTwice_F),
-        { IceType_i32 }, 1 },
-      "nacl.read.tp" },
-    { { INTRIN(Setjmp, SideEffects_T, ReturnsTwice_T),
-        { IceType_i32, IceType_i32 }, 2 },
-      "nacl.setjmp" },
+      {{INTRIN(Longjmp, SideEffects_T, ReturnsTwice_F),
+        {IceType_void, IceType_i32, IceType_i32},
+        3},
+       "nacl.longjmp"},
+      {{INTRIN(Memcpy, SideEffects_T, ReturnsTwice_F),
+        {IceType_void, IceType_i32, IceType_i32, IceType_i32, IceType_i32,
+         IceType_i1},
+        6},
+       "memcpy.p0i8.p0i8.i32"},
+      {{INTRIN(Memmove, SideEffects_T, ReturnsTwice_F),
+        {IceType_void, IceType_i32, IceType_i32, IceType_i32, IceType_i32,
+         IceType_i1},
+        6},
+       "memmove.p0i8.p0i8.i32"},
+      {{INTRIN(Memset, SideEffects_T, ReturnsTwice_F),
+        {IceType_void, IceType_i32, IceType_i8, IceType_i32, IceType_i32,
+         IceType_i1},
+        6},
+       "memset.p0i8.i32"},
+      {{INTRIN(NaClReadTP, SideEffects_F, ReturnsTwice_F), {IceType_i32}, 1},
+       "nacl.read.tp"},
+      {{INTRIN(Setjmp, SideEffects_T, ReturnsTwice_T),
+        {IceType_i32, IceType_i32},
+        2},
+       "nacl.setjmp"},
 
 #define SqrtInit(Overload, NameSuffix)                                         \
   {                                                                            \
-    {                                                                          \
-      INTRIN(Sqrt, SideEffects_F, ReturnsTwice_F),                             \
-      { Overload, Overload }, 2 },                                             \
-      "sqrt." NameSuffix                                                       \
+    { INTRIN(Sqrt, SideEffects_F, ReturnsTwice_F), {Overload, Overload}, 2 }   \
+    , "sqrt." NameSuffix                                                       \
   }
-    SqrtInit(IceType_f32, "f32"),
-    SqrtInit(IceType_f64, "f64"),
+      SqrtInit(IceType_f32, "f32"),
+      SqrtInit(IceType_f64, "f64"),
 #undef SqrtInit
 
-    { { INTRIN(Stacksave, SideEffects_T, ReturnsTwice_F),
-        { IceType_i32 }, 1 },
-      "stacksave" },
-    { { INTRIN(Stackrestore, SideEffects_T, ReturnsTwice_F),
-        { IceType_void, IceType_i32 }, 2 },
-      "stackrestore" },
-    { { INTRIN(Trap, SideEffects_T, ReturnsTwice_F),
-        { IceType_void }, 1 },
-      "trap" }
-};
+      {{INTRIN(Stacksave, SideEffects_T, ReturnsTwice_F), {IceType_i32}, 1},
+       "stacksave"},
+      {{INTRIN(Stackrestore, SideEffects_T, ReturnsTwice_F),
+        {IceType_void, IceType_i32},
+        2},
+       "stackrestore"},
+      {{INTRIN(Trap, SideEffects_T, ReturnsTwice_F), {IceType_void}, 1},
+       "trap"}};
 const size_t IceIntrinsicsTableSize = llvm::array_lengthof(IceIntrinsicsTable);
 
 #undef INTRIN
diff --git a/src/IceIntrinsics.h b/src/IceIntrinsics.h
index f631158..0fee205 100644
--- a/src/IceIntrinsics.h
+++ b/src/IceIntrinsics.h
@@ -93,15 +93,9 @@
 
   static bool VerifyMemoryOrder(uint64_t Order);
 
-  enum SideEffects {
-    SideEffects_F=0,
-    SideEffects_T=1
-  };
+  enum SideEffects { SideEffects_F = 0, SideEffects_T = 1 };
 
-  enum ReturnsTwice {
-    ReturnsTwice_F=0,
-    ReturnsTwice_T=1
-  };
+  enum ReturnsTwice { ReturnsTwice_F = 0, ReturnsTwice_T = 1 };
 
   // Basic attributes related to each intrinsic, that are relevant to
   // code generation. Perhaps the attributes representation can be shared
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index 102fe7d..9338bdc 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -190,7 +190,7 @@
   // be careful not to omit all uses of the variable if markDef() and
   // markUse() both use this optimization.
   assert(Node);
-  // Verify that instructions are added in increasing order.
+// Verify that instructions are added in increasing order.
 #ifndef NDEBUG
   if (TrackingKind == VMK_All) {
     const Inst *LastInstruction =
@@ -274,8 +274,8 @@
     const CfgNode *EntryNode = Func->getEntryNode();
     const bool IsFromDef = false;
     const bool IsImplicit = true;
-    Metadata[Var->getIndex()]
-        .markUse(Kind, NoInst, EntryNode, IsFromDef, IsImplicit);
+    Metadata[Var->getIndex()].markUse(Kind, NoInst, EntryNode, IsFromDef,
+                                      IsImplicit);
   }
 
   for (CfgNode *Node : Func->getNodes())
@@ -409,8 +409,9 @@
   } else if (Func->getTarget()->hasComputedFrame()) {
     if (Func->isVerbose(IceV_RegOrigins))
       Str << ":";
-    Str << "[" << Func->getTarget()->getRegName(
-                      Func->getTarget()->getFrameOrStackReg(), IceType_i32);
+    Str << "["
+        << Func->getTarget()->getRegName(
+               Func->getTarget()->getFrameOrStackReg(), IceType_i32);
     int32_t Offset = getStackOffset();
     if (Offset) {
       if (Offset > 0)
diff --git a/src/IceOperand.h b/src/IceOperand.h
index 3bbc0e3..5019e29 100644
--- a/src/IceOperand.h
+++ b/src/IceOperand.h
@@ -88,7 +88,7 @@
   Variable **Vars;
 };
 
-template<class StreamType>
+template <class StreamType>
 inline StreamType &operator<<(StreamType &Str, const Operand &Op) {
   Op.dump(Str);
   return Str;
@@ -170,7 +170,8 @@
 typedef ConstantPrimitive<float, Operand::kConstFloat> ConstantFloat;
 typedef ConstantPrimitive<double, Operand::kConstDouble> ConstantDouble;
 
-template <> inline void ConstantInteger32::dump(const Cfg *, Ostream &Str) const {
+template <>
+inline void ConstantInteger32::dump(const Cfg *, Ostream &Str) const {
   if (!ALLOW_DUMP)
     return;
   if (getType() == IceType_i1)
@@ -179,7 +180,8 @@
     Str << static_cast<int32_t>(getValue());
 }
 
-template <> inline void ConstantInteger64::dump(const Cfg *, Ostream &Str) const {
+template <>
+inline void ConstantInteger64::dump(const Cfg *, Ostream &Str) const {
   if (!ALLOW_DUMP)
     return;
   assert(getType() == IceType_i64);
@@ -244,7 +246,7 @@
         Name(Name), SuppressMangling(SuppressMangling) {}
   ~ConstantRelocatable() override {}
   const RelocOffsetT Offset; // fixed offset to add
-  const IceString Name; // optional for debug/dump
+  const IceString Name;      // optional for debug/dump
   bool SuppressMangling;
 };
 
@@ -360,7 +362,7 @@
   typedef std::pair<InstNumberT, InstNumberT> RangeElementType;
   // RangeType is arena-allocated from the Cfg's allocator.
   typedef std::vector<RangeElementType, CfgLocalAllocator<RangeElementType>>
-  RangeType;
+      RangeType;
   RangeType Range;
   RegWeight Weight;
   // TrimmedBegin is an optimization for the overlaps() computation.
@@ -540,11 +542,7 @@
     MDS_MultiDefSingleBlock,
     MDS_MultiDefMultiBlock
   };
-  enum MultiBlockState {
-    MBS_Unknown,
-    MBS_SingleBlock,
-    MBS_MultiBlock
-  };
+  enum MultiBlockState { MBS_Unknown, MBS_SingleBlock, MBS_MultiBlock };
   VariableTracking()
       : MultiDef(MDS_Unknown), MultiBlock(MBS_Unknown), SingleUseNode(nullptr),
         SingleDefNode(nullptr), FirstOrSingleDefinition(nullptr) {}
diff --git a/src/IceRNG.cpp b/src/IceRNG.cpp
index ed3467b..03171ad 100644
--- a/src/IceRNG.cpp
+++ b/src/IceRNG.cpp
@@ -26,8 +26,8 @@
 // and implementation.  I expect the implementation is different and
 // therefore the tests would need to be changed.
 cl::opt<unsigned long long>
-RandomSeed("sz-seed", cl::desc("Seed the random number generator"),
-           cl::init(time(0)));
+    RandomSeed("sz-seed", cl::desc("Seed the random number generator"),
+               cl::init(time(0)));
 
 const unsigned MAX = 2147483647;
 
diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp
index 4373c6c..27a2d60 100644
--- a/src/IceTargetLowering.cpp
+++ b/src/IceTargetLowering.cpp
@@ -43,9 +43,9 @@
     cl::desc("Nop insertion probability as percentage"), cl::init(10));
 
 cl::opt<bool>
-CLRandomizeRegisterAllocation("randomize-regalloc",
-                              cl::desc("Randomize register allocation"),
-                              cl::init(false));
+    CLRandomizeRegisterAllocation("randomize-regalloc",
+                                  cl::desc("Randomize register allocation"),
+                                  cl::init(false));
 } // end of anonymous namespace
 
 void LoweringContext::init(CfgNode *N) {
diff --git a/src/IceTargetLowering.h b/src/IceTargetLowering.h
index 49108fa..17d785e 100644
--- a/src/IceTargetLowering.h
+++ b/src/IceTargetLowering.h
@@ -164,9 +164,7 @@
   // Returns true if this function calls a function that has the
   // "returns twice" attribute.
   bool callsReturnsTwice() const { return CallsReturnsTwice; }
-  void setCallsReturnsTwice(bool RetTwice) {
-    CallsReturnsTwice = RetTwice;
-  }
+  void setCallsReturnsTwice(bool RetTwice) { CallsReturnsTwice = RetTwice; }
   int32_t getStackAdjustment() const { return StackAdjustment; }
   void updateStackAdjustment(int32_t Offset) { StackAdjustment += Offset; }
   void resetStackAdjustment() { StackAdjustment = 0; }
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index 79c79cc..8c59499 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -61,9 +61,9 @@
 #define X(val, dflt, swapS, C1, C2, swapV, pred)                               \
   { dflt, swapS, CondX86::C1, CondX86::C2, swapV, CondX86::pred }              \
   ,
-    FCMPX8632_TABLE
+      FCMPX8632_TABLE
 #undef X
-  };
+};
 const size_t TableFcmpSize = llvm::array_lengthof(TableFcmp);
 
 // The following table summarizes the logic for lowering the icmp instruction
@@ -76,9 +76,9 @@
 #define X(val, C_32, C1_64, C2_64, C3_64)                                      \
   { CondX86::C_32 }                                                            \
   ,
-    ICMPX8632_TABLE
+      ICMPX8632_TABLE
 #undef X
-  };
+};
 const size_t TableIcmp32Size = llvm::array_lengthof(TableIcmp32);
 
 // The following table summarizes the logic for lowering the icmp instruction
@@ -91,9 +91,9 @@
 #define X(val, C_32, C1_64, C2_64, C3_64)                                      \
   { CondX86::C1_64, CondX86::C2_64, CondX86::C3_64 }                           \
   ,
-    ICMPX8632_TABLE
+      ICMPX8632_TABLE
 #undef X
-  };
+};
 const size_t TableIcmp64Size = llvm::array_lengthof(TableIcmp64);
 
 CondX86::BrCond getIcmp32Mapping(InstIcmp::ICond Cond) {
@@ -108,9 +108,9 @@
 #define X(tag, elementty, cvt, sdss, pack, width, fld)                         \
   { elementty }                                                                \
   ,
-    ICETYPEX8632_TABLE
+      ICETYPEX8632_TABLE
 #undef X
-  };
+};
 const size_t TableTypeX8632AttributesSize =
     llvm::array_lengthof(TableTypeX8632Attributes);
 
@@ -155,14 +155,13 @@
 
 // Instruction set options
 namespace cl = ::llvm::cl;
-cl::opt<TargetX8632::X86InstructionSet>
-CLInstructionSet("mattr", cl::desc("X86 target attributes"),
-                 cl::init(TargetX8632::SSE2),
-                 cl::values(clEnumValN(TargetX8632::SSE2, "sse2",
-                                       "Enable SSE2 instructions (default)"),
-                            clEnumValN(TargetX8632::SSE4_1, "sse4.1",
-                                       "Enable SSE 4.1 instructions"),
-                            clEnumValEnd));
+cl::opt<TargetX8632::X86InstructionSet> CLInstructionSet(
+    "mattr", cl::desc("X86 target attributes"), cl::init(TargetX8632::SSE2),
+    cl::values(clEnumValN(TargetX8632::SSE2, "sse2",
+                          "Enable SSE2 instructions (default)"),
+               clEnumValN(TargetX8632::SSE4_1, "sse4.1",
+                          "Enable SSE 4.1 instructions"),
+               clEnumValEnd));
 
 // In some cases, there are x-macros tables for both high-level and
 // low-level instructions/operands that use the same enum key value.
@@ -454,7 +453,7 @@
 #define X(val, encode, name, name16, name8, scratch, preserved, stackptr,      \
           frameptr, isI8, isInt, isFP)                                         \
   name,
-  REGX8632_TABLE
+    REGX8632_TABLE
 #undef X
 };
 
@@ -485,14 +484,14 @@
 #define X(val, encode, name, name16, name8, scratch, preserved, stackptr,      \
           frameptr, isI8, isInt, isFP)                                         \
   name8,
-    REGX8632_TABLE
+      REGX8632_TABLE
 #undef X
   };
   static IceString RegNames16[] = {
 #define X(val, encode, name, name16, name8, scratch, preserved, stackptr,      \
           frameptr, isI8, isInt, isFP)                                         \
   name16,
-    REGX8632_TABLE
+      REGX8632_TABLE
 #undef X
   };
   switch (Ty) {
@@ -2762,8 +2761,8 @@
     //   T := SourceVectRM
     //   ElementR := ElementR[0, 0] T[0, 2]
     //   T := T[0, 1] ElementR[3, 0]
-    const unsigned char Mask1[3] = { 0, 192, 128 };
-    const unsigned char Mask2[3] = { 227, 196, 52 };
+    const unsigned char Mask1[3] = {0, 192, 128};
+    const unsigned char Mask2[3] = {227, 196, 52};
 
     Constant *Mask1Constant = Ctx->getConstantInt32(Mask1[Index - 1]);
     Constant *Mask2Constant = Ctx->getConstantInt32(Mask2[Index - 1]);
@@ -2806,12 +2805,12 @@
   switch (Instr->getIntrinsicInfo().ID) {
   case Intrinsics::AtomicCmpxchg: {
     if (!Intrinsics::VerifyMemoryOrder(
-             llvm::cast<ConstantInteger32>(Instr->getArg(3))->getValue())) {
+            llvm::cast<ConstantInteger32>(Instr->getArg(3))->getValue())) {
       Func->setError("Unexpected memory ordering (success) for AtomicCmpxchg");
       return;
     }
     if (!Intrinsics::VerifyMemoryOrder(
-             llvm::cast<ConstantInteger32>(Instr->getArg(4))->getValue())) {
+            llvm::cast<ConstantInteger32>(Instr->getArg(4))->getValue())) {
       Func->setError("Unexpected memory ordering (failure) for AtomicCmpxchg");
       return;
     }
@@ -2826,7 +2825,7 @@
   }
   case Intrinsics::AtomicFence:
     if (!Intrinsics::VerifyMemoryOrder(
-             llvm::cast<ConstantInteger32>(Instr->getArg(0))->getValue())) {
+            llvm::cast<ConstantInteger32>(Instr->getArg(0))->getValue())) {
       Func->setError("Unexpected memory ordering for AtomicFence");
       return;
     }
@@ -2872,7 +2871,7 @@
     // We require the memory address to be naturally aligned.
     // Given that is the case, then normal loads are atomic.
     if (!Intrinsics::VerifyMemoryOrder(
-             llvm::cast<ConstantInteger32>(Instr->getArg(1))->getValue())) {
+            llvm::cast<ConstantInteger32>(Instr->getArg(1))->getValue())) {
       Func->setError("Unexpected memory ordering for AtomicLoad");
       return;
     }
@@ -2905,18 +2904,18 @@
   }
   case Intrinsics::AtomicRMW:
     if (!Intrinsics::VerifyMemoryOrder(
-             llvm::cast<ConstantInteger32>(Instr->getArg(3))->getValue())) {
+            llvm::cast<ConstantInteger32>(Instr->getArg(3))->getValue())) {
       Func->setError("Unexpected memory ordering for AtomicRMW");
       return;
     }
     lowerAtomicRMW(Instr->getDest(),
                    static_cast<uint32_t>(llvm::cast<ConstantInteger32>(
-                       Instr->getArg(0))->getValue()),
+                                             Instr->getArg(0))->getValue()),
                    Instr->getArg(1), Instr->getArg(2));
     return;
   case Intrinsics::AtomicStore: {
     if (!Intrinsics::VerifyMemoryOrder(
-             llvm::cast<ConstantInteger32>(Instr->getArg(2))->getValue())) {
+            llvm::cast<ConstantInteger32>(Instr->getArg(2))->getValue())) {
       Func->setError("Unexpected memory ordering for AtomicStore");
       return;
     }
@@ -4577,7 +4576,8 @@
   // If external and not initialized, this must be a cross test.
   // Don't generate a declaration for such cases.
   bool IsExternal = Var.isExternal() || Ctx->getFlags().DisableInternal;
-  if (IsExternal && !Var.hasInitializer()) return;
+  if (IsExternal && !Var.hasInitializer())
+    return;
 
   bool HasNonzeroInitializer = Var.hasNonzeroInitializer();
   bool IsConstant = Var.getIsConstant();
diff --git a/src/IceTimerTree.h b/src/IceTimerTree.h
index bf122fd..795bbee 100644
--- a/src/IceTimerTree.h
+++ b/src/IceTimerTree.h
@@ -69,10 +69,10 @@
   uint64_t StateChangeCount;
   // IDsIndex maps a symbolic timer name to its integer ID.
   std::map<IceString, TimerIdT> IDsIndex;
-  std::vector<IceString> IDs;        // indexed by TimerIdT
-  std::vector<TimerTreeNode> Nodes;  // indexed by TTindex
-  std::vector<double> LeafTimes;     // indexed by TimerIdT
-  std::vector<size_t> LeafCounts;    // indexed by TimerIdT
+  std::vector<IceString> IDs;       // indexed by TimerIdT
+  std::vector<TimerTreeNode> Nodes; // indexed by TTindex
+  std::vector<double> LeafTimes;    // indexed by TimerIdT
+  std::vector<size_t> LeafCounts;   // indexed by TimerIdT
   TTindex StackTop;
 };
 
diff --git a/src/IceTypes.cpp b/src/IceTypes.cpp
index e6dbadf..838361c 100644
--- a/src/IceTypes.cpp
+++ b/src/IceTypes.cpp
@@ -92,7 +92,7 @@
 #define X(tag, size, align, elts, elty, str)                                   \
   { size, align, elts, elty, str }                                             \
   ,
-  ICETYPE_TABLE
+    ICETYPE_TABLE
 #undef X
 };
 
@@ -116,7 +116,7 @@
         IsFloat && !IsVec, IsFloat && IsVec, IsLoadStore, CompareResult        \
   }                                                                            \
   ,
-  ICETYPE_PROPS_TABLE
+    ICETYPE_PROPS_TABLE
 #undef X
 };
 
diff --git a/src/IceTypes.h b/src/IceTypes.h
index 2b4c2cd..2cf5e40 100644
--- a/src/IceTypes.h
+++ b/src/IceTypes.h
@@ -40,12 +40,7 @@
   return Stream << targetArchString(Arch);
 }
 
-enum OptLevel {
-  Opt_m1,
-  Opt_0,
-  Opt_1,
-  Opt_2
-};
+enum OptLevel { Opt_m1, Opt_0, Opt_1, Opt_2 };
 
 size_t typeWidthInBytes(Type Ty);
 size_t typeAlignInBytes(Type Ty);
@@ -114,6 +109,7 @@
 /// Models a type signature for a function.
 class FuncSigType {
   FuncSigType &operator=(const FuncSigType &Ty) = delete;
+
 public:
   typedef std::vector<Type> ArgListType;
 
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index 6a74dd2..344b749 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -42,6 +42,7 @@
 // the extended type.
 class ExtendedType {
   ExtendedType &operator=(const ExtendedType &Ty) = delete;
+
 public:
   /// Discriminator for LLVM-style RTTI.
   enum TypeKind { Undefined, Simple, FuncSig };
@@ -106,6 +107,7 @@
 class SimpleExtendedType : public ExtendedType {
   SimpleExtendedType(const SimpleExtendedType &) = delete;
   SimpleExtendedType &operator=(const SimpleExtendedType &) = delete;
+
 public:
   Ice::Type getType() const { return Signature.getReturnType(); }
 
@@ -118,6 +120,7 @@
 class FuncSigExtendedType : public ExtendedType {
   FuncSigExtendedType(const FuncSigExtendedType &) = delete;
   FuncSigExtendedType &operator=(const FuncSigExtendedType &) = delete;
+
 public:
   const Ice::FuncSigType &getSignature() const { return Signature; }
   void setReturnType(Ice::Type ReturnType) {
@@ -201,7 +204,7 @@
     if (Ty)
       return Ty;
     if (ID >= TypeIDValues.size())
-      TypeIDValues.resize(ID+1);
+      TypeIDValues.resize(ID + 1);
     return &TypeIDValues[ID];
   }
 
@@ -1006,7 +1009,6 @@
   virtual void setBbName(uint64_t Index, StringType &Name) = 0;
 
 private:
-
   void ProcessRecord() override;
 
   void ConvertToString(StringType &ConvertedName) {
@@ -1092,13 +1094,9 @@
 
   const char *getBlockName() const override { return "function"; }
 
-  Ice::Cfg *getFunc() const {
-    return Func;
-  }
+  Ice::Cfg *getFunc() const { return Func; }
 
-  uint32_t getNumGlobalIDs() const {
-    return CachedNumGlobalValueIDs;
-  }
+  uint32_t getNumGlobalIDs() const { return CachedNumGlobalValueIDs; }
 
   void setNextLocalInstIndex(Ice::Operand *Op) {
     setOperand(NextLocalInstIndex++, Op);
@@ -1578,19 +1576,17 @@
   /// Returns true iff an integer truncation from SourceType to TargetType is
   /// valid.
   static bool isIntTruncCastValid(Ice::Type SourceType, Ice::Type TargetType) {
-    return Ice::isIntegerType(SourceType)
-        && Ice::isIntegerType(TargetType)
-        && simplifyOutCommonVectorType(SourceType, TargetType)
-        && getScalarIntBitWidth(SourceType) > getScalarIntBitWidth(TargetType);
+    return Ice::isIntegerType(SourceType) && Ice::isIntegerType(TargetType) &&
+           simplifyOutCommonVectorType(SourceType, TargetType) &&
+           getScalarIntBitWidth(SourceType) > getScalarIntBitWidth(TargetType);
   }
 
   /// Returns true iff a floating type truncation from SourceType to TargetType
   /// is valid.
   static bool isFloatTruncCastValid(Ice::Type SourceType,
                                     Ice::Type TargetType) {
-    return simplifyOutCommonVectorType(SourceType, TargetType)
-        && SourceType == Ice::IceType_f64
-        && TargetType == Ice::IceType_f32;
+    return simplifyOutCommonVectorType(SourceType, TargetType) &&
+           SourceType == Ice::IceType_f64 && TargetType == Ice::IceType_f32;
   }
 
   /// Returns true iff an integer extension from SourceType to TargetType is
@@ -1996,8 +1992,8 @@
     } else if (CondVal->getType() != Ice::IceType_i1) {
       std::string Buffer;
       raw_string_ostream StrBuf(Buffer);
-      StrBuf << "Select condition " << CondVal << " not type i1. Found: "
-             << CondVal->getType();
+      StrBuf << "Select condition " << CondVal
+             << " not type i1. Found: " << CondVal->getType();
       Error(StrBuf.str());
       appendErrorInstruction(ThenType);
       return;
@@ -2079,8 +2075,8 @@
     if (Op1Type != Op2Type) {
       std::string Buffer;
       raw_string_ostream StrBuf(Buffer);
-      StrBuf << "Compare argument types differ: " << Op1Type
-             << " and " << Op2Type;
+      StrBuf << "Compare argument types differ: " << Op1Type << " and "
+             << Op2Type;
       Error(StrBuf.str());
       appendErrorInstruction(DestType);
       Op2 = Op1;
@@ -2105,7 +2101,7 @@
       }
       CurrentNode->appendInst(
           Ice::InstIcmp::create(Func, Cond, Dest, Op1, Op2));
-    } else if (isFloatingType(Op1Type)){
+    } else if (isFloatingType(Op1Type)) {
       Ice::InstFcmp::FCond Cond;
       if (!convertNaClBitcFCompOpToIce(Values[2], Cond)) {
         std::string Buffer;
@@ -2168,8 +2164,8 @@
       if (Cond->getType() != Ice::IceType_i1) {
         std::string Buffer;
         raw_string_ostream StrBuf(Buffer);
-        StrBuf << "Branch condition " << *Cond << " not i1. Found: "
-               << Cond->getType();
+        StrBuf << "Branch condition " << *Cond
+               << " not i1. Found: " << Cond->getType();
         Error(StrBuf.str());
         return;
       }
@@ -2227,10 +2223,10 @@
     Ice::InstSwitch *Switch =
         isIRGenDisabled ? nullptr : Ice::InstSwitch::create(Func, NumCases,
                                                             Cond, DefaultLabel);
-    unsigned ValCaseIndex = 4;  // index to beginning of case entry.
+    unsigned ValCaseIndex = 4; // index to beginning of case entry.
     for (unsigned CaseIndex = 0; CaseIndex < NumCases;
          ++CaseIndex, ValCaseIndex += 4) {
-      if (Values[ValCaseIndex] != 1 || Values[ValCaseIndex+1] != 1) {
+      if (Values[ValCaseIndex] != 1 || Values[ValCaseIndex + 1] != 1) {
         std::string Buffer;
         raw_string_ostream StrBuf(Buffer);
         StrBuf << "Sequence [1, 1, value, label] expected for case entry "
@@ -2257,8 +2253,7 @@
       return;
     if (isIRGenerationDisabled())
       return;
-    CurrentNode->appendInst(
-        Ice::InstUnreachable::create(Func));
+    CurrentNode->appendInst(Ice::InstUnreachable::create(Func));
     InstIsTerminating = true;
     return;
   }
@@ -2464,9 +2459,8 @@
                               : getNextInstVar(ReturnType);
     Ice::InstCall *Inst = nullptr;
     if (IntrinsicInfo) {
-      Inst =
-          Ice::InstIntrinsicCall::create(Func, NumParams, Dest, Callee,
-                                         IntrinsicInfo->Info);
+      Inst = Ice::InstIntrinsicCall::create(Func, NumParams, Dest, Callee,
+                                            IntrinsicInfo->Info);
     } else {
       Inst = Ice::InstCall::create(Func, NumParams, Dest, Callee, IsTailCall);
     }
@@ -2808,9 +2802,7 @@
 
   bool ParseBlock(unsigned BlockID) override;
 
-  void ExitBlock() override {
-    InstallGlobalNamesAndGlobalVarInitializers();
-  }
+  void ExitBlock() override { InstallGlobalNamesAndGlobalVarInitializers(); }
 
   void ProcessRecord() override;
 };
diff --git a/src/assembler.h b/src/assembler.h
index 7997865..40f50fd 100644
--- a/src/assembler.h
+++ b/src/assembler.h
@@ -57,9 +57,7 @@
   }
 
   // Emit a fixup at the current location.
-  void EmitFixup(AssemblerFixup *fixup) {
-    fixup->set_position(Size());
-  }
+  void EmitFixup(AssemblerFixup *fixup) { fixup->set_position(Size()); }
 
   // Get the size of the emitted code.
   intptr_t Size() const { return cursor_ - contents_; }
diff --git a/src/llvm2ice.cpp b/src/llvm2ice.cpp
index 51757b8..702d0b1 100644
--- a/src/llvm2ice.cpp
+++ b/src/llvm2ice.cpp
@@ -73,13 +73,13 @@
     DataSections("fdata-sections",
                  cl::desc("Emit (global) data into separate sections"));
 static cl::opt<Ice::OptLevel>
-OptLevel(cl::desc("Optimization level"), cl::init(Ice::Opt_m1),
-         cl::value_desc("level"),
-         cl::values(clEnumValN(Ice::Opt_m1, "Om1", "-1"),
-                    clEnumValN(Ice::Opt_m1, "O-1", "-1"),
-                    clEnumValN(Ice::Opt_0, "O0", "0"),
-                    clEnumValN(Ice::Opt_1, "O1", "1"),
-                    clEnumValN(Ice::Opt_2, "O2", "2"), clEnumValEnd));
+    OptLevel(cl::desc("Optimization level"), cl::init(Ice::Opt_m1),
+             cl::value_desc("level"),
+             cl::values(clEnumValN(Ice::Opt_m1, "Om1", "-1"),
+                        clEnumValN(Ice::Opt_m1, "O-1", "-1"),
+                        clEnumValN(Ice::Opt_0, "O0", "0"),
+                        clEnumValN(Ice::Opt_1, "O1", "1"),
+                        clEnumValN(Ice::Opt_2, "O2", "2"), clEnumValEnd));
 static cl::opt<std::string> IRFilename(cl::Positional, cl::desc("<IR file>"),
                                        cl::init("-"));
 static cl::opt<std::string> OutputFilename("o",
@@ -90,27 +90,26 @@
                                         cl::init("-"),
                                         cl::value_desc("filename"));
 static cl::opt<std::string>
-TestPrefix("prefix", cl::desc("Prepend a prefix to symbol names for testing"),
-           cl::init(""), cl::value_desc("prefix"));
+    TestPrefix("prefix",
+               cl::desc("Prepend a prefix to symbol names for testing"),
+               cl::init(""), cl::value_desc("prefix"));
+static cl::opt<bool> DisableInternal("externalize",
+                                     cl::desc("Externalize all symbols"));
 static cl::opt<bool>
-DisableInternal("externalize",
-                cl::desc("Externalize all symbols"));
-static cl::opt<bool>
-DisableTranslation("notranslate", cl::desc("Disable Subzero translation"));
+    DisableTranslation("notranslate", cl::desc("Disable Subzero translation"));
 // Note: Modifiable only if ALLOW_DISABLE_IR_GEN.
 static cl::opt<bool>
     DisableIRGeneration("no-ir-gen",
                         cl::desc("Disable generating Subzero IR."));
 static cl::opt<std::string>
-TranslateOnly("translate-only", cl::desc("Translate only the given function"),
-              cl::init(""));
+    TranslateOnly("translate-only",
+                  cl::desc("Translate only the given function"), cl::init(""));
 
 static cl::opt<bool> SubzeroTimingEnabled(
     "timing", cl::desc("Enable breakdown timing of Subzero translation"));
 
-static cl::opt<bool>
-TimeEachFunction("timing-funcs",
-                 cl::desc("Print total translation time for each function"));
+static cl::opt<bool> TimeEachFunction(
+    "timing-funcs", cl::desc("Print total translation time for each function"));
 
 static cl::opt<std::string> TimingFocusOn(
     "timing-focus",
@@ -123,17 +122,17 @@
     cl::init(""));
 
 static cl::opt<bool>
-EnablePhiEdgeSplit("phi-edge-split",
-                   cl::desc("Enable edge splitting for Phi lowering"),
-                   cl::init(true));
+    EnablePhiEdgeSplit("phi-edge-split",
+                       cl::desc("Enable edge splitting for Phi lowering"),
+                       cl::init(true));
 
 static cl::opt<bool> DecorateAsm(
     "asm-verbose",
     cl::desc("Decorate textual asm output with register liveness info"));
 
 static cl::opt<bool>
-DumpStats("szstats",
-          cl::desc("Print statistics after translating each function"));
+    DumpStats("szstats",
+              cl::desc("Print statistics after translating each function"));
 
 // This is currently needed by crosstest.py.
 static cl::opt<bool> AllowUninitializedGlobals(
@@ -173,8 +172,7 @@
     cl::desc("Allow error recovery when reading PNaCl bitcode."),
     cl::init(false));
 
-static cl::opt<bool>
-LLVMVerboseErrors(
+static cl::opt<bool> LLVMVerboseErrors(
     "verbose-llvm-parse-errors",
     cl::desc("Print out more descriptive PNaCl bitcode parse errors when "
              "building LLVM IR first"),
@@ -197,23 +195,22 @@
     "exit-success", cl::desc("Exit with success status, even if errors found"),
     cl::init(false));
 
-static cl::opt<bool>
-GenerateBuildAtts("build-atts",
-                  cl::desc("Generate list of build attributes associated with "
+static cl::opt<bool> GenerateBuildAtts(
+    "build-atts", cl::desc("Generate list of build attributes associated with "
                            "this executable."),
-                  cl::init(false));
+    cl::init(false));
 
 // Number of translation threads (in addition to the parser thread and
 // the emitter thread).  The special case of 0 means purely
 // sequential, i.e. parser, translator, and emitter all within the
 // same single thread.  (This may need a slight rework if we expand to
 // multiple parser or emitter threads.)
-static cl::opt<uint32_t>
-NumThreads("threads",
-           cl::desc("Number of translation threads (0 for purely sequential)"),
-           // TODO(stichnot): Settle on a good default.  Consider
-           // something related to std::thread::hardware_concurrency().
-           cl::init(0));
+static cl::opt<uint32_t> NumThreads(
+    "threads",
+    cl::desc("Number of translation threads (0 for purely sequential)"),
+    // TODO(stichnot): Settle on a good default.  Consider
+    // something related to std::thread::hardware_concurrency().
+    cl::init(0));
 
 static int GetReturnValue(int Val) {
   if (AlwaysExitSuccess)
@@ -377,9 +374,8 @@
     SMDiagnostic Err;
     Ice::TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx);
     raw_ostream *Verbose = LLVMVerboseErrors ? &errs() : nullptr;
-    Module *Mod =
-        NaClParseIRFile(IRFilename, InputFileFormat, Err, Verbose,
-                        getGlobalContext());
+    Module *Mod = NaClParseIRFile(IRFilename, InputFileFormat, Err, Verbose,
+                                  getGlobalContext());
 
     if (!Mod) {
       Err.print(argv[0], errs());
diff --git a/unittest/BitcodeMunge.cpp b/unittest/BitcodeMunge.cpp
index c973881..ec57ffa 100644
--- a/unittest/BitcodeMunge.cpp
+++ b/unittest/BitcodeMunge.cpp
@@ -19,8 +19,9 @@
 
 namespace IceTest {
 
-bool IceTest::SubzeroBitcodeMunger::runTest(
-    const char* TestName, const uint64_t Munges[], size_t MungeSize) {
+bool IceTest::SubzeroBitcodeMunger::runTest(const char *TestName,
+                                            const uint64_t Munges[],
+                                            size_t MungeSize) {
   const bool AddHeader = true;
   setupTest(TestName, Munges, MungeSize, AddHeader);
 
@@ -28,8 +29,8 @@
   Flags.AllowErrorRecovery = true;
   Flags.GenerateUnitTestMessages = true;
   Ice::GlobalContext Ctx(DumpStream, DumpStream, nullptr,
-                         Ice::IceV_Instructions, Ice::Target_X8632,
-                         Ice::Opt_m1, "", Flags);
+                         Ice::IceV_Instructions, Ice::Target_X8632, Ice::Opt_m1,
+                         "", Flags);
   Ice::PNaClTranslator Translator(&Ctx, Flags);
   Translator.translateBuffer(TestName, MungedInput.get());
 
diff --git a/unittest/BitcodeMunge.h b/unittest/BitcodeMunge.h
index ae46ae0..6b639a7 100644
--- a/unittest/BitcodeMunge.h
+++ b/unittest/BitcodeMunge.h
@@ -32,11 +32,10 @@
   /// Runs PNaClTranslator to translate bitcode records (with defined
   /// record Munges), and puts output into DumpResults. Returns true
   /// if parse is successful.
-  bool runTest(const char* TestName, const uint64_t Munges[],
-               size_t MungeSize);
+  bool runTest(const char *TestName, const uint64_t Munges[], size_t MungeSize);
 
   /// Same as above, but without any edits.
-  bool runTest(const char* TestName) {
+  bool runTest(const char *TestName) {
     uint64_t NoMunges[] = {0};
     return runTest(TestName, NoMunges, 0);
   }
diff --git a/unittest/IceParseInstsTest.cpp b/unittest/IceParseInstsTest.cpp
index 898712a..f8df189 100644
--- a/unittest/IceParseInstsTest.cpp
+++ b/unittest/IceParseInstsTest.cpp
@@ -41,7 +41,7 @@
     3, naclbitc::MODULE_CODE_FUNCTION, 2, 0, 0, 0, Terminator,
     1, naclbitc::BLK_CODE_ENTER, naclbitc::FUNCTION_BLOCK_ID, 2, Terminator,
     3, naclbitc::FUNC_CODE_DECLAREBLOCKS, 1, Terminator,
-    // Note: 100 is a bad value index in next line.
+      // Note: 100 is a bad value index in next line.
     3, naclbitc::FUNC_CODE_INST_CALL, 0, 4, 2, 100, Terminator,
     3, naclbitc::FUNC_CODE_INST_RET, Terminator,
     0, naclbitc::BLK_CODE_EXIT, Terminator,
@@ -54,23 +54,23 @@
   EXPECT_FALSE(DumpMunger.runTestForAssembly("Nonexistent call arg"));
   EXPECT_EQ(
       "module {  // BlockID = 8\n"
-      "  types {  // BlockID = 17\n"
-      "    count 3;\n"
-      "    @t0 = i32;\n"
-      "    @t1 = void;\n"
-      "    @t2 = void (i32, i32);\n"
-      "  }\n"
-      "  declare external void @f0(i32, i32);\n"
-      "  define external void @f1(i32, i32);\n"
-      "  function void @f1(i32 %p0, i32 %p1) {  // BlockID = 12\n"
-      "    blocks 1;\n"
-      "  %b0:\n"
-      "    call void @f0(i32 %p0, i32 @f0);\n"
-      "Error(66:4): Invalid relative value id: 100 (Must be <= 4)\n"
-      "    ret void;\n"
-      "  }\n"
-      "}\n",
-      DumpMunger.getTestResults());
+            "  types {  // BlockID = 17\n"
+            "    count 3;\n"
+            "    @t0 = i32;\n"
+            "    @t1 = void;\n"
+            "    @t2 = void (i32, i32);\n"
+            "  }\n"
+            "  declare external void @f0(i32, i32);\n"
+            "  define external void @f1(i32, i32);\n"
+            "  function void @f1(i32 %p0, i32 %p1) {  // BlockID = 12\n"
+            "    blocks 1;\n"
+            "  %b0:\n"
+            "    call void @f0(i32 %p0, i32 @f0);\n"
+            "Error(66:4): Invalid relative value id: 100 (Must be <= 4)\n"
+            "    ret void;\n"
+            "  }\n"
+            "}\n",
+            DumpMunger.getTestResults());
 
   // Show that we get appropriate error when parsing in Subzero.
   IceTest::SubzeroBitcodeMunger Munger(
@@ -78,7 +78,7 @@
   EXPECT_FALSE(Munger.runTest("Nonexistent call arg"));
   EXPECT_EQ(
       "Error: (66:4) Invalid function record: <34 0 4 2 100>\n",
-      Munger.getTestResults());
+            Munger.getTestResults());
 }
 
 /// Test how we recognize alignments in alloca instructions.
@@ -332,8 +332,8 @@
                                              Align0, array_lengthof(Align0)));
   EXPECT_EQ(
       "    %v0 = load float* %p0, align 0;\n"
-      "Error(58:4): load: Illegal alignment for float. Expects: 1 or 4\n",
-      DumpMunger.getLinesWithSubstring("load"));
+            "Error(58:4): load: Illegal alignment for float. Expects: 1 or 4\n",
+            DumpMunger.getLinesWithSubstring("load"));
 
   // Show what happens when changing alignment to 4.
   const uint64_t Align4[] = {
@@ -359,8 +359,8 @@
                                              Align29, array_lengthof(Align29)));
   EXPECT_EQ(
       "    %v0 = load float* %p0, align 536870912;\n"
-      "Error(58:4): load: Illegal alignment for float. Expects: 1 or 4\n",
-      DumpMunger.getLinesWithSubstring("load"));
+            "Error(58:4): load: Illegal alignment for float. Expects: 1 or 4\n",
+            DumpMunger.getLinesWithSubstring("load"));
 
   // Show what happens when changing alignment to 2**30.
   const uint64_t Align30[] = {
@@ -375,8 +375,8 @@
                                              Align30, array_lengthof(Align30)));
   EXPECT_EQ(
       "    %v0 = load float* %p0, align 0;\n"
-      "Error(58:4): load: Illegal alignment for float. Expects: 1 or 4\n",
-      DumpMunger.getLinesWithSubstring("load"));
+            "Error(58:4): load: Illegal alignment for float. Expects: 1 or 4\n",
+            DumpMunger.getLinesWithSubstring("load"));
 }
 
 // Test how we recognize alignments in store instructions.