Skip to content

Commit d0898d2

Browse files
svenvhvladimirlaz
authored andcommitted
Align gen_spirv.bash with current formatting
`SPIRVNameMapEnum.h` and `SPIRVIsValidEnum.h` have been clang-formatted to be consistent with rest of the code base. Apply those formatting changes to the script generating those files.
1 parent 0d1bdd0 commit d0898d2

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

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

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
genNameMap() {
1414
prefix=$1
15-
echo "template<> inline void
16-
SPIRVMap<$prefix, std::string>::init() {"
15+
echo "template <> inline void SPIRVMap<$prefix, std::string>::init() {"
1716

1817
cat $spirvHeader | sed -n -e "/^ *${prefix}[^a-z]/s:^ *${prefix}\([^= ][^= ]*\)[= ][= ]*\([0x]*[0-9][0-9]*\).*:\1 \2:p" | while read a b; do
1918
printf " add(${prefix}%s, \"%s\");\n" $a $a
@@ -32,29 +31,27 @@ SPIRV_DEF_NAMEMAP($prefix, SPIRV${prefix}NameMap)
3231
###########################
3332
genIsValid() {
3433
prefix=$1
35-
echo "inline bool
36-
isValid(spv::$prefix V) {
37-
switch(V) {"
34+
echo "inline bool isValid(spv::$prefix V) {
35+
switch (V) {"
3836

3937
cat $spirvHeader | sed -n -e "/^ *${prefix}[^a-z]/s:^ *${prefix}\([^= ][^= ]*\)[= ][= ]*\(.*\).*:\1 \2:p" | while read a b; do
4038
if [[ $a == CapabilityNone ]]; then
4139
continue
4240
fi
43-
printf " case ${prefix}%s:\n" $a
41+
printf " case ${prefix}%s:\n" $a
4442
done
4543

46-
echo " return true;
47-
default:
48-
return false;
44+
echo " return true;
45+
default:
46+
return false;
4947
}
5048
}
5149
"
5250
}
5351
genMaskIsValid() {
5452
prefix=$1
5553
subprefix=`echo $prefix | sed -e "s:Mask::g"`
56-
echo "inline bool
57-
isValid$prefix(SPIRVWord Mask) {
54+
echo "inline bool isValid$prefix(SPIRVWord Mask) {
5855
SPIRVWord ValidMask = 0u;"
5956

6057
cat $spirvHeader | sed -n -e "/^ *${subprefix}[^a-z]/s:^ *${subprefix}\([^= ][^= ]*\)Mask[= ][= ]*\(.*\).*:\1 \2:p" | while read a b; do
@@ -164,8 +161,8 @@ echo "//===- ${outputBasename} - SPIR-V ${type} enums ----------------*- C++ -*-
164161
#ifndef ${includeGuard}
165162
#define ${includeGuard}
166163
167-
#include \"spirv.hpp\"
168164
#include \"SPIRVEnum.h\"
165+
#include \"spirv.hpp\"
169166
170167
using namespace spv;
171168
@@ -176,4 +173,4 @@ gen $type >> ${outputFile}
176173

177174
echo "} /* namespace SPIRV */
178175
179-
#endif /* ${includeGuard} */" >> ${outputFile}
176+
#endif // ${includeGuard}" >> ${outputFile}

0 commit comments

Comments
 (0)