Skip to content

Commit

Permalink
Rewrite include guards (KhronosGroup#1793)
Browse files Browse the repository at this point in the history
This CL rewrites the include guards to make PRESUBMIT.py include guard
check happy.
  • Loading branch information
dj2 authored Aug 3, 2018
1 parent aa53271 commit 58a6876
Show file tree
Hide file tree
Showing 151 changed files with 445 additions and 445 deletions.
1 change: 0 additions & 1 deletion PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"""

LINT_FILTERS = [
"-build/header_guard",
"-build/include",
"-build/include_order",
"-build/include_what_you_use",
Expand Down
6 changes: 3 additions & 3 deletions include/spirv-tools/libspirv.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SPIRV_TOOLS_LIBSPIRV_H_
#define SPIRV_TOOLS_LIBSPIRV_H_
#ifndef INCLUDE_SPIRV_TOOLS_LIBSPIRV_H_
#define INCLUDE_SPIRV_TOOLS_LIBSPIRV_H_

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -596,4 +596,4 @@ SPIRV_TOOLS_EXPORT spv_result_t spvBinaryParse(
}
#endif

#endif // SPIRV_TOOLS_LIBSPIRV_H_
#endif // INCLUDE_SPIRV_TOOLS_LIBSPIRV_H_
6 changes: 3 additions & 3 deletions include/spirv-tools/libspirv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SPIRV_TOOLS_LIBSPIRV_HPP_
#define SPIRV_TOOLS_LIBSPIRV_HPP_
#ifndef INCLUDE_SPIRV_TOOLS_LIBSPIRV_HPP_
#define INCLUDE_SPIRV_TOOLS_LIBSPIRV_HPP_

#include <functional>
#include <memory>
Expand Down Expand Up @@ -182,4 +182,4 @@ class SpirvTools {

} // namespace spvtools

#endif // SPIRV_TOOLS_LIBSPIRV_HPP_
#endif // INCLUDE_SPIRV_TOOLS_LIBSPIRV_HPP_
6 changes: 3 additions & 3 deletions include/spirv-tools/linker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SPIRV_TOOLS_LINKER_HPP_
#define SPIRV_TOOLS_LINKER_HPP_
#ifndef INCLUDE_SPIRV_TOOLS_LINKER_HPP_
#define INCLUDE_SPIRV_TOOLS_LINKER_HPP_

#include <cstdint>

Expand Down Expand Up @@ -94,4 +94,4 @@ spv_result_t Link(const Context& context, const uint32_t* const* binaries,

} // namespace spvtools

#endif // SPIRV_TOOLS_LINKER_HPP_
#endif // INCLUDE_SPIRV_TOOLS_LINKER_HPP_
6 changes: 3 additions & 3 deletions include/spirv-tools/optimizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SPIRV_TOOLS_OPTIMIZER_HPP_
#define SPIRV_TOOLS_OPTIMIZER_HPP_
#ifndef INCLUDE_SPIRV_TOOLS_OPTIMIZER_HPP_
#define INCLUDE_SPIRV_TOOLS_OPTIMIZER_HPP_

#include <memory>
#include <ostream>
Expand Down Expand Up @@ -643,4 +643,4 @@ Optimizer::PassToken CreateCombineAccessChainsPass();

} // namespace spvtools

#endif // SPIRV_TOOLS_OPTIMIZER_HPP_
#endif // INCLUDE_SPIRV_TOOLS_OPTIMIZER_HPP_
6 changes: 3 additions & 3 deletions source/assembly_grammar.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_ASSEMBLY_GRAMMAR_H_
#define LIBSPIRV_ASSEMBLY_GRAMMAR_H_
#ifndef SOURCE_ASSEMBLY_GRAMMAR_H_
#define SOURCE_ASSEMBLY_GRAMMAR_H_

#include "enum_set.h"
#include "latest_version_spirv_header.h"
Expand Down Expand Up @@ -135,4 +135,4 @@ class AssemblyGrammar {

} // namespace spvtools

#endif // LIBSPIRV_ASSEMBLY_GRAMMAR_H_
#endif // SOURCE_ASSEMBLY_GRAMMAR_H_
6 changes: 3 additions & 3 deletions source/binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_BINARY_H_
#define LIBSPIRV_BINARY_H_
#ifndef SOURCE_BINARY_H_
#define SOURCE_BINARY_H_

#include "spirv-tools/libspirv.h"
#include "spirv_definition.h"
Expand All @@ -33,4 +33,4 @@ spv_result_t spvBinaryHeaderGet(const spv_const_binary binary,
// replacement for C11's strnlen_s which might not exist in all environments.
size_t spv_strnlen_s(const char* str, size_t strsz);

#endif // LIBSPIRV_BINARY_H_
#endif // SOURCE_BINARY_H_
6 changes: 3 additions & 3 deletions source/cfa.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SPVTOOLS_CFA_H_
#define SPVTOOLS_CFA_H_
#ifndef SOURCE_CFA_H_
#define SOURCE_CFA_H_

#include <algorithm>
#include <cassert>
Expand Down Expand Up @@ -344,4 +344,4 @@ void CFA<BB>::ComputeAugmentedCFG(

} // namespace spvtools

#endif // SPVTOOLS_CFA_H_
#endif // SOURCE_CFA_H_
6 changes: 3 additions & 3 deletions source/comp/markv.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
// make it more similar to other compressed SPIR-V files to further improve
// compression of the dataset.

#ifndef SPIRV_TOOLS_MARKV_HPP_
#define SPIRV_TOOLS_MARKV_HPP_
#ifndef SOURCE_COMP_MARKV_H_
#define SOURCE_COMP_MARKV_H_

#include <string>
#include <vector>
Expand Down Expand Up @@ -73,4 +73,4 @@ spv_result_t MarkvToSpirv(
} // namespace comp
} // namespace spvtools

#endif // SPIRV_TOOLS_MARKV_HPP_
#endif // SOURCE_COMP_MARKV_H_
6 changes: 3 additions & 3 deletions source/comp/markv_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_COMP_MARKV_MODEL_H_
#define LIBSPIRV_COMP_MARKV_MODEL_H_
#ifndef SOURCE_COMP_MARKV_MODEL_H_
#define SOURCE_COMP_MARKV_MODEL_H_

#include <map>
#include <unordered_set>
Expand Down Expand Up @@ -231,4 +231,4 @@ class MarkvModel {
} // namespace comp
} // namespace spvtools

#endif // LIBSPIRV_COMP_MARKV_MODEL_H_
#endif // SOURCE_COMP_MARKV_MODEL_H_
6 changes: 3 additions & 3 deletions source/diagnostic.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_DIAGNOSTIC_H_
#define LIBSPIRV_DIAGNOSTIC_H_
#ifndef SOURCE_DIAGNOSTIC_H_
#define SOURCE_DIAGNOSTIC_H_

#include <sstream>
#include <string>
Expand Down Expand Up @@ -76,4 +76,4 @@ std::string spvResultToString(spv_result_t res);

} // namespace spvtools

#endif // LIBSPIRV_DIAGNOSTIC_H_
#endif // SOURCE_DIAGNOSTIC_H_
6 changes: 3 additions & 3 deletions source/disassemble.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SPIRV_TOOLS_DISASSEMBLE_H_
#define SPIRV_TOOLS_DISASSEMBLE_H_
#ifndef SOURCE_DISASSEMBLE_H_
#define SOURCE_DISASSEMBLE_H_

#include <string>

Expand All @@ -35,4 +35,4 @@ std::string spvInstructionBinaryToText(const spv_target_env env,

} // namespace spvtools

#endif // SPIRV_TOOLS_DISASSEMBLE_H_
#endif // SOURCE_DISASSEMBLE_H_
6 changes: 3 additions & 3 deletions source/enum_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_ENUM_SET_H
#define LIBSPIRV_ENUM_SET_H
#ifndef SOURCE_ENUM_SET_H_
#define SOURCE_ENUM_SET_H_

#include <cstdint>
#include <functional>
Expand Down Expand Up @@ -169,4 +169,4 @@ using CapabilitySet = EnumSet<SpvCapability>;

} // namespace spvtools

#endif // LIBSPIRV_ENUM_SET_H
#endif // SOURCE_ENUM_SET_H_
6 changes: 3 additions & 3 deletions source/enum_string_mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_ENUM_STRING_MAPPING_H_
#define LIBSPIRV_ENUM_STRING_MAPPING_H_
#ifndef SOURCE_ENUM_STRING_MAPPING_H_
#define SOURCE_ENUM_STRING_MAPPING_H_

#include <string>

Expand All @@ -33,4 +33,4 @@ const char* CapabilityToString(SpvCapability capability);

} // namespace spvtools

#endif // LIBSPIRV_ENUM_STRING_MAPPING_H_
#endif // SOURCE_ENUM_STRING_MAPPING_H_
6 changes: 3 additions & 3 deletions source/ext_inst.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_EXT_INST_H_
#define LIBSPIRV_EXT_INST_H_
#ifndef SOURCE_EXT_INST_H_
#define SOURCE_EXT_INST_H_

#include "spirv-tools/libspirv.h"
#include "table.h"
Expand All @@ -37,4 +37,4 @@ spv_result_t spvExtInstTableValueLookup(const spv_ext_inst_table table,
const uint32_t value,
spv_ext_inst_desc* pEntry);

#endif // LIBSPIRV_EXT_INST_H_
#endif // SOURCE_EXT_INST_H_
6 changes: 3 additions & 3 deletions source/extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_EXTENSIONS_H_
#define LIBSPIRV_EXTENSIONS_H_
#ifndef SOURCE_EXTENSIONS_H_
#define SOURCE_EXTENSIONS_H_

#include <string>

Expand All @@ -37,4 +37,4 @@ std::string ExtensionSetToString(const ExtensionSet& extensions);

} // namespace spvtools

#endif // LIBSPIRV_EXTENSIONS_H_
#endif // SOURCE_EXTENSIONS_H_
6 changes: 3 additions & 3 deletions source/id_descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_ID_DESCRIPTOR_H_
#define LIBSPIRV_ID_DESCRIPTOR_H_
#ifndef SOURCE_ID_DESCRIPTOR_H_
#define SOURCE_ID_DESCRIPTOR_H_

#include <unordered_map>
#include <vector>
Expand Down Expand Up @@ -60,4 +60,4 @@ class IdDescriptorCollection {

} // namespace spvtools

#endif // LIBSPIRV_ID_DESCRIPTOR_H_
#endif // SOURCE_ID_DESCRIPTOR_H_
6 changes: 3 additions & 3 deletions source/instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_INSTRUCTION_H_
#define LIBSPIRV_INSTRUCTION_H_
#ifndef SOURCE_INSTRUCTION_H_
#define SOURCE_INSTRUCTION_H_

#include <cstdint>
#include <vector>
Expand Down Expand Up @@ -46,4 +46,4 @@ inline void spvInstructionAddWord(spv_instruction_t* inst, uint32_t value) {
inst->words.push_back(value);
}

#endif // LIBSPIRV_INSTRUCTION_H_
#endif // SOURCE_INSTRUCTION_H_
6 changes: 3 additions & 3 deletions source/latest_version_glsl_std_450_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_LATEST_VERSION_GLSL_STD_450_HEADER_H_
#define LIBSPIRV_LATEST_VERSION_GLSL_STD_450_HEADER_H_
#ifndef SOURCE_LATEST_VERSION_GLSL_STD_450_HEADER_H_
#define SOURCE_LATEST_VERSION_GLSL_STD_450_HEADER_H_

#include "spirv/unified1/GLSL.std.450.h"

#endif // LIBSPIRV_LATEST_VERSION_GLSL_STD_450_HEADER_H_
#endif // SOURCE_LATEST_VERSION_GLSL_STD_450_HEADER_H_
6 changes: 3 additions & 3 deletions source/latest_version_opencl_std_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_LATEST_VERSION_OPENCL_STD_HEADER_H_
#define LIBSPIRV_LATEST_VERSION_OPENCL_STD_HEADER_H_
#ifndef SOURCE_LATEST_VERSION_OPENCL_STD_HEADER_H_
#define SOURCE_LATEST_VERSION_OPENCL_STD_HEADER_H_

#include "spirv/unified1/OpenCL.std.h"

#endif // LIBSPIRV_LATEST_VERSION_OPENCL_STD_HEADER_H_
#endif // SOURCE_LATEST_VERSION_OPENCL_STD_HEADER_H_
6 changes: 3 additions & 3 deletions source/latest_version_spirv_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_LATEST_VERSION_SPIRV_HEADER_H_
#define LIBSPIRV_LATEST_VERSION_SPIRV_HEADER_H_
#ifndef SOURCE_LATEST_VERSION_SPIRV_HEADER_H_
#define SOURCE_LATEST_VERSION_SPIRV_HEADER_H_

#include "spirv/unified1/spirv.h"

#endif // LIBSPIRV_LATEST_VERSION_SPIRV_HEADER_H_
#endif // SOURCE_LATEST_VERSION_SPIRV_HEADER_H_
6 changes: 3 additions & 3 deletions source/macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_MACRO_H_
#define LIBSPIRV_MACRO_H_
#ifndef SOURCE_MACRO_H_
#define SOURCE_MACRO_H_

// Evaluates to the number of elements of array A.
//
Expand All @@ -22,4 +22,4 @@
// std::array::size.
#define ARRAY_SIZE(A) (static_cast<uint32_t>(sizeof(A) / sizeof(A[0])))

#endif // LIBSPIRV_MACRO_H_
#endif // SOURCE_MACRO_H_
6 changes: 3 additions & 3 deletions source/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SPIRV_TOOLS_MESSAGE_H_
#define SPIRV_TOOLS_MESSAGE_H_
#ifndef SOURCE_MESSAGE_H_
#define SOURCE_MESSAGE_H_

#include <string>

Expand All @@ -30,4 +30,4 @@ std::string StringifyMessage(spv_message_level_t level, const char* source,

} // namespace spvtools

#endif // SPIRV_TOOLS_MESSAGE_H_
#endif // SOURCE_MESSAGE_H_
6 changes: 3 additions & 3 deletions source/name_mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LIBSPIRV_NAME_MAPPER_H_
#define LIBSPIRV_NAME_MAPPER_H_
#ifndef SOURCE_NAME_MAPPER_H_
#define SOURCE_NAME_MAPPER_H_

#include <functional>
#include <string>
Expand Down Expand Up @@ -119,4 +119,4 @@ class FriendlyNameMapper {

} // namespace spvtools

#endif // _LIBSPIRV_NAME_MAPPER_H_
#endif // SOURCE_NAME_MAPPER_H_
Loading

0 comments on commit 58a6876

Please sign in to comment.