Skip to content

Commit b24a75c

Browse files
committed
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.
1 parent 6f4bef4 commit b24a75c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/spirv-tool/gen_spirv.bash

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ prefix=$1
1515
echo "template <> inline void SPIRVMap<$prefix, std::string>::init() {"
1616

1717
cat $spirvHeader | sed -n -e "/^ *${prefix}[^a-z]/s:^ *${prefix}\([^= ][^= ]*\)[= ][= ]*\([0x]*[0-9][0-9]*\).*:\1 \2:p" | while read a b; do
18-
printf " add(${prefix}%s, \"%s\");\n" $a $a
18+
stringRep="$a"
19+
if [[ $prefix == "BuiltIn" ]]; then
20+
stringRep="BuiltIn$a"
21+
fi
22+
printf " add(${prefix}%s, \"%s\");\n" "$a" "$stringRep"
1923
done
2024

2125
echo "}

0 commit comments

Comments
 (0)