Skip to content

Commit

Permalink
Special-case builtins in gen_spirv.bash
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
svenvh authored and vladimirlaz committed Aug 10, 2020
1 parent 483b8bc commit 0559a89
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion llvm-spirv/tools/spirv-tool/gen_spirv.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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 "}
Expand Down

0 comments on commit 0559a89

Please sign in to comment.