From 0559a89049bf7af81c703b4c422b7995dc8c79a1 Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Wed, 15 Jul 2020 13:59:24 +0100 Subject: [PATCH] Special-case builtins in gen_spirv.bash Apply the change of fc83fc7 ("updated built-in variable names to match LLVM for SPIR-V documentation (issue #89)", 2016-03-14) to the script generating `SPIRVNameMapEnum.h`, such that the output of the script for builtins is aligned with the current code. --- llvm-spirv/tools/spirv-tool/gen_spirv.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/llvm-spirv/tools/spirv-tool/gen_spirv.bash b/llvm-spirv/tools/spirv-tool/gen_spirv.bash index de50c88942927..3557c5e16861d 100644 --- a/llvm-spirv/tools/spirv-tool/gen_spirv.bash +++ b/llvm-spirv/tools/spirv-tool/gen_spirv.bash @@ -15,7 +15,11 @@ prefix=$1 echo "template <> inline void SPIRVMap<$prefix, std::string>::init() {" cat $spirvHeader | sed -n -e "/^ *${prefix}[^a-z]/s:^ *${prefix}\([^= ][^= ]*\)[= ][= ]*\([0x]*[0-9][0-9]*\).*:\1 \2:p" | while read a b; do - printf " add(${prefix}%s, \"%s\");\n" $a $a + stringRep="$a" + if [[ $prefix == "BuiltIn" ]]; then + stringRep="BuiltIn$a" + fi + printf " add(${prefix}%s, \"%s\");\n" "$a" "$stringRep" done echo "}