Skip to content

Commit

Permalink
Cleanup includes. (KhronosGroup#1795)
Browse files Browse the repository at this point in the history
This Cl cleans up the include paths to be relative to the top level
directory. Various include-what-you-use fixes have been added.
  • Loading branch information
dj2 authored Aug 3, 2018
1 parent 2d9a325 commit eda2cfb
Show file tree
Hide file tree
Showing 481 changed files with 2,060 additions and 1,606 deletions.
1 change: 0 additions & 1 deletion Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ include $(CLEAR_VARS)
LOCAL_MODULE := SPIRV-Tools
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/source \
$(LOCAL_PATH)/external/spirv-headers/include \
$(SPVTOOLS_OUT_PATH)
LOCAL_EXPORT_C_INCLUDES := \
Expand Down
1 change: 0 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ config("spvtools_config") {
include_dirs = [
".",
"include",
"source",
"$target_gen_dir",
"${spirv_headers}/include",
]
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ elseif(MSVC)
endif()
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/)

option(SPIRV_COLOR_TERMINAL "Enable color terminal output" ON)
Expand Down
3 changes: 0 additions & 3 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
"""

LINT_FILTERS = [
"-build/include",
"-build/include_order",
"-build/include_what_you_use",
"-build/storage_class",
"-readability/braces",
"-readability/casting",
Expand Down
10 changes: 5 additions & 5 deletions source/assembly_grammar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "assembly_grammar.h"
#include "source/assembly_grammar.h"

#include <algorithm>
#include <cassert>
#include <cstring>

#include "ext_inst.h"
#include "opcode.h"
#include "operand.h"
#include "table.h"
#include "source/ext_inst.h"
#include "source/opcode.h"
#include "source/operand.h"
#include "source/table.h"

namespace spvtools {
namespace {
Expand Down
8 changes: 4 additions & 4 deletions source/assembly_grammar.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
#ifndef SOURCE_ASSEMBLY_GRAMMAR_H_
#define SOURCE_ASSEMBLY_GRAMMAR_H_

#include "enum_set.h"
#include "latest_version_spirv_header.h"
#include "operand.h"
#include "source/enum_set.h"
#include "source/latest_version_spirv_header.h"
#include "source/operand.h"
#include "source/table.h"
#include "spirv-tools/libspirv.h"
#include "table.h"

namespace spvtools {

Expand Down
19 changes: 10 additions & 9 deletions source/binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "binary.h"
#include "source/binary.h"

#include <algorithm>
#include <cassert>
#include <cstring>
#include <iterator>
#include <limits>
#include <string>
#include <unordered_map>
#include <vector>

#include "assembly_grammar.h"
#include "diagnostic.h"
#include "ext_inst.h"
#include "latest_version_spirv_header.h"
#include "opcode.h"
#include "operand.h"
#include "spirv_constant.h"
#include "spirv_endian.h"
#include "source/assembly_grammar.h"
#include "source/diagnostic.h"
#include "source/ext_inst.h"
#include "source/latest_version_spirv_header.h"
#include "source/opcode.h"
#include "source/operand.h"
#include "source/spirv_constant.h"
#include "source/spirv_endian.h"

spv_result_t spvBinaryHeaderGet(const spv_const_binary binary,
const spv_endianness_t endian,
Expand Down
2 changes: 1 addition & 1 deletion source/binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#ifndef SOURCE_BINARY_H_
#define SOURCE_BINARY_H_

#include "source/spirv_definition.h"
#include "spirv-tools/libspirv.h"
#include "spirv_definition.h"

// Functions

Expand Down
2 changes: 1 addition & 1 deletion source/comp/markv.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <string>
#include <vector>

#include "comp/markv_model.h"
#include "source/comp/markv_model.h"
#include "spirv-tools/libspirv.hpp"

namespace spvtools {
Expand Down
48 changes: 25 additions & 23 deletions source/comp/markv_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,41 @@
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#include "latest_version_glsl_std_450_header.h"
#include "latest_version_opencl_std_header.h"
#include "latest_version_spirv_header.h"

#include "binary.h"
#include "diagnostic.h"
#include "enum_string_mapping.h"
#include "ext_inst.h"
#include "extensions.h"
#include "id_descriptor.h"
#include "instruction.h"
#include "markv.h"
#include "markv_model.h"
#include "opcode.h"
#include "operand.h"
#include "source/assembly_grammar.h"
#include "source/binary.h"
#include "source/comp/markv.h"
#include "source/comp/markv_model.h"
#include "source/diagnostic.h"
#include "source/enum_string_mapping.h"
#include "source/ext_inst.h"
#include "source/extensions.h"
#include "source/id_descriptor.h"
#include "source/instruction.h"
#include "source/latest_version_glsl_std_450_header.h"
#include "source/latest_version_opencl_std_header.h"
#include "source/latest_version_spirv_header.h"
#include "source/opcode.h"
#include "source/operand.h"
#include "source/spirv_endian.h"
#include "source/spirv_validator_options.h"
#include "source/util/bit_stream.h"
#include "source/util/huffman_codec.h"
#include "source/util/move_to_front.h"
#include "source/util/parse_number.h"
#include "source/val/instruction.h"
#include "source/val/validate.h"
#include "spirv-tools/libspirv.h"
#include "spirv_endian.h"
#include "spirv_validator_options.h"
#include "util/bit_stream.h"
#include "util/huffman_codec.h"
#include "util/move_to_front.h"
#include "util/parse_number.h"
#include "val/instruction.h"
#include "val/validate.h"

namespace spvtools {
namespace comp {
Expand Down
7 changes: 5 additions & 2 deletions source/comp/markv_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
#define SOURCE_COMP_MARKV_MODEL_H_

#include <map>
#include <memory>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>

#include "latest_version_spirv_header.h"
#include "source/latest_version_spirv_header.h"
#include "source/util/huffman_codec.h"
#include "spirv-tools/libspirv.h"
#include "util/huffman_codec.h"

namespace spvtools {
namespace comp {
Expand Down
5 changes: 3 additions & 2 deletions source/diagnostic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "diagnostic.h"
#include "source/diagnostic.h"

#include <cassert>
#include <cstring>
#include <iostream>
#include <sstream>
#include <utility>

#include "table.h"
#include "source/table.h"

// Diagnostic API

Expand Down
27 changes: 14 additions & 13 deletions source/disassemble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@
#include <iomanip>
#include <memory>
#include <unordered_map>

#include "assembly_grammar.h"
#include "binary.h"
#include "diagnostic.h"
#include "disassemble.h"
#include "ext_inst.h"
#include "name_mapper.h"
#include "opcode.h"
#include "parsed_operand.h"
#include "print.h"
#include <utility>

#include "source/assembly_grammar.h"
#include "source/binary.h"
#include "source/diagnostic.h"
#include "source/disassemble.h"
#include "source/ext_inst.h"
#include "source/name_mapper.h"
#include "source/opcode.h"
#include "source/parsed_operand.h"
#include "source/print.h"
#include "source/spirv_constant.h"
#include "source/spirv_endian.h"
#include "source/util/hex_float.h"
#include "spirv-tools/libspirv.h"
#include "spirv_constant.h"
#include "spirv_endian.h"
#include "util/hex_float.h"

namespace {

Expand Down
2 changes: 1 addition & 1 deletion source/enum_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <set>
#include <utility>

#include "latest_version_spirv_header.h"
#include "source/latest_version_spirv_header.h"

namespace spvtools {

Expand Down
4 changes: 2 additions & 2 deletions source/enum_string_mapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "enum_string_mapping.h"
#include "source/enum_string_mapping.h"

#include <algorithm>
#include <cassert>
#include <cstring>
#include <string>
#include <unordered_map>

#include "extensions.h"
#include "source/extensions.h"

namespace spvtools {

Expand Down
4 changes: 2 additions & 2 deletions source/enum_string_mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

#include <string>

#include "extensions.h"
#include "latest_version_spirv_header.h"
#include "source/extensions.h"
#include "source/latest_version_spirv_header.h"

namespace spvtools {

Expand Down
16 changes: 8 additions & 8 deletions source/ext_inst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "ext_inst.h"
#include "source/ext_inst.h"

#include <cassert>
#include <cstring>
Expand All @@ -22,14 +22,14 @@
// TODO(dneto): DebugInfo.h should probably move to SPIRV-Headers.
#include "DebugInfo.h"

#include "latest_version_glsl_std_450_header.h"
#include "latest_version_opencl_std_header.h"
#include "macro.h"
#include "spirv_definition.h"
#include "source/latest_version_glsl_std_450_header.h"
#include "source/latest_version_opencl_std_header.h"
#include "source/macro.h"
#include "source/spirv_definition.h"

#include "debuginfo.insts.inc" // defines opencl_entries
#include "glsl.std.450.insts.inc" // defines glsl_entries
#include "opencl.std.insts.inc" // defines opencl_entries
#include "debuginfo.insts.inc"
#include "glsl.std.450.insts.inc"
#include "opencl.std.insts.inc"

#include "spv-amd-gcn-shader.insts.inc"
#include "spv-amd-shader-ballot.insts.inc"
Expand Down
2 changes: 1 addition & 1 deletion source/ext_inst.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#ifndef SOURCE_EXT_INST_H_
#define SOURCE_EXT_INST_H_

#include "source/table.h"
#include "spirv-tools/libspirv.h"
#include "table.h"

// Gets the type of the extended instruction set with the specified name.
spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name);
Expand Down
4 changes: 2 additions & 2 deletions source/extensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "extensions.h"
#include "source/extensions.h"

#include <cassert>
#include <sstream>
#include <string>

#include "enum_string_mapping.h"
#include "source/enum_string_mapping.h"

namespace spvtools {

Expand Down
2 changes: 1 addition & 1 deletion source/extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <string>

#include "enum_set.h"
#include "source/enum_set.h"
#include "spirv-tools/libspirv.h"

namespace spvtools {
Expand Down
6 changes: 3 additions & 3 deletions source/id_descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "id_descriptor.h"
#include "source/id_descriptor.h"

#include <cassert>
#include <iostream>

#include "opcode.h"
#include "operand.h"
#include "source/opcode.h"
#include "source/operand.h"

namespace spvtools {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion source/instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <cstdint>
#include <vector>

#include "latest_version_spirv_header.h"
#include "source/latest_version_spirv_header.h"
#include "spirv-tools/libspirv.h"

// Describes an instruction.
Expand Down
Loading

0 comments on commit eda2cfb

Please sign in to comment.