Update Kokoro's clang-format to version 11.0.1

Downloaded from:
https://github.com/llvm/llvm-project/releases/tag/llvmorg-11.0.1

It fixes obeying PointerAlignment for the ellipsis in variadic templates
(https://reviews.llvm.org/D83564), so patch all the files that use them.

clang-format 11 also introduces support for IndentCaseBlocks
(https://reviews.llvm.org/D72276), but leave that unused for now. The
default (false) does not change formatting.

Note that Chromium's buildtools comes with a version of clang-format
which claims to be 11.0.0 but is actually older and does not produce
the same formatting as the official release version:
http://crbug.com/1150875. Use binaries from the download link above
instead.

Bug: b/144825072
Change-Id: I1c9a680f5619926db1ed93afea94d8942926af37
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50568
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis H├ętu <sugoi@google.com>
Commit-Queue: Nicolas Capens <nicolascapens@google.com>
diff --git a/README.md b/README.md
index 015ba9f..5851403 100644
--- a/README.md
+++ b/README.md
@@ -67,7 +67,7 @@
 

 When ready, [add](https://gerrit-review.googlesource.com/Documentation/intro-user.html#adding-reviewers) a project [owner](OWNERS) as a reviewer on your change.

 

-Some tests will automatically be run against the change. Notably, [presubmit.sh](tests/presubmit.sh) verifies the change has been formatted using [clang-format 10.0](tests/kokoro/gcp_ubuntu/check_style.sh). Most IDEs come with clang-format support, but may require downgrading to [clang-format version 10.0](https://github.com/llvm/llvm-project/releases/tag/llvmorg-10.0.0).

+Some tests will automatically be run against the change. Notably, [presubmit.sh](tests/presubmit.sh) verifies the change has been formatted using [clang-format 11.0.1](tests/kokoro/gcp_ubuntu/check_style.sh). Most IDEs come with clang-format support, but may require upgrading/downgrading to the [clang-format version 11.0.0](https://github.com/llvm/llvm-project/releases/tag/llvmorg-11.0.0) *release* version (notably Chromium's buildtools has a clang-format binary which can be an in-between revision which produces different formatting results).

 

 Testing

 -------

diff --git a/src/Reactor/Print.hpp b/src/Reactor/Print.hpp
index 6267533..fcd7ec5 100644
--- a/src/Reactor/Print.hpp
+++ b/src/Reactor/Print.hpp
@@ -364,7 +364,7 @@
 // Print is a wrapper over Printv that wraps the variadic arguments into an
 // initializer_list before calling Printv.
 template<typename... ARGS>
-void Print(const char *msg, const ARGS &... vals)
+void Print(const char *msg, const ARGS &...vals)
 {
 	Printv(msg, { vals... });
 }
@@ -372,7 +372,7 @@
 // Print is a wrapper over Printv that wraps the variadic arguments into an
 // initializer_list before calling Printv.
 template<typename... ARGS>
-void Print(const char *function, const char *file, int line, const char *msg, const ARGS &... vals)
+void Print(const char *function, const char *file, int line, const char *msg, const ARGS &...vals)
 {
 	Printv(function, file, line, msg, { vals... });
 }
diff --git a/src/Reactor/Reactor.hpp b/src/Reactor/Reactor.hpp
index 922e21f..fac6bb0 100644
--- a/src/Reactor/Reactor.hpp
+++ b/src/Reactor/Reactor.hpp
@@ -3335,7 +3335,7 @@
 
 // Calls the static function pointer fptr with the given arguments args.
 template<typename Return, typename... CArgs, typename... RArgs>
-inline CToReactorT<Return> Call(Return(fptr)(CArgs...), RArgs &&... args)
+inline CToReactorT<Return> Call(Return(fptr)(CArgs...), RArgs &&...args)
 {
 	return CallHelper<Return(CArgs...)>::Call(fptr, CastToReactor(std::forward<RArgs>(args))...);
 }
@@ -3343,7 +3343,7 @@
 // Calls the static function pointer fptr with the given arguments args.
 // Overload for calling functions with void return type.
 template<typename... CArgs, typename... RArgs>
-inline void Call(void(fptr)(CArgs...), RArgs &&... args)
+inline void Call(void(fptr)(CArgs...), RArgs &&...args)
 {
 	CallHelper<void(CArgs...)>::Call(fptr, CastToReactor(std::forward<RArgs>(args))...);
 }
@@ -3351,7 +3351,7 @@
 // Calls the member function pointer fptr with the given arguments args.
 // object can be a Class*, or a Pointer<Byte>.
 template<typename Return, typename Class, typename C, typename... CArgs, typename... RArgs>
-inline CToReactorT<Return> Call(Return (Class::*fptr)(CArgs...), C &&object, RArgs &&... args)
+inline CToReactorT<Return> Call(Return (Class::*fptr)(CArgs...), C &&object, RArgs &&...args)
 {
 	using Helper = CallHelper<Return(Class *, void *, CArgs...)>;
 	using fptrTy = decltype(fptr);
@@ -3375,7 +3375,7 @@
 // Overload for calling functions with void return type.
 // object can be a Class*, or a Pointer<Byte>.
 template<typename Class, typename C, typename... CArgs, typename... RArgs>
-inline void Call(void (Class::*fptr)(CArgs...), C &&object, RArgs &&... args)
+inline void Call(void (Class::*fptr)(CArgs...), C &&object, RArgs &&...args)
 {
 	using Helper = CallHelper<void(Class *, void *, CArgs...)>;
 	using fptrTy = decltype(fptr);
@@ -3432,7 +3432,7 @@
 // Calls the Reactor function pointer fptr with the signature FUNCTION_SIGNATURE and arguments.
 // Overload for calling functions with non-void return type.
 template<typename FUNCTION_SIGNATURE, typename... RArgs>
-inline CToReactorT<NonVoidFunctionReturnType<FUNCTION_SIGNATURE>> Call(Pointer<Byte> fptr, RArgs &&... args)
+inline CToReactorT<NonVoidFunctionReturnType<FUNCTION_SIGNATURE>> Call(Pointer<Byte> fptr, RArgs &&...args)
 {
 	return CallHelper<FUNCTION_SIGNATURE>::Call(fptr, CastToReactor(std::forward<RArgs>(args))...);
 }
@@ -3440,7 +3440,7 @@
 // Calls the Reactor function pointer fptr with the signature FUNCTION_SIGNATURE and arguments.
 // Overload for calling functions with void return type.
 template<typename FUNCTION_SIGNATURE, typename... RArgs>
-inline VoidFunctionReturnType<FUNCTION_SIGNATURE> Call(Pointer<Byte> fptr, RArgs &&... args)
+inline VoidFunctionReturnType<FUNCTION_SIGNATURE> Call(Pointer<Byte> fptr, RArgs &&...args)
 {
 	CallHelper<FUNCTION_SIGNATURE>::Call(fptr, CastToReactor(std::forward<RArgs>(args))...);
 }
diff --git a/src/Reactor/Routine.hpp b/src/Reactor/Routine.hpp
index eb8929d..24c5198 100644
--- a/src/Reactor/Routine.hpp
+++ b/src/Reactor/Routine.hpp
@@ -55,7 +55,7 @@
 	}
 
 	template<typename... Args>
-	Return operator()(Args &&... args) const
+	Return operator()(Args &&...args) const
 	{
 		return function(std::forward<Args>(args)...);
 	}
diff --git a/src/Reactor/SubzeroReactor.cpp b/src/Reactor/SubzeroReactor.cpp
index c536639..61243c0 100644
--- a/src/Reactor/SubzeroReactor.cpp
+++ b/src/Reactor/SubzeroReactor.cpp
@@ -165,7 +165,7 @@
 
 // Wrapper for calls on C functions with Ice types
 template<typename Return, typename... CArgs, typename... RArgs>
-Ice::Variable *Call(Ice::Cfg *function, Ice::CfgNode *basicBlock, Return(fptr)(CArgs...), RArgs &&... args)
+Ice::Variable *Call(Ice::Cfg *function, Ice::CfgNode *basicBlock, Return(fptr)(CArgs...), RArgs &&...args)
 {
 	static_assert(sizeof...(CArgs) == sizeof...(RArgs), "Expected number of args don't match");
 
diff --git a/src/Vulkan/VkCommandBuffer.cpp b/src/Vulkan/VkCommandBuffer.cpp
index 7ec4db7..53c62b9 100644
--- a/src/Vulkan/VkCommandBuffer.cpp
+++ b/src/Vulkan/VkCommandBuffer.cpp
@@ -1296,7 +1296,7 @@
 }
 
 template<typename T, typename... Args>
-void CommandBuffer::addCommand(Args &&... args)
+void CommandBuffer::addCommand(Args &&...args)
 {
 	// FIXME (b/119409619): use an allocator here so we can control all memory allocations
 	commands.push_back(std::make_unique<T>(std::forward<Args>(args)...));
diff --git a/src/Vulkan/VkCommandBuffer.hpp b/src/Vulkan/VkCommandBuffer.hpp
index 1f29ac1..567602a 100644
--- a/src/Vulkan/VkCommandBuffer.hpp
+++ b/src/Vulkan/VkCommandBuffer.hpp
@@ -183,7 +183,7 @@
 private:
 	void resetState();
 	template<typename T, typename... Args>
-	void addCommand(Args &&... args);
+	void addCommand(Args &&...args);
 
 	enum State
 	{
diff --git a/src/clang-format-all.sh b/src/clang-format-all.sh
index e6fca41..d2cc316 100755
--- a/src/clang-format-all.sh
+++ b/src/clang-format-all.sh
@@ -3,6 +3,7 @@
 TESTS_DIR="$( cd "${ROOT_DIR}/tests" >/dev/null 2>&1 && pwd )"
 
 CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
+${CLANG_FORMAT} --version
 
 for DIR in "${SRC_DIR}/Device" "${SRC_DIR}/Pipeline" "${SRC_DIR}/Reactor" "${SRC_DIR}/System" "${SRC_DIR}/Vulkan" "${SRC_DIR}/WSI" "${TESTS_DIR}"
 do
diff --git a/tests/VulkanWrapper/DrawTester.hpp b/tests/VulkanWrapper/DrawTester.hpp
index e380ef2..23cbd93 100644
--- a/tests/VulkanWrapper/DrawTester.hpp
+++ b/tests/VulkanWrapper/DrawTester.hpp
@@ -88,7 +88,7 @@
 	};
 
 	template<typename... Args>
-	Resource<Image> addImage(Args &&... args)
+	Resource<Image> addImage(Args &&...args)
 	{
 		images.emplace_back(std::make_unique<Image>(std::forward<Args>(args)...));
 		return { images.size() - 1, *images.back() };
diff --git a/tests/kokoro/gcp_ubuntu/check_style.sh b/tests/kokoro/gcp_ubuntu/check_style.sh
index 8944a51..0df1b94 100755
--- a/tests/kokoro/gcp_ubuntu/check_style.sh
+++ b/tests/kokoro/gcp_ubuntu/check_style.sh
@@ -4,13 +4,13 @@
 
 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"
 
-# Download clang tar
-CLANG_TAR="/tmp/clang-10.tar.xz"
-curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz > ${CLANG_TAR}
-# Verify clang tar
+# Download Clang tar
+CLANG_PACKAGE="clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-16.04"
+curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/${CLANG_PACKAGE}.tar.xz > /tmp/clang.tar.xz
+# Verify Clang tar
 sudo apt-get install pgpgpg
-gpg --import "${SCRIPT_DIR}/hans-gpg-key.asc"
-gpg --verify "${SCRIPT_DIR}/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz.sig" ${CLANG_TAR}
+gpg --import "${SCRIPT_DIR}/tstellar-gpg-key.asc"
+gpg --verify "${SCRIPT_DIR}/${CLANG_PACKAGE}.tar.xz.sig" /tmp/clang.tar.xz
 if [ $? -ne 0 ]
 then
   echo "clang download failed PGP check"
@@ -20,12 +20,11 @@
 set -e # Fail on any error
 
 # Untar into tmp
-CLANG_DIR=/tmp/clang-10
-mkdir ${CLANG_DIR}
-tar -xf ${CLANG_TAR} -C ${CLANG_DIR}
+mkdir /tmp/clang
+tar -xf /tmp/clang.tar.xz -C /tmp/clang
 
 # Set up env vars
-export CLANG_FORMAT=${CLANG_DIR}/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format
+export CLANG_FORMAT=/tmp/clang/${CLANG_PACKAGE}/bin/clang-format
 
 # Run presubmit tests
 cd git/SwiftShader
diff --git a/tests/kokoro/gcp_ubuntu/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz.sig b/tests/kokoro/gcp_ubuntu/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz.sig
deleted file mode 100644
index 5e8133b..0000000
--- a/tests/kokoro/gcp_ubuntu/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz.sig
+++ /dev/null
Binary files differ
diff --git a/tests/kokoro/gcp_ubuntu/clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig b/tests/kokoro/gcp_ubuntu/clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig
new file mode 100644
index 0000000..cce80a1
--- /dev/null
+++ b/tests/kokoro/gcp_ubuntu/clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig
Binary files differ
diff --git a/tests/kokoro/gcp_ubuntu/hans-gpg-key.asc b/tests/kokoro/gcp_ubuntu/hans-gpg-key.asc
deleted file mode 100644
index 4b3cdde..0000000
--- a/tests/kokoro/gcp_ubuntu/hans-gpg-key.asc
+++ /dev/null
@@ -1,52 +0,0 @@
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c b/tests/kokoro/gcp_ubuntu/tstellar-gpg-key.asc
new file mode 100644
index 0000000..eba625c
--- /dev/null
+++ b/tests/kokoro/gcp_ubuntu/tstellar-gpg-key.asc
Binary files differ