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/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()); } } }