clang-format: Refactoring.

Re-apply r222638 and r222641 without variadic templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222747 91177308-0d34-0410-b5e6-96231b3b80d8
Update Clang tests that run the LLVM optimizer to reflect the changed
canonicalization in r222748. No interesting functionality changed here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222749 91177308-0d34-0410-b5e6-96231b3b80d8