Skip to content

Commit 0559a89

Browse files
svenvhvladimirlaz
authored andcommitted
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 intel#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 483b8bc commit 0559a89

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm-spirv/tools/spirv-tool/gen_spirv.bash

+5-1
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)