summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authordan sinclair <dj2@everburning.com>2018-08-03 15:06:09 -0400
committerGitHub <noreply@github.com>2018-08-03 15:06:09 -0400
commiteda2cfbe128e5b71e9a0131f816ade5186ad6420 (patch)
tree3342879b183f8cb6af3659033bd54fc2f3d7b921 /source
parent2d9a325264e3fc81317acc0a68a098f0546c352d (diff)
Cleanup includes. (#1795)
This Cl cleans up the include paths to be relative to the top level directory. Various include-what-you-use fixes have been added.
Diffstat (limited to 'source')
-rw-r--r--source/assembly_grammar.cpp10
-rw-r--r--source/assembly_grammar.h8
-rw-r--r--source/binary.cpp19
-rw-r--r--source/binary.h2
-rw-r--r--source/comp/markv.h2
-rw-r--r--source/comp/markv_codec.cpp48
-rw-r--r--source/comp/markv_model.h7
-rw-r--r--source/diagnostic.cpp5
-rw-r--r--source/disassemble.cpp27
-rw-r--r--source/enum_set.h2
-rw-r--r--source/enum_string_mapping.cpp4
-rw-r--r--source/enum_string_mapping.h4
-rw-r--r--source/ext_inst.cpp16
-rw-r--r--source/ext_inst.h2
-rw-r--r--source/extensions.cpp4
-rw-r--r--source/extensions.h2
-rw-r--r--source/id_descriptor.cpp6
-rw-r--r--source/instruction.h2
-rw-r--r--source/libspirv.cpp6
-rw-r--r--source/link/linker.cpp26
-rw-r--r--source/message.cpp2
-rw-r--r--source/name_mapper.cpp6
-rw-r--r--source/name_mapper.h2
-rw-r--r--source/opcode.cpp14
-rw-r--r--source/opcode.h6
-rw-r--r--source/operand.cpp8
-rw-r--r--source/operand.h3
-rw-r--r--source/opt/aggressive_dead_code_elim_pass.cpp13
-rw-r--r--source/opt/aggressive_dead_code_elim_pass.h13
-rw-r--r--source/opt/basic_block.cpp14
-rw-r--r--source/opt/basic_block.h7
-rw-r--r--source/opt/block_merge_pass.cpp8
-rw-r--r--source/opt/block_merge_pass.h10
-rw-r--r--source/opt/build_module.cpp13
-rw-r--r--source/opt/build_module.h4
-rw-r--r--source/opt/ccp_pass.cpp13
-rw-r--r--source/opt/ccp_pass.h15
-rw-r--r--source/opt/cfg.cpp14
-rw-r--r--source/opt/cfg.h5
-rw-r--r--source/opt/cfg_cleanup_pass.cpp6
-rw-r--r--source/opt/cfg_cleanup_pass.h6
-rw-r--r--source/opt/combine_access_chains.cpp10
-rw-r--r--source/opt/combine_access_chains.h4
-rw-r--r--source/opt/common_uniform_elim_pass.cpp6
-rw-r--r--source/opt/common_uniform_elim_pass.h18
-rw-r--r--source/opt/compact_ids_pass.cpp5
-rw-r--r--source/opt/compact_ids_pass.h6
-rw-r--r--source/opt/composite.cpp10
-rw-r--r--source/opt/composite.h9
-rw-r--r--source/opt/const_folding_rules.cpp4
-rw-r--r--source/opt/const_folding_rules.h3
-rw-r--r--source/opt/constants.cpp5
-rw-r--r--source/opt/constants.h11
-rw-r--r--source/opt/copy_prop_arrays.cpp7
-rw-r--r--source/opt/copy_prop_arrays.h5
-rw-r--r--source/opt/dead_branch_elim_pass.cpp14
-rw-r--r--source/opt/dead_branch_elim_pass.h9
-rw-r--r--source/opt/dead_insert_elim_pass.cpp10
-rw-r--r--source/opt/dead_insert_elim_pass.h11
-rw-r--r--source/opt/dead_variable_elimination.cpp8
-rw-r--r--source/opt/dead_variable_elimination.h4
-rw-r--r--source/opt/decoration_manager.cpp6
-rw-r--r--source/opt/decoration_manager.h4
-rw-r--r--source/opt/def_use_manager.cpp6
-rw-r--r--source/opt/def_use_manager.h5
-rw-r--r--source/opt/dominator_analysis.cpp4
-rw-r--r--source/opt/dominator_analysis.h2
-rw-r--r--source/opt/dominator_tree.cpp6
-rw-r--r--source/opt/dominator_tree.h4
-rw-r--r--source/opt/eliminate_dead_constant_pass.cpp11
-rw-r--r--source/opt/eliminate_dead_constant_pass.h6
-rw-r--r--source/opt/eliminate_dead_functions_pass.cpp5
-rw-r--r--source/opt/eliminate_dead_functions_pass.h8
-rw-r--r--source/opt/feature_manager.cpp6
-rw-r--r--source/opt/feature_manager.h6
-rw-r--r--source/opt/flatten_decoration_pass.cpp7
-rw-r--r--source/opt/flatten_decoration_pass.h6
-rw-r--r--source/opt/fold.cpp12
-rw-r--r--source/opt/fold.h8
-rw-r--r--source/opt/fold_spec_constant_op_and_composite_pass.cpp10
-rw-r--r--source/opt/fold_spec_constant_op_and_composite_pass.h12
-rw-r--r--source/opt/folding_rules.cpp8
-rw-r--r--source/opt/folding_rules.h3
-rw-r--r--source/opt/freeze_spec_constant_value_pass.cpp4
-rw-r--r--source/opt/freeze_spec_constant_value_pass.h6
-rw-r--r--source/opt/function.cpp2
-rw-r--r--source/opt/function.h7
-rw-r--r--source/opt/if_conversion.cpp7
-rw-r--r--source/opt/if_conversion.h8
-rw-r--r--source/opt/inline_exhaustive_pass.cpp4
-rw-r--r--source/opt/inline_exhaustive_pass.h6
-rw-r--r--source/opt/inline_opaque_pass.cpp5
-rw-r--r--source/opt/inline_opaque_pass.h6
-rw-r--r--source/opt/inline_pass.cpp7
-rw-r--r--source/opt/inline_pass.h7
-rw-r--r--source/opt/instruction.cpp10
-rw-r--r--source/opt/instruction.h16
-rw-r--r--source/opt/instruction_list.cpp2
-rw-r--r--source/opt/instruction_list.h10
-rw-r--r--source/opt/ir_builder.h13
-rw-r--r--source/opt/ir_context.cpp11
-rw-r--r--source/opt/ir_context.h35
-rw-r--r--source/opt/ir_loader.cpp8
-rw-r--r--source/opt/ir_loader.h8
-rw-r--r--source/opt/iterator.h1
-rw-r--r--source/opt/licm_pass.cpp7
-rw-r--r--source/opt/licm_pass.h11
-rw-r--r--source/opt/local_access_chain_convert_pass.cpp6
-rw-r--r--source/opt/local_access_chain_convert_pass.h11
-rw-r--r--source/opt/local_redundancy_elimination.cpp4
-rw-r--r--source/opt/local_redundancy_elimination.h8
-rw-r--r--source/opt/local_single_block_elim_pass.cpp7
-rw-r--r--source/opt/local_single_block_elim_pass.h9
-rw-r--r--source/opt/local_single_store_elim_pass.cpp8
-rw-r--r--source/opt/local_single_store_elim_pass.h10
-rw-r--r--source/opt/local_ssa_elim_pass.cpp8
-rw-r--r--source/opt/local_ssa_elim_pass.h10
-rw-r--r--source/opt/loop_dependence.cpp8
-rw-r--r--source/opt/loop_dependence.h8
-rw-r--r--source/opt/loop_dependence_helpers.cpp10
-rw-r--r--source/opt/loop_descriptor.cpp21
-rw-r--r--source/opt/loop_descriptor.h9
-rw-r--r--source/opt/loop_fission.cpp7
-rw-r--r--source/opt/loop_fission.h12
-rw-r--r--source/opt/loop_fusion.cpp8
-rw-r--r--source/opt/loop_fusion.h9
-rw-r--r--source/opt/loop_fusion_pass.cpp10
-rw-r--r--source/opt/loop_fusion_pass.h2
-rw-r--r--source/opt/loop_peeling.cpp14
-rw-r--r--source/opt/loop_peeling.h11
-rw-r--r--source/opt/loop_unroller.cpp11
-rw-r--r--source/opt/loop_unroller.h3
-rw-r--r--source/opt/loop_unswitch_pass.cpp20
-rw-r--r--source/opt/loop_unswitch_pass.h4
-rw-r--r--source/opt/loop_utils.cpp13
-rw-r--r--source/opt/loop_utils.h7
-rw-r--r--source/opt/mem_pass.cpp16
-rw-r--r--source/opt/mem_pass.h10
-rw-r--r--source/opt/merge_return_pass.cpp16
-rw-r--r--source/opt/merge_return_pass.h9
-rw-r--r--source/opt/module.cpp6
-rw-r--r--source/opt/module.h6
-rw-r--r--source/opt/null_pass.h4
-rw-r--r--source/opt/optimizer.cpp20
-rw-r--r--source/opt/pass.cpp4
-rw-r--r--source/opt/pass.h8
-rw-r--r--source/opt/pass_manager.cpp7
-rw-r--r--source/opt/pass_manager.h9
-rw-r--r--source/opt/passes.h93
-rw-r--r--source/opt/private_to_local_pass.cpp15
-rw-r--r--source/opt/private_to_local_pass.h4
-rw-r--r--source/opt/propagator.cpp2
-rw-r--r--source/opt/propagator.h5
-rw-r--r--source/opt/reduce_load_size.cpp15
-rw-r--r--source/opt/reduce_load_size.h8
-rw-r--r--source/opt/redundancy_elimination.cpp4
-rw-r--r--source/opt/redundancy_elimination.h10
-rw-r--r--source/opt/reflect.h2
-rw-r--r--source/opt/register_pressure.cpp15
-rw-r--r--source/opt/register_pressure.h4
-rw-r--r--source/opt/remove_duplicates_pass.cpp14
-rw-r--r--source/opt/remove_duplicates_pass.h11
-rw-r--r--source/opt/replace_invalid_opc.cpp3
-rw-r--r--source/opt/replace_invalid_opc.h4
-rw-r--r--source/opt/scalar_analysis.cpp4
-rw-r--r--source/opt/scalar_analysis.h7
-rw-r--r--source/opt/scalar_analysis_nodes.h3
-rw-r--r--source/opt/scalar_analysis_simplification.cpp2
-rw-r--r--source/opt/scalar_replacement_pass.cpp16
-rw-r--r--source/opt/scalar_replacement_pass.h13
-rw-r--r--source/opt/set_spec_constant_default_value_pass.cpp14
-rw-r--r--source/opt/set_spec_constant_default_value_pass.h8
-rw-r--r--source/opt/simplification_pass.cpp4
-rw-r--r--source/opt/simplification_pass.h6
-rw-r--r--source/opt/ssa_rewrite_pass.cpp12
-rw-r--r--source/opt/ssa_rewrite_pass.h13
-rw-r--r--source/opt/strength_reduction_pass.cpp13
-rw-r--r--source/opt/strength_reduction_pass.h8
-rw-r--r--source/opt/strip_debug_info_pass.cpp4
-rw-r--r--source/opt/strip_debug_info_pass.h6
-rw-r--r--source/opt/strip_reflect_info_pass.cpp7
-rw-r--r--source/opt/strip_reflect_info_pass.h6
-rw-r--r--source/opt/type_manager.cpp11
-rw-r--r--source/opt/type_manager.h5
-rw-r--r--source/opt/types.cpp2
-rw-r--r--source/opt/types.h3
-rw-r--r--source/opt/unify_const_pass.cpp10
-rw-r--r--source/opt/unify_const_pass.h6
-rw-r--r--source/opt/value_number_table.cpp6
-rw-r--r--source/opt/value_number_table.h3
-rw-r--r--source/opt/vector_dce.cpp11
-rw-r--r--source/opt/vector_dce.h7
-rw-r--r--source/opt/workaround1209.cpp4
-rw-r--r--source/opt/workaround1209.h2
-rw-r--r--source/parsed_operand.cpp4
-rw-r--r--source/parsed_operand.h1
-rw-r--r--source/print.cpp2
-rw-r--r--source/spirv_constant.h2
-rw-r--r--source/spirv_definition.h2
-rw-r--r--source/spirv_endian.cpp2
-rw-r--r--source/spirv_stats.cpp22
-rw-r--r--source/spirv_stats.h1
-rw-r--r--source/spirv_target_env.cpp4
-rw-r--r--source/spirv_validator_options.cpp2
-rw-r--r--source/table.cpp2
-rw-r--r--source/table.h6
-rw-r--r--source/text.cpp32
-rw-r--r--source/text.h4
-rw-r--r--source/text_handler.cpp20
-rw-r--r--source/text_handler.h11
-rw-r--r--source/util/bit_stream.cpp2
-rw-r--r--source/util/bit_stream.h1
-rw-r--r--source/util/bit_vector.cpp2
-rw-r--r--source/util/hex_float.h2
-rw-r--r--source/util/huffman_codec.h2
-rw-r--r--source/util/ilist.h2
-rw-r--r--source/util/move_to_front.h1
-rw-r--r--source/util/parse_number.cpp4
-rw-r--r--source/util/parse_number.h2
-rw-r--r--source/util/small_vector.h4
-rw-r--r--source/util/string_utils.cpp2
-rw-r--r--source/util/string_utils.h2
-rw-r--r--source/util/timer.cpp2
-rw-r--r--source/val/basic_block.cpp2
-rw-r--r--source/val/basic_block.h5
-rw-r--r--source/val/construct.cpp5
-rw-r--r--source/val/construct.h4
-rw-r--r--source/val/decoration.h2
-rw-r--r--source/val/function.cpp10
-rw-r--r--source/val/function.h8
-rw-r--r--source/val/instruction.cpp2
-rw-r--r--source/val/instruction.h2
-rw-r--r--source/val/validate.h1
-rw-r--r--source/val/validate_arithmetics.cpp2
-rw-r--r--source/val/validate_barriers.cpp2
-rw-r--r--source/val/validate_builtins.cpp1
-rw-r--r--source/val/validate_capability.cpp1
-rw-r--r--source/val/validate_decorations.cpp1
-rw-r--r--source/val/validate_derivatives.cpp2
-rw-r--r--source/val/validate_ext_inst.cpp2
-rw-r--r--source/val/validate_id.cpp1
-rw-r--r--source/val/validate_image.cpp2
-rw-r--r--source/val/validate_instruction.cpp2
-rw-r--r--source/val/validate_interfaces.cpp1
-rw-r--r--source/val/validate_memory.cpp2
-rw-r--r--source/val/validation_state.cpp13
-rw-r--r--source/val/validation_state.h21
247 files changed, 1090 insertions, 846 deletions
diff --git a/source/assembly_grammar.cpp b/source/assembly_grammar.cpp
index f20810d9..4d98e3da 100644
--- a/source/assembly_grammar.cpp
+++ b/source/assembly_grammar.cpp
@@ -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 {
diff --git a/source/assembly_grammar.h b/source/assembly_grammar.h
index 1053396a..17c2bd3b 100644
--- a/source/assembly_grammar.h
+++ b/source/assembly_grammar.h
@@ -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 {
diff --git a/source/binary.cpp b/source/binary.cpp
index 690ef0a5..6604d809 100644
--- a/source/binary.cpp
+++ b/source/binary.cpp
@@ -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,
diff --git a/source/binary.h b/source/binary.h
index a707bee7..66d24c7e 100644
--- a/source/binary.h
+++ b/source/binary.h
@@ -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
diff --git a/source/comp/markv.h b/source/comp/markv.h
index e687773f..16b49822 100644
--- a/source/comp/markv.h
+++ b/source/comp/markv.h
@@ -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 {
diff --git a/source/comp/markv_codec.cpp b/source/comp/markv_codec.cpp
index 825f2eb5..2956d8ed 100644
--- a/source/comp/markv_codec.cpp
+++ b/source/comp/markv_codec.cpp
@@ -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 {
diff --git a/source/comp/markv_model.h b/source/comp/markv_model.h
index 9533a5df..61ccf234 100644
--- a/source/comp/markv_model.h
+++ b/source/comp/markv_model.h
@@ -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 {
diff --git a/source/diagnostic.cpp b/source/diagnostic.cpp
index ad9d3836..243e93c2 100644
--- a/source/diagnostic.cpp
+++ b/source/diagnostic.cpp
@@ -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
diff --git a/source/disassemble.cpp b/source/disassemble.cpp
index 7bd64a73..11842cfc 100644
--- a/source/disassemble.cpp
+++ b/source/disassemble.cpp
@@ -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 {
diff --git a/source/enum_set.h b/source/enum_set.h
index 95cfc497..b428effb 100644
--- a/source/enum_set.h
+++ b/source/enum_set.h
@@ -21,7 +21,7 @@
#include <set>
#include <utility>
-#include "latest_version_spirv_header.h"
+#include "source/latest_version_spirv_header.h"
namespace spvtools {
diff --git a/source/enum_string_mapping.cpp b/source/enum_string_mapping.cpp
index 20bbdfc1..32361a08 100644
--- a/source/enum_string_mapping.cpp
+++ b/source/enum_string_mapping.cpp
@@ -12,7 +12,7 @@
// 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>
@@ -20,7 +20,7 @@
#include <string>
#include <unordered_map>
-#include "extensions.h"
+#include "source/extensions.h"
namespace spvtools {
diff --git a/source/enum_string_mapping.h b/source/enum_string_mapping.h
index e8f00ebf..af8f56b8 100644
--- a/source/enum_string_mapping.h
+++ b/source/enum_string_mapping.h
@@ -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 {
diff --git a/source/ext_inst.cpp b/source/ext_inst.cpp
index acc6dc65..a4c00c2f 100644
--- a/source/ext_inst.cpp
+++ b/source/ext_inst.cpp
@@ -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>
@@ -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"
diff --git a/source/ext_inst.h b/source/ext_inst.h
index 18cbf01e..a821cc2b 100644
--- a/source/ext_inst.h
+++ b/source/ext_inst.h
@@ -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);
diff --git a/source/extensions.cpp b/source/extensions.cpp
index bf3849cb..a94db273 100644
--- a/source/extensions.cpp
+++ b/source/extensions.cpp
@@ -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 {
diff --git a/source/extensions.h b/source/extensions.h
index 4b0c9119..8023444c 100644
--- a/source/extensions.h
+++ b/source/extensions.h
@@ -17,7 +17,7 @@
#include <string>
-#include "enum_set.h"
+#include "source/enum_set.h"
#include "spirv-tools/libspirv.h"
namespace spvtools {
diff --git a/source/id_descriptor.cpp b/source/id_descriptor.cpp
index 9dd43277..d44ed672 100644
--- a/source/id_descriptor.cpp
+++ b/source/id_descriptor.cpp
@@ -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 {
diff --git a/source/instruction.h b/source/instruction.h
index 439a5ada..9e7dccd0 100644
--- a/source/instruction.h
+++ b/source/instruction.h
@@ -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.
diff --git a/source/libspirv.cpp b/source/libspirv.cpp
index c9976ca4..53a4ffb8 100644
--- a/source/libspirv.cpp
+++ b/source/libspirv.cpp
@@ -14,7 +14,11 @@
#include "spirv-tools/libspirv.hpp"
-#include "table.h"
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "source/table.h"
namespace spvtools {
diff --git a/source/link/linker.cpp b/source/link/linker.cpp
index 4a7e8063..5279c780 100644
--- a/source/link/linker.cpp
+++ b/source/link/linker.cpp
@@ -14,26 +14,28 @@
#include "spirv-tools/linker.hpp"
+#include <algorithm>
#include <cstdio>
#include <cstring>
-
-#include <algorithm>
#include <iostream>
+#include <memory>
+#include <string>
#include <unordered_map>
#include <unordered_set>
+#include <utility>
#include <vector>
-#include "assembly_grammar.h"
-#include "diagnostic.h"
-#include "opt/build_module.h"
-#include "opt/compact_ids_pass.h"
-#include "opt/decoration_manager.h"
-#include "opt/ir_loader.h"
-#include "opt/make_unique.h"
-#include "opt/pass_manager.h"
-#include "opt/remove_duplicates_pass.h"
+#include "source/assembly_grammar.h"
+#include "source/diagnostic.h"
+#include "source/opt/build_module.h"
+#include "source/opt/compact_ids_pass.h"
+#include "source/opt/decoration_manager.h"
+#include "source/opt/ir_loader.h"
+#include "source/opt/make_unique.h"
+#include "source/opt/pass_manager.h"
+#include "source/opt/remove_duplicates_pass.h"
+#include "source/spirv_target_env.h"
#include "spirv-tools/libspirv.hpp"
-#include "spirv_target_env.h"
namespace spvtools {
namespace {
diff --git a/source/message.cpp b/source/message.cpp
index 030fa4e2..d7e2f3cc 100644
--- a/source/message.cpp
+++ b/source/message.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "message.h"
+#include "source/message.h"
#include <sstream>
diff --git a/source/name_mapper.cpp b/source/name_mapper.cpp
index d41eb31b..43fdfb34 100644
--- a/source/name_mapper.cpp
+++ b/source/name_mapper.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "name_mapper.h"
+#include "source/name_mapper.h"
#include <algorithm>
#include <cassert>
@@ -24,8 +24,8 @@
#include "spirv-tools/libspirv.h"
-#include "latest_version_spirv_header.h"
-#include "parsed_operand.h"
+#include "source/latest_version_spirv_header.h"
+#include "source/parsed_operand.h"
namespace spvtools {
namespace {
diff --git a/source/name_mapper.h b/source/name_mapper.h
index 2f94d5e0..6902141b 100644
--- a/source/name_mapper.h
+++ b/source/name_mapper.h
@@ -20,7 +20,7 @@
#include <unordered_map>
#include <unordered_set>
-#include "assembly_grammar.h"
+#include "source/assembly_grammar.h"
#include "spirv-tools/libspirv.h"
namespace spvtools {
diff --git a/source/opcode.cpp b/source/opcode.cpp
index f03da6cf..af34b646 100644
--- a/source/opcode.cpp
+++ b/source/opcode.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "opcode.h"
+#include "source/opcode.h"
#include <assert.h>
#include <string.h>
@@ -20,12 +20,12 @@
#include <algorithm>
#include <cstdlib>
-#include "instruction.h"
-#include "macro.h"
+#include "source/instruction.h"
+#include "source/macro.h"
+#include "source/spirv_constant.h"
+#include "source/spirv_endian.h"
+#include "source/spirv_target_env.h"
#include "spirv-tools/libspirv.h"
-#include "spirv_constant.h"
-#include "spirv_endian.h"
-#include "spirv_target_env.h"
namespace {
struct OpcodeDescPtrLen {
@@ -33,7 +33,7 @@ struct OpcodeDescPtrLen {
uint32_t len;
};
-#include "core.insts-unified1.inc" // defines kOpcodeTableEntries_1_3
+#include "core.insts-unified1.inc"
static const spv_opcode_table_t kOpcodeTable = {ARRAY_SIZE(kOpcodeTableEntries),
kOpcodeTableEntries};
diff --git a/source/opcode.h b/source/opcode.h
index 78462043..5643a64c 100644
--- a/source/opcode.h
+++ b/source/opcode.h
@@ -15,10 +15,10 @@
#ifndef SOURCE_OPCODE_H_
#define SOURCE_OPCODE_H_
-#include "instruction.h"
-#include "latest_version_spirv_header.h"
+#include "source/instruction.h"
+#include "source/latest_version_spirv_header.h"
+#include "source/table.h"
#include "spirv-tools/libspirv.h"
-#include "table.h"
// Returns the name of a registered SPIR-V generator as a null-terminated
// string. If the generator is not known, then returns the string "Unknown".
diff --git a/source/operand.cpp b/source/operand.cpp
index 01e51d2f..c97b13fc 100644
--- a/source/operand.cpp
+++ b/source/operand.cpp
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "operand.h"
+#include "source/operand.h"
#include <assert.h>
#include <string.h>
#include <algorithm>
-#include "macro.h"
-#include "spirv_constant.h"
-#include "spirv_target_env.h"
+#include "source/macro.h"
+#include "source/spirv_constant.h"
+#include "source/spirv_target_env.h"
// For now, assume unified1 contains up to SPIR-V 1.3 and no later
// SPIR-V version.
diff --git a/source/operand.h b/source/operand.h
index b2567374..76f16f7a 100644
--- a/source/operand.h
+++ b/source/operand.h
@@ -16,9 +16,10 @@
#define SOURCE_OPERAND_H_
#include <functional>
+#include <vector>
+#include "source/table.h"
#include "spirv-tools/libspirv.h"
-#include "table.h"
// A sequence of operand types.
//
diff --git a/source/opt/aggressive_dead_code_elim_pass.cpp b/source/opt/aggressive_dead_code_elim_pass.cpp
index 54fc8d71..39970a56 100644
--- a/source/opt/aggressive_dead_code_elim_pass.cpp
+++ b/source/opt/aggressive_dead_code_elim_pass.cpp
@@ -15,15 +15,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "aggressive_dead_code_elim_pass.h"
-
-#include "cfa.h"
-#include "iterator.h"
-#include "latest_version_glsl_std_450_header.h"
-#include "reflect.h"
+#include "source/opt/aggressive_dead_code_elim_pass.h"
+#include <memory>
#include <stack>
+#include "source/cfa.h"
+#include "source/latest_version_glsl_std_450_header.h"
+#include "source/opt/iterator.h"
+#include "source/opt/reflect.h"
+
namespace spvtools {
namespace opt {
diff --git a/source/opt/aggressive_dead_code_elim_pass.h b/source/opt/aggressive_dead_code_elim_pass.h
index 9c25505c..73457cee 100644
--- a/source/opt/aggressive_dead_code_elim_pass.h
+++ b/source/opt/aggressive_dead_code_elim_pass.h
@@ -17,18 +17,21 @@
#ifndef SOURCE_OPT_AGGRESSIVE_DEAD_CODE_ELIM_PASS_H_
#define SOURCE_OPT_AGGRESSIVE_DEAD_CODE_ELIM_PASS_H_
-#include <util/bit_vector.h>
#include <algorithm>
+#include <list>
#include <map>
#include <queue>
+#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
+#include <vector>
-#include "basic_block.h"
-#include "def_use_manager.h"
-#include "mem_pass.h"
-#include "module.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/mem_pass.h"
+#include "source/opt/module.h"
+#include "source/util/bit_vector.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/basic_block.cpp b/source/opt/basic_block.cpp
index 9d101ba2..1165efd0 100644
--- a/source/opt/basic_block.cpp
+++ b/source/opt/basic_block.cpp
@@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "basic_block.h"
-#include "function.h"
-#include "ir_context.h"
-#include "module.h"
-#include "reflect.h"
-
-#include "make_unique.h"
+#include "source/opt/basic_block.h"
#include <ostream>
+#include "source/opt/function.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/make_unique.h"
+#include "source/opt/module.h"
+#include "source/opt/reflect.h"
+
namespace spvtools {
namespace opt {
namespace {
diff --git a/source/opt/basic_block.h b/source/opt/basic_block.h
index f67b920b..9e1706e1 100644
--- a/source/opt/basic_block.h
+++ b/source/opt/basic_block.h
@@ -22,12 +22,13 @@
#include <iterator>
#include <memory>
#include <ostream>
+#include <string>
#include <utility>
#include <vector>
-#include "instruction.h"
-#include "instruction_list.h"
-#include "iterator.h"
+#include "source/opt/instruction.h"
+#include "source/opt/instruction_list.h"
+#include "source/opt/iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/block_merge_pass.cpp b/source/opt/block_merge_pass.cpp
index 9d5bc5cd..aa4c1bd9 100644
--- a/source/opt/block_merge_pass.cpp
+++ b/source/opt/block_merge_pass.cpp
@@ -14,10 +14,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "block_merge_pass.h"
+#include "source/opt/block_merge_pass.h"
-#include "ir_context.h"
-#include "iterator.h"
+#include <vector>
+
+#include "source/opt/ir_context.h"
+#include "source/opt/iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/block_merge_pass.h b/source/opt/block_merge_pass.h
index 08891d40..0ecde488 100644
--- a/source/opt/block_merge_pass.h
+++ b/source/opt/block_merge_pass.h
@@ -24,11 +24,11 @@
#include <unordered_set>
#include <utility>
-#include "basic_block.h"
-#include "def_use_manager.h"
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/build_module.cpp b/source/opt/build_module.cpp
index e0b2ce1b..a724994b 100644
--- a/source/opt/build_module.cpp
+++ b/source/opt/build_module.cpp
@@ -12,12 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "build_module.h"
+#include "source/opt/build_module.h"
-#include "ir_context.h"
-#include "ir_loader.h"
-#include "make_unique.h"
-#include "table.h"
+#include <utility>
+#include <vector>
+
+#include "source/opt/ir_context.h"
+#include "source/opt/ir_loader.h"
+#include "source/opt/make_unique.h"
+#include "source/table.h"
namespace spvtools {
namespace {
diff --git a/source/opt/build_module.h b/source/opt/build_module.h
index 71e963c8..c9d1cf2e 100644
--- a/source/opt/build_module.h
+++ b/source/opt/build_module.h
@@ -18,8 +18,8 @@
#include <memory>
#include <string>
-#include "ir_context.h"
-#include "module.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
#include "spirv-tools/libspirv.hpp"
namespace spvtools {
diff --git a/source/opt/ccp_pass.cpp b/source/opt/ccp_pass.cpp
index 570d2022..a8411d9f 100644
--- a/source/opt/ccp_pass.cpp
+++ b/source/opt/ccp_pass.cpp
@@ -16,13 +16,16 @@
//
// Constant propagation with conditional branches,
// Wegman and Zadeck, ACM TOPLAS 13(2):181-210.
-#include "ccp_pass.h"
-#include "fold.h"
-#include "function.h"
-#include "module.h"
-#include "propagator.h"
+
+#include "source/opt/ccp_pass.h"
#include <algorithm>
+#include <limits>
+
+#include "source/opt/fold.h"
+#include "source/opt/function.h"
+#include "source/opt/module.h"
+#include "source/opt/propagator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/ccp_pass.h b/source/opt/ccp_pass.h
index 15a82e1d..178fd128 100644
--- a/source/opt/ccp_pass.h
+++ b/source/opt/ccp_pass.h
@@ -15,12 +15,15 @@
#ifndef SOURCE_OPT_CCP_PASS_H_
#define SOURCE_OPT_CCP_PASS_H_
-#include "constants.h"
-#include "function.h"
-#include "ir_context.h"
-#include "mem_pass.h"
-#include "module.h"
-#include "propagator.h"
+#include <memory>
+#include <unordered_map>
+
+#include "source/opt/constants.h"
+#include "source/opt/function.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/mem_pass.h"
+#include "source/opt/module.h"
+#include "source/opt/propagator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/cfg.cpp b/source/opt/cfg.cpp
index fa3e50f3..dcf2b573 100644
--- a/source/opt/cfg.cpp
+++ b/source/opt/cfg.cpp
@@ -12,11 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "cfg.h"
-#include "cfa.h"
-#include "ir_builder.h"
-#include "ir_context.h"
-#include "module.h"
+#include "source/opt/cfg.h"
+
+#include <memory>
+#include <utility>
+
+#include "source/cfa.h"
+#include "source/opt/ir_builder.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/cfg.h b/source/opt/cfg.h
index f1dff650..375d09c5 100644
--- a/source/opt/cfg.h
+++ b/source/opt/cfg.h
@@ -15,12 +15,13 @@
#ifndef SOURCE_OPT_CFG_H_
#define SOURCE_OPT_CFG_H_
-#include "basic_block.h"
-
#include <algorithm>
#include <list>
#include <unordered_map>
#include <unordered_set>
+#include <vector>
+
+#include "source/opt/basic_block.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/cfg_cleanup_pass.cpp b/source/opt/cfg_cleanup_pass.cpp
index ac99135e..2d548462 100644
--- a/source/opt/cfg_cleanup_pass.cpp
+++ b/source/opt/cfg_cleanup_pass.cpp
@@ -19,10 +19,10 @@
#include <queue>
#include <unordered_set>
-#include "cfg_cleanup_pass.h"
+#include "source/opt/cfg_cleanup_pass.h"
-#include "function.h"
-#include "module.h"
+#include "source/opt/function.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/cfg_cleanup_pass.h b/source/opt/cfg_cleanup_pass.h
index 065c8dd1..afbc67c0 100644
--- a/source/opt/cfg_cleanup_pass.h
+++ b/source/opt/cfg_cleanup_pass.h
@@ -15,9 +15,9 @@
#ifndef SOURCE_OPT_CFG_CLEANUP_PASS_H_
#define SOURCE_OPT_CFG_CLEANUP_PASS_H_
-#include "function.h"
-#include "mem_pass.h"
-#include "module.h"
+#include "source/opt/function.h"
+#include "source/opt/mem_pass.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/combine_access_chains.cpp b/source/opt/combine_access_chains.cpp
index ccefb258..facfc24b 100644
--- a/source/opt/combine_access_chains.cpp
+++ b/source/opt/combine_access_chains.cpp
@@ -12,11 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "combine_access_chains.h"
+#include "source/opt/combine_access_chains.h"
-#include "constants.h"
-#include "ir_builder.h"
-#include "ir_context.h"
+#include <utility>
+
+#include "source/opt/constants.h"
+#include "source/opt/ir_builder.h"
+#include "source/opt/ir_context.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/combine_access_chains.h b/source/opt/combine_access_chains.h
index bbf6de0e..75885dad 100644
--- a/source/opt/combine_access_chains.h
+++ b/source/opt/combine_access_chains.h
@@ -15,7 +15,9 @@
#ifndef SOURCE_OPT_COMBINE_ACCESS_CHAINS_H_
#define SOURCE_OPT_COMBINE_ACCESS_CHAINS_H_
-#include "pass.h"
+#include <vector>
+
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/common_uniform_elim_pass.cpp b/source/opt/common_uniform_elim_pass.cpp
index e6a2b1c8..f7fe0b9e 100644
--- a/source/opt/common_uniform_elim_pass.cpp
+++ b/source/opt/common_uniform_elim_pass.cpp
@@ -14,9 +14,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "common_uniform_elim_pass.h"
-#include "cfa.h"
-#include "ir_context.h"
+#include "source/opt/common_uniform_elim_pass.h"
+#include "source/cfa.h"
+#include "source/opt/ir_context.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/common_uniform_elim_pass.h b/source/opt/common_uniform_elim_pass.h
index e3a6106e..e6ef69c5 100644
--- a/source/opt/common_uniform_elim_pass.h
+++ b/source/opt/common_uniform_elim_pass.h
@@ -18,18 +18,22 @@
#define SOURCE_OPT_COMMON_UNIFORM_ELIM_PASS_H_
#include <algorithm>
+#include <list>
#include <map>
+#include <memory>
#include <queue>
+#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
-
-#include "basic_block.h"
-#include "decoration_manager.h"
-#include "def_use_manager.h"
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
+#include <vector>
+
+#include "source/opt/basic_block.h"
+#include "source/opt/decoration_manager.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/compact_ids_pass.cpp b/source/opt/compact_ids_pass.cpp
index 7fe58228..68b940f1 100644
--- a/source/opt/compact_ids_pass.cpp
+++ b/source/opt/compact_ids_pass.cpp
@@ -12,12 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "compact_ids_pass.h"
-#include "ir_context.h"
+#include "source/opt/compact_ids_pass.h"
#include <cassert>
#include <unordered_map>
+#include "source/opt/ir_context.h"
+
namespace spvtools {
namespace opt {
diff --git a/source/opt/compact_ids_pass.h b/source/opt/compact_ids_pass.h
index a73f1815..d97ae0fa 100644
--- a/source/opt/compact_ids_pass.h
+++ b/source/opt/compact_ids_pass.h
@@ -15,9 +15,9 @@
#ifndef SOURCE_OPT_COMPACT_IDS_PASS_H_
#define SOURCE_OPT_COMPACT_IDS_PASS_H_
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/composite.cpp b/source/opt/composite.cpp
index 8d35d05b..2b4dca25 100644
--- a/source/opt/composite.cpp
+++ b/source/opt/composite.cpp
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "composite.h"
-
-#include "ir_context.h"
-#include "iterator.h"
-#include "spirv/1.2/GLSL.std.450.h"
+#include "source/opt/composite.h"
#include <vector>
+#include "source/opt/ir_context.h"
+#include "source/opt/iterator.h"
+#include "spirv/1.2/GLSL.std.450.h"
+
namespace spvtools {
namespace opt {
diff --git a/source/opt/composite.h b/source/opt/composite.h
index 376ae349..3cc036e4 100644
--- a/source/opt/composite.h
+++ b/source/opt/composite.h
@@ -22,11 +22,12 @@
#include <unordered_map>
#include <unordered_set>
#include <utility>
+#include <vector>
-#include "basic_block.h"
-#include "def_use_manager.h"
-#include "ir_context.h"
-#include "module.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/const_folding_rules.cpp b/source/opt/const_folding_rules.cpp
index 6b94986e..f6013a3d 100644
--- a/source/opt/const_folding_rules.cpp
+++ b/source/opt/const_folding_rules.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "const_folding_rules.h"
+#include "source/opt/const_folding_rules.h"
-#include "ir_context.h"
+#include "source/opt/ir_context.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/const_folding_rules.h b/source/opt/const_folding_rules.h
index f1f46e27..c1865792 100644
--- a/source/opt/const_folding_rules.h
+++ b/source/opt/const_folding_rules.h
@@ -15,9 +15,10 @@
#ifndef SOURCE_OPT_CONST_FOLDING_RULES_H_
#define SOURCE_OPT_CONST_FOLDING_RULES_H_
+#include <unordered_map>
#include <vector>
-#include "constants.h"
+#include "source/opt/constants.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/constants.cpp b/source/opt/constants.cpp
index ba7fc6b8..b1e4bee4 100644
--- a/source/opt/constants.cpp
+++ b/source/opt/constants.cpp
@@ -12,12 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "constants.h"
-#include "ir_context.h"
+#include "source/opt/constants.h"
#include <unordered_map>
#include <vector>
+#include "source/opt/ir_context.h"
+
namespace spvtools {
namespace opt {
namespace analysis {
diff --git a/source/opt/constants.h b/source/opt/constants.h
index 99e7d1ce..6fb22a53 100644
--- a/source/opt/constants.h
+++ b/source/opt/constants.h
@@ -16,17 +16,18 @@
#define SOURCE_OPT_CONSTANTS_H_
#include <cinttypes>
+#include <map>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
-#include "make_unique.h"
-#include "module.h"
-#include "type_manager.h"
-#include "types.h"
-#include "util/hex_float.h"
+#include "source/opt/make_unique.h"
+#include "source/opt/module.h"
+#include "source/opt/type_manager.h"
+#include "source/opt/types.h"
+#include "source/util/hex_float.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/copy_prop_arrays.cpp b/source/opt/copy_prop_arrays.cpp
index 6fa232fe..028b237d 100644
--- a/source/opt/copy_prop_arrays.cpp
+++ b/source/opt/copy_prop_arrays.cpp
@@ -12,8 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "copy_prop_arrays.h"
-#include "ir_builder.h"
+#include "source/opt/copy_prop_arrays.h"
+
+#include <utility>
+
+#include "source/opt/ir_builder.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/copy_prop_arrays.h b/source/opt/copy_prop_arrays.h
index 37a9aad5..abc07165 100644
--- a/source/opt/copy_prop_arrays.h
+++ b/source/opt/copy_prop_arrays.h
@@ -15,7 +15,10 @@
#ifndef SOURCE_OPT_COPY_PROP_ARRAYS_H_
#define SOURCE_OPT_COPY_PROP_ARRAYS_H_
-#include "mem_pass.h"
+#include <memory>
+#include <vector>
+
+#include "source/opt/mem_pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/dead_branch_elim_pass.cpp b/source/opt/dead_branch_elim_pass.cpp
index b0a7ab63..e031d396 100644
--- a/source/opt/dead_branch_elim_pass.cpp
+++ b/source/opt/dead_branch_elim_pass.cpp
@@ -15,12 +15,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "dead_branch_elim_pass.h"
+#include "source/opt/dead_branch_elim_pass.h"
-#include "cfa.h"
-#include "ir_context.h"
-#include "iterator.h"
-#include "make_unique.h"
+#include <list>
+#include <memory>
+#include <vector>
+
+#include "source/cfa.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/iterator.h"
+#include "source/opt/make_unique.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/dead_branch_elim_pass.h b/source/opt/dead_branch_elim_pass.h
index 42ec8011..4c6fb5c9 100644
--- a/source/opt/dead_branch_elim_pass.h
+++ b/source/opt/dead_branch_elim_pass.h
@@ -23,11 +23,12 @@
#include <unordered_map>
#include <unordered_set>
#include <utility>
+#include <vector>
-#include "basic_block.h"
-#include "def_use_manager.h"
-#include "mem_pass.h"
-#include "module.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/mem_pass.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/dead_insert_elim_pass.cpp b/source/opt/dead_insert_elim_pass.cpp
index 53bdad4e..b42588ff 100644
--- a/source/opt/dead_insert_elim_pass.cpp
+++ b/source/opt/dead_insert_elim_pass.cpp
@@ -14,15 +14,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "dead_insert_elim_pass.h"
+#include "source/opt/dead_insert_elim_pass.h"
-#include "composite.h"
-#include "ir_context.h"
-#include "iterator.h"
+#include "source/opt/composite.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/iterator.h"
#include "spirv/1.2/GLSL.std.450.h"
-#include <vector>
-
namespace spvtools {
namespace opt {
diff --git a/source/opt/dead_insert_elim_pass.h b/source/opt/dead_insert_elim_pass.h
index 5df969d5..0b111d02 100644
--- a/source/opt/dead_insert_elim_pass.h
+++ b/source/opt/dead_insert_elim_pass.h
@@ -22,12 +22,13 @@
#include <unordered_map>
#include <unordered_set>
#include <utility>
+#include <vector>
-#include "basic_block.h"
-#include "def_use_manager.h"
-#include "ir_context.h"
-#include "mem_pass.h"
-#include "module.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/mem_pass.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/dead_variable_elimination.cpp b/source/opt/dead_variable_elimination.cpp
index bdd97083..28371068 100644
--- a/source/opt/dead_variable_elimination.cpp
+++ b/source/opt/dead_variable_elimination.cpp
@@ -12,10 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "dead_variable_elimination.h"
+#include "source/opt/dead_variable_elimination.h"
-#include "ir_context.h"
-#include "reflect.h"
+#include <vector>
+
+#include "source/opt/ir_context.h"
+#include "source/opt/reflect.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/dead_variable_elimination.h b/source/opt/dead_variable_elimination.h
index be1f7884..052a754b 100644
--- a/source/opt/dead_variable_elimination.h
+++ b/source/opt/dead_variable_elimination.h
@@ -18,8 +18,8 @@
#include <climits>
#include <unordered_map>
-#include "decoration_manager.h"
-#include "mem_pass.h"
+#include "source/opt/decoration_manager.h"
+#include "source/opt/mem_pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/decoration_manager.cpp b/source/opt/decoration_manager.cpp
index f218e149..aeddb88c 100644
--- a/source/opt/decoration_manager.cpp
+++ b/source/opt/decoration_manager.cpp
@@ -12,13 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "decoration_manager.h"
+#include "source/opt/decoration_manager.h"
#include <algorithm>
+#include <memory>
#include <set>
#include <stack>
+#include <utility>
-#include "ir_context.h"
+#include "source/opt/ir_context.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/decoration_manager.h b/source/opt/decoration_manager.h
index 3becd22f..4561bfa8 100644
--- a/source/opt/decoration_manager.h
+++ b/source/opt/decoration_manager.h
@@ -20,8 +20,8 @@
#include <unordered_set>
#include <vector>
-#include "instruction.h"
-#include "module.h"
+#include "source/opt/instruction.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/def_use_manager.cpp b/source/opt/def_use_manager.cpp
index c581e399..4e364938 100644
--- a/source/opt/def_use_manager.cpp
+++ b/source/opt/def_use_manager.cpp
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "def_use_manager.h"
+#include "source/opt/def_use_manager.h"
#include <iostream>
-#include "log.h"
-#include "reflect.h"
+#include "source/opt/log.h"
+#include "source/opt/reflect.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/def_use_manager.h b/source/opt/def_use_manager.h
index 3d23e24b..0499e82b 100644
--- a/source/opt/def_use_manager.h
+++ b/source/opt/def_use_manager.h
@@ -18,10 +18,11 @@
#include <list>
#include <set>
#include <unordered_map>
+#include <utility>
#include <vector>
-#include "instruction.h"
-#include "module.h"
+#include "source/opt/instruction.h"
+#include "source/opt/module.h"
#include "spirv-tools/libspirv.hpp"
namespace spvtools {
diff --git a/source/opt/dominator_analysis.cpp b/source/opt/dominator_analysis.cpp
index f045ee46..aef43e69 100644
--- a/source/opt/dominator_analysis.cpp
+++ b/source/opt/dominator_analysis.cpp
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "dominator_analysis.h"
+#include "source/opt/dominator_analysis.h"
#include <unordered_set>
-#include "ir_context.h"
+#include "source/opt/ir_context.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/dominator_analysis.h b/source/opt/dominator_analysis.h
index eb21d2c2..a94120a5 100644
--- a/source/opt/dominator_analysis.h
+++ b/source/opt/dominator_analysis.h
@@ -18,7 +18,7 @@
#include <cstdint>
#include <map>
-#include "dominator_tree.h"
+#include "source/opt/dominator_tree.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/dominator_tree.cpp b/source/opt/dominator_tree.cpp
index df3aae6d..fc600d24 100644
--- a/source/opt/dominator_tree.cpp
+++ b/source/opt/dominator_tree.cpp
@@ -16,9 +16,9 @@
#include <memory>
#include <set>
-#include "cfa.h"
-#include "dominator_tree.h"
-#include "ir_context.h"
+#include "source/cfa.h"
+#include "source/opt/dominator_tree.h"
+#include "source/opt/ir_context.h"
// Calculates the dominator or postdominator tree for a given function.
// 1 - Compute the successors and predecessors for each BasicBlock. We add a
diff --git a/source/opt/dominator_tree.h b/source/opt/dominator_tree.h
index 18582e8c..0024bc50 100644
--- a/source/opt/dominator_tree.h
+++ b/source/opt/dominator_tree.h
@@ -21,8 +21,8 @@
#include <utility>
#include <vector>
-#include "cfg.h"
-#include "tree_iterator.h"
+#include "source/opt/cfg.h"
+#include "source/opt/tree_iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/eliminate_dead_constant_pass.cpp b/source/opt/eliminate_dead_constant_pass.cpp
index 28b84caf..d368bd14 100644
--- a/source/opt/eliminate_dead_constant_pass.cpp
+++ b/source/opt/eliminate_dead_constant_pass.cpp
@@ -12,16 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "eliminate_dead_constant_pass.h"
+#include "source/opt/eliminate_dead_constant_pass.h"
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
+#include <vector>
-#include "def_use_manager.h"
-#include "ir_context.h"
-#include "log.h"
-#include "reflect.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/log.h"
+#include "source/opt/reflect.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/eliminate_dead_constant_pass.h b/source/opt/eliminate_dead_constant_pass.h
index 4303295e..01692dbf 100644
--- a/source/opt/eliminate_dead_constant_pass.h
+++ b/source/opt/eliminate_dead_constant_pass.h
@@ -15,9 +15,9 @@
#ifndef SOURCE_OPT_ELIMINATE_DEAD_CONSTANT_PASS_H_
#define SOURCE_OPT_ELIMINATE_DEAD_CONSTANT_PASS_H_
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/eliminate_dead_functions_pass.cpp b/source/opt/eliminate_dead_functions_pass.cpp
index 383c267a..5be983a5 100644
--- a/source/opt/eliminate_dead_functions_pass.cpp
+++ b/source/opt/eliminate_dead_functions_pass.cpp
@@ -12,11 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "eliminate_dead_functions_pass.h"
-#include "ir_context.h"
+#include "source/opt/eliminate_dead_functions_pass.h"
#include <unordered_set>
+#include "source/opt/ir_context.h"
+
namespace spvtools {
namespace opt {
diff --git a/source/opt/eliminate_dead_functions_pass.h b/source/opt/eliminate_dead_functions_pass.h
index 3967cedb..165e9a6b 100644
--- a/source/opt/eliminate_dead_functions_pass.h
+++ b/source/opt/eliminate_dead_functions_pass.h
@@ -15,10 +15,10 @@
#ifndef SOURCE_OPT_ELIMINATE_DEAD_FUNCTIONS_PASS_H_
#define SOURCE_OPT_ELIMINATE_DEAD_FUNCTIONS_PASS_H_
-#include "def_use_manager.h"
-#include "function.h"
-#include "mem_pass.h"
-#include "module.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/function.h"
+#include "source/opt/mem_pass.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/feature_manager.cpp b/source/opt/feature_manager.cpp
index 15739f3a..b7fc16a5 100644
--- a/source/opt/feature_manager.cpp
+++ b/source/opt/feature_manager.cpp
@@ -12,11 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "feature_manager.h"
+#include "source/opt/feature_manager.h"
+
#include <queue>
#include <stack>
+#include <string>
-#include "enum_string_mapping.h"
+#include "source/enum_string_mapping.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/feature_manager.h b/source/opt/feature_manager.h
index 22828470..80b2cccf 100644
--- a/source/opt/feature_manager.h
+++ b/source/opt/feature_manager.h
@@ -15,9 +15,9 @@
#ifndef SOURCE_OPT_FEATURE_MANAGER_H_
#define SOURCE_OPT_FEATURE_MANAGER_H_
-#include "assembly_grammar.h"
-#include "extensions.h"
-#include "module.h"
+#include "source/assembly_grammar.h"
+#include "source/extensions.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/flatten_decoration_pass.cpp b/source/opt/flatten_decoration_pass.cpp
index 74c25fcb..f4de9116 100644
--- a/source/opt/flatten_decoration_pass.cpp
+++ b/source/opt/flatten_decoration_pass.cpp
@@ -12,14 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "flatten_decoration_pass.h"
-#include "ir_context.h"
+#include "source/opt/flatten_decoration_pass.h"
#include <cassert>
+#include <memory>
#include <unordered_map>
#include <unordered_set>
+#include <utility>
#include <vector>
+#include "source/opt/ir_context.h"
+
namespace spvtools {
namespace opt {
diff --git a/source/opt/flatten_decoration_pass.h b/source/opt/flatten_decoration_pass.h
index 541dabe8..c59821dc 100644
--- a/source/opt/flatten_decoration_pass.h
+++ b/source/opt/flatten_decoration_pass.h
@@ -15,9 +15,9 @@
#ifndef SOURCE_OPT_FLATTEN_DECORATION_PASS_H_
#define SOURCE_OPT_FLATTEN_DECORATION_PASS_H_
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/fold.cpp b/source/opt/fold.cpp
index 20071383..09d7e512 100644
--- a/source/opt/fold.cpp
+++ b/source/opt/fold.cpp
@@ -12,17 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "fold.h"
+#include "source/opt/fold.h"
#include <cassert>
#include <cstdint>
#include <vector>
-#include "const_folding_rules.h"
-#include "def_use_manager.h"
-#include "folding_rules.h"
-#include "ir_builder.h"
-#include "ir_context.h"
+#include "source/opt/const_folding_rules.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/folding_rules.h"
+#include "source/opt/ir_builder.h"
+#include "source/opt/ir_context.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/fold.h b/source/opt/fold.h
index bb88c0f0..0dc7c0eb 100644
--- a/source/opt/fold.h
+++ b/source/opt/fold.h
@@ -18,10 +18,10 @@
#include <cstdint>
#include <vector>
-#include "const_folding_rules.h"
-#include "constants.h"
-#include "def_use_manager.h"
-#include "folding_rules.h"
+#include "source/opt/const_folding_rules.h"
+#include "source/opt/constants.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/folding_rules.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/fold_spec_constant_op_and_composite_pass.cpp b/source/opt/fold_spec_constant_op_and_composite_pass.cpp
index 3f394e74..4692d150 100644
--- a/source/opt/fold_spec_constant_op_and_composite_pass.cpp
+++ b/source/opt/fold_spec_constant_op_and_composite_pass.cpp
@@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "fold_spec_constant_op_and_composite_pass.h"
+#include "source/opt/fold_spec_constant_op_and_composite_pass.h"
#include <algorithm>
#include <initializer_list>
#include <tuple>
-#include "constants.h"
-#include "fold.h"
-#include "ir_context.h"
-#include "make_unique.h"
+#include "source/opt/constants.h"
+#include "source/opt/fold.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/make_unique.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/fold_spec_constant_op_and_composite_pass.h b/source/opt/fold_spec_constant_op_and_composite_pass.h
index efc959c3..16271251 100644
--- a/source/opt/fold_spec_constant_op_and_composite_pass.h
+++ b/source/opt/fold_spec_constant_op_and_composite_pass.h
@@ -19,12 +19,12 @@
#include <unordered_map>
#include <vector>
-#include "constants.h"
-#include "def_use_manager.h"
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
-#include "type_manager.h"
+#include "source/opt/constants.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
+#include "source/opt/type_manager.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/folding_rules.cpp b/source/opt/folding_rules.cpp
index 7faa3610..c64cedfb 100644
--- a/source/opt/folding_rules.cpp
+++ b/source/opt/folding_rules.cpp
@@ -12,12 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "folding_rules.h"
+#include "source/opt/folding_rules.h"
#include <limits>
+#include <memory>
+#include <utility>
-#include "ir_context.h"
-#include "latest_version_glsl_std_450_header.h"
+#include "source/latest_version_glsl_std_450_header.h"
+#include "source/opt/ir_context.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/folding_rules.h b/source/opt/folding_rules.h
index 9c19dbb5..33fdbffe 100644
--- a/source/opt/folding_rules.h
+++ b/source/opt/folding_rules.h
@@ -16,9 +16,10 @@
#define SOURCE_OPT_FOLDING_RULES_H_
#include <cstdint>
+#include <unordered_map>
#include <vector>
-#include "constants.h"
+#include "source/opt/constants.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/freeze_spec_constant_value_pass.cpp b/source/opt/freeze_spec_constant_value_pass.cpp
index 60de4b2b..10e98fd8 100644
--- a/source/opt/freeze_spec_constant_value_pass.cpp
+++ b/source/opt/freeze_spec_constant_value_pass.cpp
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "freeze_spec_constant_value_pass.h"
-#include "ir_context.h"
+#include "source/opt/freeze_spec_constant_value_pass.h"
+#include "source/opt/ir_context.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/freeze_spec_constant_value_pass.h b/source/opt/freeze_spec_constant_value_pass.h
index 308adab3..0663adf4 100644
--- a/source/opt/freeze_spec_constant_value_pass.h
+++ b/source/opt/freeze_spec_constant_value_pass.h
@@ -15,9 +15,9 @@
#ifndef SOURCE_OPT_FREEZE_SPEC_CONSTANT_VALUE_PASS_H_
#define SOURCE_OPT_FREEZE_SPEC_CONSTANT_VALUE_PASS_H_
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/function.cpp b/source/opt/function.cpp
index 0fbf1e9f..c6894c68 100644
--- a/source/opt/function.cpp
+++ b/source/opt/function.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "function.h"
+#include "source/opt/function.h"
#include <ostream>
#include <sstream>
diff --git a/source/opt/function.h b/source/opt/function.h
index da5ee3ea..4dc5d25a 100644
--- a/source/opt/function.h
+++ b/source/opt/function.h
@@ -18,12 +18,13 @@
#include <algorithm>
#include <functional>
#include <memory>
+#include <string>
#include <utility>
#include <vector>
-#include "basic_block.h"
-#include "instruction.h"
-#include "iterator.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/instruction.h"
+#include "source/opt/iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/if_conversion.cpp b/source/opt/if_conversion.cpp
index 2e599519..7a3717f9 100644
--- a/source/opt/if_conversion.cpp
+++ b/source/opt/if_conversion.cpp
@@ -12,9 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "if_conversion.h"
+#include "source/opt/if_conversion.h"
-#include "value_number_table.h"
+#include <memory>
+#include <vector>
+
+#include "source/opt/value_number_table.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/if_conversion.h b/source/opt/if_conversion.h
index 30ad48b1..609bdf39 100644
--- a/source/opt/if_conversion.h
+++ b/source/opt/if_conversion.h
@@ -15,10 +15,10 @@
#ifndef SOURCE_OPT_IF_CONVERSION_H_
#define SOURCE_OPT_IF_CONVERSION_H_
-#include "basic_block.h"
-#include "ir_builder.h"
-#include "pass.h"
-#include "types.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/ir_builder.h"
+#include "source/opt/pass.h"
+#include "source/opt/types.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/inline_exhaustive_pass.cpp b/source/opt/inline_exhaustive_pass.cpp
index a5399f7e..5714cd86 100644
--- a/source/opt/inline_exhaustive_pass.cpp
+++ b/source/opt/inline_exhaustive_pass.cpp
@@ -14,7 +14,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "inline_exhaustive_pass.h"
+#include "source/opt/inline_exhaustive_pass.h"
+
+#include <utility>
namespace spvtools {
namespace opt {
diff --git a/source/opt/inline_exhaustive_pass.h b/source/opt/inline_exhaustive_pass.h
index 87ebd7a6..103e091e 100644
--- a/source/opt/inline_exhaustive_pass.h
+++ b/source/opt/inline_exhaustive_pass.h
@@ -23,9 +23,9 @@
#include <unordered_map>
#include <vector>
-#include "def_use_manager.h"
-#include "inline_pass.h"
-#include "module.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/inline_pass.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/inline_opaque_pass.cpp b/source/opt/inline_opaque_pass.cpp
index 03d74a9f..c2c3719f 100644
--- a/source/opt/inline_opaque_pass.cpp
+++ b/source/opt/inline_opaque_pass.cpp
@@ -14,11 +14,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "inline_opaque_pass.h"
+#include "source/opt/inline_opaque_pass.h"
+
+#include <utility>
namespace spvtools {
namespace opt {
-
namespace {
const uint32_t kTypePointerTypeIdInIdx = 1;
diff --git a/source/opt/inline_opaque_pass.h b/source/opt/inline_opaque_pass.h
index 1c36aaf1..aad43fd6 100644
--- a/source/opt/inline_opaque_pass.h
+++ b/source/opt/inline_opaque_pass.h
@@ -23,9 +23,9 @@
#include <unordered_map>
#include <vector>
-#include "def_use_manager.h"
-#include "inline_pass.h"
-#include "module.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/inline_pass.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/inline_pass.cpp b/source/opt/inline_pass.cpp
index 665f3a7b..6db027cc 100644
--- a/source/opt/inline_pass.cpp
+++ b/source/opt/inline_pass.cpp
@@ -14,9 +14,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "inline_pass.h"
+#include "source/opt/inline_pass.h"
-#include "cfa.h"
+#include <unordered_set>
+#include <utility>
+
+#include "source/cfa.h"
// Indices of operands in SPIR-V instructions
diff --git a/source/opt/inline_pass.h b/source/opt/inline_pass.h
index fedfc433..55369c98 100644
--- a/source/opt/inline_pass.h
+++ b/source/opt/inline_pass.h
@@ -20,12 +20,13 @@
#include <algorithm>
#include <list>
#include <memory>
+#include <set>
#include <unordered_map>
#include <vector>
-#include "decoration_manager.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/decoration_manager.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/instruction.cpp b/source/opt/instruction.cpp
index ea75657f..4cfa41d8 100644
--- a/source/opt/instruction.cpp
+++ b/source/opt/instruction.cpp
@@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "instruction.h"
+#include "source/opt/instruction.h"
#include <initializer_list>
-#include "disassemble.h"
-#include "fold.h"
-#include "ir_context.h"
-#include "reflect.h"
+#include "source/disassemble.h"
+#include "source/opt/fold.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/reflect.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/instruction.h b/source/opt/instruction.h
index 6c492d45..2533ba27 100644
--- a/source/opt/instruction.h
+++ b/source/opt/instruction.h
@@ -17,17 +17,19 @@
#include <cassert>
#include <functional>
+#include <memory>
+#include <string>
#include <utility>
#include <vector>
-#include "opcode.h"
-#include "operand.h"
-#include "util/ilist_node.h"
-#include "util/small_vector.h"
+#include "source/opcode.h"
+#include "source/operand.h"
+#include "source/util/ilist_node.h"
+#include "source/util/small_vector.h"
-#include "latest_version_glsl_std_450_header.h"
-#include "latest_version_spirv_header.h"
-#include "reflect.h"
+#include "source/latest_version_glsl_std_450_header.h"
+#include "source/latest_version_spirv_header.h"
+#include "source/opt/reflect.h"
#include "spirv-tools/libspirv.h"
namespace spvtools {
diff --git a/source/opt/instruction_list.cpp b/source/opt/instruction_list.cpp
index dfaaba4d..385a136e 100644
--- a/source/opt/instruction_list.cpp
+++ b/source/opt/instruction_list.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "instruction_list.h"
+#include "source/opt/instruction_list.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/instruction_list.h b/source/opt/instruction_list.h
index 6ea70647..ea1cc7c4 100644
--- a/source/opt/instruction_list.h
+++ b/source/opt/instruction_list.h
@@ -18,14 +18,14 @@
#include <cassert>
#include <functional>
+#include <memory>
#include <utility>
#include <vector>
-#include "instruction.h"
-#include "operand.h"
-#include "util/ilist.h"
-
-#include "latest_version_spirv_header.h"
+#include "source/latest_version_spirv_header.h"
+#include "source/operand.h"
+#include "source/opt/instruction.h"
+#include "source/util/ilist.h"
#include "spirv-tools/libspirv.h"
namespace spvtools {
diff --git a/source/opt/ir_builder.h b/source/opt/ir_builder.h
index 46f2e86d..2dab76e5 100644
--- a/source/opt/ir_builder.h
+++ b/source/opt/ir_builder.h
@@ -15,10 +15,15 @@
#ifndef SOURCE_OPT_IR_BUILDER_H_
#define SOURCE_OPT_IR_BUILDER_H_
-#include "opt/basic_block.h"
-#include "opt/constants.h"
-#include "opt/instruction.h"
-#include "opt/ir_context.h"
+#include <limits>
+#include <memory>
+#include <utility>
+#include <vector>
+
+#include "source/opt/basic_block.h"
+#include "source/opt/constants.h"
+#include "source/opt/instruction.h"
+#include "source/opt/ir_context.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/ir_context.cpp b/source/opt/ir_context.cpp
index ad0cad77..de007585 100644
--- a/source/opt/ir_context.cpp
+++ b/source/opt/ir_context.cpp
@@ -12,14 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ir_context.h"
-#include "latest_version_glsl_std_450_header.h"
-#include "log.h"
-#include "mem_pass.h"
-#include "reflect.h"
+#include "source/opt/ir_context.h"
#include <cstring>
+#include "source/latest_version_glsl_std_450_header.h"
+#include "source/opt/log.h"
+#include "source/opt/mem_pass.h"
+#include "source/opt/reflect.h"
+
namespace spvtools {
namespace opt {
diff --git a/source/opt/ir_context.h b/source/opt/ir_context.h
index 29a3abfd..95b5db52 100644
--- a/source/opt/ir_context.h
+++ b/source/opt/ir_context.h
@@ -15,25 +15,30 @@
#ifndef SOURCE_OPT_IR_CONTEXT_H_
#define SOURCE_OPT_IR_CONTEXT_H_
-#include "assembly_grammar.h"
-#include "cfg.h"
-#include "constants.h"
-#include "decoration_manager.h"
-#include "def_use_manager.h"
-#include "dominator_analysis.h"
-#include "feature_manager.h"
-#include "fold.h"
-#include "loop_descriptor.h"
-#include "module.h"
-#include "register_pressure.h"
-#include "scalar_analysis.h"
-#include "type_manager.h"
-#include "value_number_table.h"
-
#include <algorithm>
#include <iostream>
#include <limits>
+#include <map>
+#include <memory>
+#include <unordered_map>
#include <unordered_set>
+#include <utility>
+#include <vector>
+
+#include "source/assembly_grammar.h"
+#include "source/opt/cfg.h"
+#include "source/opt/constants.h"
+#include "source/opt/decoration_manager.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/dominator_analysis.h"
+#include "source/opt/feature_manager.h"
+#include "source/opt/fold.h"
+#include "source/opt/loop_descriptor.h"
+#include "source/opt/module.h"
+#include "source/opt/register_pressure.h"
+#include "source/opt/scalar_analysis.h"
+#include "source/opt/type_manager.h"
+#include "source/opt/value_number_table.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/ir_loader.cpp b/source/opt/ir_loader.cpp
index b12ebbe8..3d7412d8 100644
--- a/source/opt/ir_loader.cpp
+++ b/source/opt/ir_loader.cpp
@@ -12,10 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ir_loader.h"
+#include "source/opt/ir_loader.h"
-#include "log.h"
-#include "reflect.h"
+#include <utility>
+
+#include "source/opt/log.h"
+#include "source/opt/reflect.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/ir_loader.h b/source/opt/ir_loader.h
index 45f5e6f2..940d7b0d 100644
--- a/source/opt/ir_loader.h
+++ b/source/opt/ir_loader.h
@@ -16,10 +16,12 @@
#define SOURCE_OPT_IR_LOADER_H_
#include <memory>
+#include <string>
+#include <vector>
-#include "basic_block.h"
-#include "instruction.h"
-#include "module.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/instruction.h"
+#include "source/opt/module.h"
#include "spirv-tools/libspirv.hpp"
namespace spvtools {
diff --git a/source/opt/iterator.h b/source/opt/iterator.h
index 326b6dcc..444d457c 100644
--- a/source/opt/iterator.h
+++ b/source/opt/iterator.h
@@ -19,6 +19,7 @@
#include <iterator>
#include <memory>
#include <type_traits>
+#include <utility>
#include <vector>
namespace spvtools {
diff --git a/source/opt/licm_pass.cpp b/source/opt/licm_pass.cpp
index 84871138..d8256679 100644
--- a/source/opt/licm_pass.cpp
+++ b/source/opt/licm_pass.cpp
@@ -12,13 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "opt/licm_pass.h"
-#include "opt/module.h"
-#include "opt/pass.h"
+#include "source/opt/licm_pass.h"
#include <queue>
#include <utility>
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
+
namespace spvtools {
namespace opt {
diff --git a/source/opt/licm_pass.h b/source/opt/licm_pass.h
index c7d6bc6e..a1745004 100644
--- a/source/opt/licm_pass.h
+++ b/source/opt/licm_pass.h
@@ -15,12 +15,13 @@
#ifndef SOURCE_OPT_LICM_PASS_H_
#define SOURCE_OPT_LICM_PASS_H_
-#include "opt/basic_block.h"
-#include "opt/instruction.h"
-#include "opt/loop_descriptor.h"
-#include "opt/pass.h"
-
#include <queue>
+#include <vector>
+
+#include "source/opt/basic_block.h"
+#include "source/opt/instruction.h"
+#include "source/opt/loop_descriptor.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/local_access_chain_convert_pass.cpp b/source/opt/local_access_chain_convert_pass.cpp
index 26108a72..20e1030b 100644
--- a/source/opt/local_access_chain_convert_pass.cpp
+++ b/source/opt/local_access_chain_convert_pass.cpp
@@ -14,10 +14,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "local_access_chain_convert_pass.h"
+#include "source/opt/local_access_chain_convert_pass.h"
-#include "ir_context.h"
-#include "iterator.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/local_access_chain_convert_pass.h b/source/opt/local_access_chain_convert_pass.h
index 656bad8c..fc593616 100644
--- a/source/opt/local_access_chain_convert_pass.h
+++ b/source/opt/local_access_chain_convert_pass.h
@@ -19,15 +19,18 @@
#include <algorithm>
#include <map>
+#include <memory>
#include <queue>
+#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
+#include <vector>
-#include "basic_block.h"
-#include "def_use_manager.h"
-#include "mem_pass.h"
-#include "module.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/mem_pass.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/local_redundancy_elimination.cpp b/source/opt/local_redundancy_elimination.cpp
index 85c1a083..9539e655 100644
--- a/source/opt/local_redundancy_elimination.cpp
+++ b/source/opt/local_redundancy_elimination.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "local_redundancy_elimination.h"
+#include "source/opt/local_redundancy_elimination.h"
-#include "value_number_table.h"
+#include "source/opt/value_number_table.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/local_redundancy_elimination.h b/source/opt/local_redundancy_elimination.h
index e822da34..9f55c8bf 100644
--- a/source/opt/local_redundancy_elimination.h
+++ b/source/opt/local_redundancy_elimination.h
@@ -15,9 +15,11 @@
#ifndef SOURCE_OPT_LOCAL_REDUNDANCY_ELIMINATION_H_
#define SOURCE_OPT_LOCAL_REDUNDANCY_ELIMINATION_H_
-#include "ir_context.h"
-#include "pass.h"
-#include "value_number_table.h"
+#include <map>
+
+#include "source/opt/ir_context.h"
+#include "source/opt/pass.h"
+#include "source/opt/value_number_table.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/local_single_block_elim_pass.cpp b/source/opt/local_single_block_elim_pass.cpp
index 5a2ec8cd..19dde6a1 100644
--- a/source/opt/local_single_block_elim_pass.cpp
+++ b/source/opt/local_single_block_elim_pass.cpp
@@ -14,13 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "local_single_block_elim_pass.h"
+#include "source/opt/local_single_block_elim_pass.h"
-#include "iterator.h"
+#include <vector>
+
+#include "source/opt/iterator.h"
namespace spvtools {
namespace opt {
-
namespace {
const uint32_t kStoreValIdInIdx = 1;
diff --git a/source/opt/local_single_block_elim_pass.h b/source/opt/local_single_block_elim_pass.h
index 2f75f200..3dead983 100644
--- a/source/opt/local_single_block_elim_pass.h
+++ b/source/opt/local_single_block_elim_pass.h
@@ -20,14 +20,15 @@
#include <algorithm>
#include <map>
#include <queue>
+#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
-#include "basic_block.h"
-#include "def_use_manager.h"
-#include "mem_pass.h"
-#include "module.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/mem_pass.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/local_single_store_elim_pass.cpp b/source/opt/local_single_store_elim_pass.cpp
index 66c1505e..4c837fc7 100644
--- a/source/opt/local_single_store_elim_pass.cpp
+++ b/source/opt/local_single_store_elim_pass.cpp
@@ -14,11 +14,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "local_single_store_elim_pass.h"
+#include "source/opt/local_single_store_elim_pass.h"
-#include "cfa.h"
-#include "iterator.h"
-#include "latest_version_glsl_std_450_header.h"
+#include "source/cfa.h"
+#include "source/latest_version_glsl_std_450_header.h"
+#include "source/opt/iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/local_single_store_elim_pass.h b/source/opt/local_single_store_elim_pass.h
index 8f831172..d3d64b82 100644
--- a/source/opt/local_single_store_elim_pass.h
+++ b/source/opt/local_single_store_elim_pass.h
@@ -20,14 +20,16 @@
#include <algorithm>
#include <map>
#include <queue>
+#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
+#include <vector>
-#include "basic_block.h"
-#include "def_use_manager.h"
-#include "mem_pass.h"
-#include "module.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/mem_pass.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/local_ssa_elim_pass.cpp b/source/opt/local_ssa_elim_pass.cpp
index 872d26b3..ec7326ed 100644
--- a/source/opt/local_ssa_elim_pass.cpp
+++ b/source/opt/local_ssa_elim_pass.cpp
@@ -14,11 +14,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "local_ssa_elim_pass.h"
+#include "source/opt/local_ssa_elim_pass.h"
-#include "cfa.h"
-#include "iterator.h"
-#include "ssa_rewrite_pass.h"
+#include "source/cfa.h"
+#include "source/opt/iterator.h"
+#include "source/opt/ssa_rewrite_pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/local_ssa_elim_pass.h b/source/opt/local_ssa_elim_pass.h
index 29e92ffa..63d3c33b 100644
--- a/source/opt/local_ssa_elim_pass.h
+++ b/source/opt/local_ssa_elim_pass.h
@@ -20,14 +20,16 @@
#include <algorithm>
#include <map>
#include <queue>
+#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
+#include <vector>
-#include "basic_block.h"
-#include "def_use_manager.h"
-#include "mem_pass.h"
-#include "module.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/mem_pass.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_dependence.cpp b/source/opt/loop_dependence.cpp
index 82dbd1c0..d8de699b 100644
--- a/source/opt/loop_dependence.cpp
+++ b/source/opt/loop_dependence.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "opt/loop_dependence.h"
+#include "source/opt/loop_dependence.h"
#include <functional>
#include <memory>
@@ -21,9 +21,9 @@
#include <utility>
#include <vector>
-#include "opt/instruction.h"
-#include "opt/scalar_analysis.h"
-#include "opt/scalar_analysis_nodes.h"
+#include "source/opt/instruction.h"
+#include "source/opt/scalar_analysis.h"
+#include "source/opt/scalar_analysis_nodes.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_dependence.h b/source/opt/loop_dependence.h
index 99324e82..582c8d0a 100644
--- a/source/opt/loop_dependence.h
+++ b/source/opt/loop_dependence.h
@@ -26,10 +26,10 @@
#include <utility>
#include <vector>
-#include "opt/instruction.h"
-#include "opt/ir_context.h"
-#include "opt/loop_descriptor.h"
-#include "opt/scalar_analysis.h"
+#include "source/opt/instruction.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/loop_descriptor.h"
+#include "source/opt/scalar_analysis.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_dependence_helpers.cpp b/source/opt/loop_dependence_helpers.cpp
index 979d03a8..de27a0a7 100644
--- a/source/opt/loop_dependence_helpers.cpp
+++ b/source/opt/loop_dependence_helpers.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "opt/loop_dependence.h"
+#include "source/opt/loop_dependence.h"
#include <ostream>
#include <set>
@@ -21,10 +21,10 @@
#include <utility>
#include <vector>
-#include "opt/basic_block.h"
-#include "opt/instruction.h"
-#include "opt/scalar_analysis.h"
-#include "opt/scalar_analysis_nodes.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/instruction.h"
+#include "source/opt/scalar_analysis.h"
+#include "source/opt/scalar_analysis_nodes.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_descriptor.cpp b/source/opt/loop_descriptor.cpp
index ec05ba6b..656ea125 100644
--- a/source/opt/loop_descriptor.cpp
+++ b/source/opt/loop_descriptor.cpp
@@ -12,21 +12,24 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "opt/loop_descriptor.h"
+#include "source/opt/loop_descriptor.h"
+
#include <algorithm>
#include <iostream>
+#include <limits>
+#include <stack>
#include <type_traits>
#include <utility>
#include <vector>
-#include "constants.h"
-#include "opt/cfg.h"
-#include "opt/dominator_tree.h"
-#include "opt/ir_builder.h"
-#include "opt/ir_context.h"
-#include "opt/iterator.h"
-#include "opt/make_unique.h"
-#include "opt/tree_iterator.h"
+#include "source/opt/cfg.h"
+#include "source/opt/constants.h"
+#include "source/opt/dominator_tree.h"
+#include "source/opt/ir_builder.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/iterator.h"
+#include "source/opt/make_unique.h"
+#include "source/opt/tree_iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_descriptor.h b/source/opt/loop_descriptor.h
index 8e4979c4..45a175a0 100644
--- a/source/opt/loop_descriptor.h
+++ b/source/opt/loop_descriptor.h
@@ -21,12 +21,13 @@
#include <memory>
#include <unordered_map>
#include <unordered_set>
+#include <utility>
#include <vector>
-#include "opt/basic_block.h"
-#include "opt/dominator_analysis.h"
-#include "opt/module.h"
-#include "opt/tree_iterator.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/dominator_analysis.h"
+#include "source/opt/module.h"
+#include "source/opt/tree_iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_fission.cpp b/source/opt/loop_fission.cpp
index 7657ad6a..0052406d 100644
--- a/source/opt/loop_fission.cpp
+++ b/source/opt/loop_fission.cpp
@@ -12,8 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "opt/loop_fission.h"
-#include "opt/register_pressure.h"
+#include "source/opt/loop_fission.h"
+
+#include <set>
+
+#include "source/opt/register_pressure.h"
// Implement loop fission with an optional parameter to split only
// if the register pressure in a given loop meets a certain criteria. This is
diff --git a/source/opt/loop_fission.h b/source/opt/loop_fission.h
index d7169752..ef886c96 100644
--- a/source/opt/loop_fission.h
+++ b/source/opt/loop_fission.h
@@ -21,12 +21,12 @@
#include <utility>
#include <vector>
-#include "cfg.h"
-#include "module.h"
-#include "opt/loop_dependence.h"
-#include "opt/loop_utils.h"
-#include "pass.h"
-#include "tree_iterator.h"
+#include "source/opt/cfg.h"
+#include "source/opt/loop_dependence.h"
+#include "source/opt/loop_utils.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
+#include "source/opt/tree_iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_fusion.cpp b/source/opt/loop_fusion.cpp
index 350b27b8..07d171a0 100644
--- a/source/opt/loop_fusion.cpp
+++ b/source/opt/loop_fusion.cpp
@@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "opt/loop_fusion.h"
+#include "source/opt/loop_fusion.h"
#include <algorithm>
#include <vector>
-#include "opt/ir_context.h"
-#include "opt/loop_dependence.h"
-#include "opt/loop_descriptor.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/loop_dependence.h"
+#include "source/opt/loop_descriptor.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_fusion.h b/source/opt/loop_fusion.h
index 343e023b..d61d6783 100644
--- a/source/opt/loop_fusion.h
+++ b/source/opt/loop_fusion.h
@@ -17,12 +17,13 @@
#include <map>
#include <set>
+#include <utility>
#include <vector>
-#include "opt/ir_context.h"
-#include "opt/loop_descriptor.h"
-#include "opt/loop_utils.h"
-#include "opt/scalar_analysis.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/loop_descriptor.h"
+#include "source/opt/loop_utils.h"
+#include "source/opt/scalar_analysis.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_fusion_pass.cpp b/source/opt/loop_fusion_pass.cpp
index 46bfdc67..bd8444ae 100644
--- a/source/opt/loop_fusion_pass.cpp
+++ b/source/opt/loop_fusion_pass.cpp
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "opt/loop_fusion_pass.h"
+#include "source/opt/loop_fusion_pass.h"
-#include "opt/ir_context.h"
-#include "opt/loop_descriptor.h"
-#include "opt/loop_fusion.h"
-#include "opt/register_pressure.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/loop_descriptor.h"
+#include "source/opt/loop_fusion.h"
+#include "source/opt/register_pressure.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_fusion_pass.h b/source/opt/loop_fusion_pass.h
index 99dd67d7..3a0be600 100644
--- a/source/opt/loop_fusion_pass.h
+++ b/source/opt/loop_fusion_pass.h
@@ -15,7 +15,7 @@
#ifndef SOURCE_OPT_LOOP_FUSION_PASS_H_
#define SOURCE_OPT_LOOP_FUSION_PASS_H_
-#include "opt/pass.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_peeling.cpp b/source/opt/loop_peeling.cpp
index 274aa66d..7d27480a 100644
--- a/source/opt/loop_peeling.cpp
+++ b/source/opt/loop_peeling.cpp
@@ -19,13 +19,13 @@
#include <unordered_set>
#include <vector>
-#include "ir_builder.h"
-#include "ir_context.h"
-#include "loop_descriptor.h"
-#include "loop_peeling.h"
-#include "loop_utils.h"
-#include "scalar_analysis.h"
-#include "scalar_analysis_nodes.h"
+#include "source/opt/ir_builder.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/loop_descriptor.h"
+#include "source/opt/loop_peeling.h"
+#include "source/opt/loop_utils.h"
+#include "source/opt/scalar_analysis.h"
+#include "source/opt/scalar_analysis_nodes.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_peeling.h b/source/opt/loop_peeling.h
index 08af223b..413f896f 100644
--- a/source/opt/loop_peeling.h
+++ b/source/opt/loop_peeling.h
@@ -18,16 +18,17 @@
#include <algorithm>
#include <limits>
#include <memory>
+#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
-#include "opt/ir_context.h"
-#include "opt/loop_descriptor.h"
-#include "opt/loop_utils.h"
-#include "opt/pass.h"
-#include "opt/scalar_analysis.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/loop_descriptor.h"
+#include "source/opt/loop_utils.h"
+#include "source/opt/pass.h"
+#include "source/opt/scalar_analysis.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_unroller.cpp b/source/opt/loop_unroller.cpp
index 16bde307..587615ed 100644
--- a/source/opt/loop_unroller.cpp
+++ b/source/opt/loop_unroller.cpp
@@ -12,12 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "opt/loop_unroller.h"
+#include "source/opt/loop_unroller.h"
+
+#include <limits>
#include <map>
#include <memory>
+#include <unordered_map>
#include <utility>
-#include "opt/ir_builder.h"
-#include "opt/loop_utils.h"
+#include <vector>
+
+#include "source/opt/ir_builder.h"
+#include "source/opt/loop_utils.h"
// Implements loop util unrolling functionality for fully and partially
// unrolling loops. Given a factor it will duplicate the loop that many times,
diff --git a/source/opt/loop_unroller.h b/source/opt/loop_unroller.h
index 080a1dfd..98f4d475 100644
--- a/source/opt/loop_unroller.h
+++ b/source/opt/loop_unroller.h
@@ -14,7 +14,8 @@
#ifndef SOURCE_OPT_LOOP_UNROLLER_H_
#define SOURCE_OPT_LOOP_UNROLLER_H_
-#include "opt/pass.h"
+
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_unswitch_pass.cpp b/source/opt/loop_unswitch_pass.cpp
index b9eb61bc..8215cb69 100644
--- a/source/opt/loop_unswitch_pass.cpp
+++ b/source/opt/loop_unswitch_pass.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "loop_unswitch_pass.h"
+#include "source/opt/loop_unswitch_pass.h"
#include <functional>
#include <list>
@@ -23,16 +23,16 @@
#include <utility>
#include <vector>
-#include "basic_block.h"
-#include "dominator_tree.h"
-#include "fold.h"
-#include "function.h"
-#include "instruction.h"
-#include "ir_builder.h"
-#include "ir_context.h"
-#include "loop_descriptor.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/dominator_tree.h"
+#include "source/opt/fold.h"
+#include "source/opt/function.h"
+#include "source/opt/instruction.h"
+#include "source/opt/ir_builder.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/loop_descriptor.h"
-#include "loop_utils.h"
+#include "source/opt/loop_utils.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_unswitch_pass.h b/source/opt/loop_unswitch_pass.h
index 93fd1c0e..3ecdd611 100644
--- a/source/opt/loop_unswitch_pass.h
+++ b/source/opt/loop_unswitch_pass.h
@@ -15,8 +15,8 @@
#ifndef SOURCE_OPT_LOOP_UNSWITCH_PASS_H_
#define SOURCE_OPT_LOOP_UNSWITCH_PASS_H_
-#include "opt/loop_descriptor.h"
-#include "opt/pass.h"
+#include "source/opt/loop_descriptor.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_utils.cpp b/source/opt/loop_utils.cpp
index 96644b5d..482335f3 100644
--- a/source/opt/loop_utils.cpp
+++ b/source/opt/loop_utils.cpp
@@ -16,14 +16,15 @@
#include <memory>
#include <unordered_map>
#include <unordered_set>
+#include <utility>
#include <vector>
-#include "cfa.h"
-#include "opt/cfg.h"
-#include "opt/ir_builder.h"
-#include "opt/ir_context.h"
-#include "opt/loop_descriptor.h"
-#include "opt/loop_utils.h"
+#include "source/cfa.h"
+#include "source/opt/cfg.h"
+#include "source/opt/ir_builder.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/loop_descriptor.h"
+#include "source/opt/loop_utils.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/loop_utils.h b/source/opt/loop_utils.h
index 45cffd4b..a4e61900 100644
--- a/source/opt/loop_utils.h
+++ b/source/opt/loop_utils.h
@@ -14,11 +14,14 @@
#ifndef SOURCE_OPT_LOOP_UTILS_H_
#define SOURCE_OPT_LOOP_UTILS_H_
+
#include <list>
#include <memory>
+#include <unordered_map>
#include <vector>
-#include "opt/ir_context.h"
-#include "opt/loop_descriptor.h"
+
+#include "source/opt/ir_context.h"
+#include "source/opt/loop_descriptor.h"
namespace spvtools {
diff --git a/source/opt/mem_pass.cpp b/source/opt/mem_pass.cpp
index 41c29d64..c65e0493 100644
--- a/source/opt/mem_pass.cpp
+++ b/source/opt/mem_pass.cpp
@@ -14,13 +14,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "mem_pass.h"
+#include "source/opt/mem_pass.h"
-#include "basic_block.h"
-#include "cfa.h"
-#include "dominator_analysis.h"
-#include "ir_context.h"
-#include "iterator.h"
+#include <memory>
+#include <set>
+#include <vector>
+
+#include "source/cfa.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/dominator_analysis.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/mem_pass.h b/source/opt/mem_pass.h
index 136da0c8..67ce26b1 100644
--- a/source/opt/mem_pass.h
+++ b/source/opt/mem_pass.h
@@ -25,11 +25,11 @@
#include <unordered_set>
#include <utility>
-#include "basic_block.h"
-#include "def_use_manager.h"
-#include "dominator_analysis.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/dominator_analysis.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/merge_return_pass.cpp b/source/opt/merge_return_pass.cpp
index 82ded202..c0323ff5 100644
--- a/source/opt/merge_return_pass.cpp
+++ b/source/opt/merge_return_pass.cpp
@@ -12,13 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "merge_return_pass.h"
+#include "source/opt/merge_return_pass.h"
-#include "instruction.h"
-#include "ir_builder.h"
-#include "ir_context.h"
-#include "make_unique.h"
-#include "reflect.h"
+#include <list>
+#include <memory>
+#include <utility>
+
+#include "source/opt/instruction.h"
+#include "source/opt/ir_builder.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/make_unique.h"
+#include "source/opt/reflect.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/merge_return_pass.h b/source/opt/merge_return_pass.h
index a98ef52c..0c7a3b48 100644
--- a/source/opt/merge_return_pass.h
+++ b/source/opt/merge_return_pass.h
@@ -15,13 +15,14 @@
#ifndef SOURCE_OPT_MERGE_RETURN_PASS_H_
#define SOURCE_OPT_MERGE_RETURN_PASS_H_
-#include "basic_block.h"
-#include "function.h"
-#include "mem_pass.h"
-
+#include <unordered_map>
#include <unordered_set>
#include <vector>
+#include "source/opt/basic_block.h"
+#include "source/opt/function.h"
+#include "source/opt/mem_pass.h"
+
namespace spvtools {
namespace opt {
diff --git a/source/opt/module.cpp b/source/opt/module.cpp
index 924d9837..6d024b5b 100644
--- a/source/opt/module.cpp
+++ b/source/opt/module.cpp
@@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "module.h"
+#include "source/opt/module.h"
#include <algorithm>
#include <cstring>
#include <ostream>
-#include "operand.h"
-#include "reflect.h"
+#include "source/operand.h"
+#include "source/opt/reflect.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/module.h b/source/opt/module.h
index 0c95bd83..eca8cc77 100644
--- a/source/opt/module.h
+++ b/source/opt/module.h
@@ -20,9 +20,9 @@
#include <utility>
#include <vector>
-#include "function.h"
-#include "instruction.h"
-#include "iterator.h"
+#include "source/opt/function.h"
+#include "source/opt/instruction.h"
+#include "source/opt/iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/null_pass.h b/source/opt/null_pass.h
index b4376791..2b5974fb 100644
--- a/source/opt/null_pass.h
+++ b/source/opt/null_pass.h
@@ -15,8 +15,8 @@
#ifndef SOURCE_OPT_NULL_PASS_H_
#define SOURCE_OPT_NULL_PASS_H_
-#include "module.h"
-#include "pass.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/optimizer.cpp b/source/opt/optimizer.cpp
index 60791ca0..f46306e8 100644
--- a/source/opt/optimizer.cpp
+++ b/source/opt/optimizer.cpp
@@ -14,13 +14,19 @@
#include "spirv-tools/optimizer.hpp"
-#include "build_module.h"
-#include "log.h"
-#include "make_unique.h"
-#include "pass_manager.h"
-#include "passes.h"
-#include "reduce_load_size.h"
-#include "simplification_pass.h"
+#include <memory>
+#include <string>
+#include <unordered_map>
+#include <utility>
+#include <vector>
+
+#include "source/opt/build_module.h"
+#include "source/opt/log.h"
+#include "source/opt/make_unique.h"
+#include "source/opt/pass_manager.h"
+#include "source/opt/passes.h"
+#include "source/opt/reduce_load_size.h"
+#include "source/opt/simplification_pass.h"
namespace spvtools {
diff --git a/source/opt/pass.cpp b/source/opt/pass.cpp
index c346ac44..4c4a232c 100644
--- a/source/opt/pass.cpp
+++ b/source/opt/pass.cpp
@@ -14,9 +14,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "pass.h"
+#include "source/opt/pass.h"
-#include "iterator.h"
+#include "source/opt/iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/pass.h b/source/opt/pass.h
index 62fc15e8..df174509 100644
--- a/source/opt/pass.h
+++ b/source/opt/pass.h
@@ -22,10 +22,10 @@
#include <unordered_set>
#include <utility>
-#include "basic_block.h"
-#include "def_use_manager.h"
-#include "ir_context.h"
-#include "module.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
#include "spirv-tools/libspirv.hpp"
namespace spvtools {
diff --git a/source/opt/pass_manager.cpp b/source/opt/pass_manager.cpp
index c02faeea..fa1e1d8a 100644
--- a/source/opt/pass_manager.cpp
+++ b/source/opt/pass_manager.cpp
@@ -12,14 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "pass_manager.h"
+#include "source/opt/pass_manager.h"
#include <iostream>
+#include <string>
#include <vector>
-#include "ir_context.h"
+#include "source/opt/ir_context.h"
+#include "source/util/timer.h"
#include "spirv-tools/libspirv.hpp"
-#include "util/timer.h"
namespace spvtools {
diff --git a/source/opt/pass_manager.h b/source/opt/pass_manager.h
index be576783..ed88aa17 100644
--- a/source/opt/pass_manager.h
+++ b/source/opt/pass_manager.h
@@ -17,13 +17,14 @@
#include <memory>
#include <ostream>
+#include <utility>
#include <vector>
-#include "log.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/log.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
-#include "ir_context.h"
+#include "source/opt/ir_context.h"
#include "spirv-tools/libspirv.hpp"
namespace spvtools {
diff --git a/source/opt/passes.h b/source/opt/passes.h
index 221dfe57..42106c8f 100644
--- a/source/opt/passes.h
+++ b/source/opt/passes.h
@@ -17,50 +17,51 @@
// A single header to include all passes.
-#include "aggressive_dead_code_elim_pass.h"
-#include "block_merge_pass.h"
-#include "ccp_pass.h"
-#include "cfg_cleanup_pass.h"
-#include "combine_access_chains.h"
-#include "common_uniform_elim_pass.h"
-#include "compact_ids_pass.h"
-#include "copy_prop_arrays.h"
-#include "dead_branch_elim_pass.h"
-#include "dead_insert_elim_pass.h"
-#include "dead_variable_elimination.h"
-#include "eliminate_dead_constant_pass.h"
-#include "eliminate_dead_functions_pass.h"
-#include "flatten_decoration_pass.h"
-#include "fold_spec_constant_op_and_composite_pass.h"
-#include "freeze_spec_constant_value_pass.h"
-#include "if_conversion.h"
-#include "inline_exhaustive_pass.h"
-#include "inline_opaque_pass.h"
-#include "licm_pass.h"
-#include "local_access_chain_convert_pass.h"
-#include "local_redundancy_elimination.h"
-#include "local_single_block_elim_pass.h"
-#include "local_single_store_elim_pass.h"
-#include "local_ssa_elim_pass.h"
-#include "loop_fission.h"
-#include "loop_fusion_pass.h"
-#include "loop_peeling.h"
-#include "loop_unroller.h"
-#include "loop_unswitch_pass.h"
-#include "merge_return_pass.h"
-#include "null_pass.h"
-#include "private_to_local_pass.h"
-#include "reduce_load_size.h"
-#include "redundancy_elimination.h"
-#include "remove_duplicates_pass.h"
-#include "replace_invalid_opc.h"
-#include "scalar_replacement_pass.h"
-#include "set_spec_constant_default_value_pass.h"
-#include "ssa_rewrite_pass.h"
-#include "strength_reduction_pass.h"
-#include "strip_debug_info_pass.h"
-#include "strip_reflect_info_pass.h"
-#include "unify_const_pass.h"
-#include "vector_dce.h"
-#include "workaround1209.h"
+#include "source/opt/aggressive_dead_code_elim_pass.h"
+#include "source/opt/block_merge_pass.h"
+#include "source/opt/ccp_pass.h"
+#include "source/opt/cfg_cleanup_pass.h"
+#include "source/opt/combine_access_chains.h"
+#include "source/opt/common_uniform_elim_pass.h"
+#include "source/opt/compact_ids_pass.h"
+#include "source/opt/copy_prop_arrays.h"
+#include "source/opt/dead_branch_elim_pass.h"
+#include "source/opt/dead_insert_elim_pass.h"
+#include "source/opt/dead_variable_elimination.h"
+#include "source/opt/eliminate_dead_constant_pass.h"
+#include "source/opt/eliminate_dead_functions_pass.h"
+#include "source/opt/flatten_decoration_pass.h"
+#include "source/opt/fold_spec_constant_op_and_composite_pass.h"
+#include "source/opt/freeze_spec_constant_value_pass.h"
+#include "source/opt/if_conversion.h"
+#include "source/opt/inline_exhaustive_pass.h"
+#include "source/opt/inline_opaque_pass.h"
+#include "source/opt/licm_pass.h"
+#include "source/opt/local_access_chain_convert_pass.h"
+#include "source/opt/local_redundancy_elimination.h"
+#include "source/opt/local_single_block_elim_pass.h"
+#include "source/opt/local_single_store_elim_pass.h"
+#include "source/opt/local_ssa_elim_pass.h"
+#include "source/opt/loop_fission.h"
+#include "source/opt/loop_fusion_pass.h"
+#include "source/opt/loop_peeling.h"
+#include "source/opt/loop_unroller.h"
+#include "source/opt/loop_unswitch_pass.h"
+#include "source/opt/merge_return_pass.h"
+#include "source/opt/null_pass.h"
+#include "source/opt/private_to_local_pass.h"
+#include "source/opt/reduce_load_size.h"
+#include "source/opt/redundancy_elimination.h"
+#include "source/opt/remove_duplicates_pass.h"
+#include "source/opt/replace_invalid_opc.h"
+#include "source/opt/scalar_replacement_pass.h"
+#include "source/opt/set_spec_constant_default_value_pass.h"
+#include "source/opt/ssa_rewrite_pass.h"
+#include "source/opt/strength_reduction_pass.h"
+#include "source/opt/strip_debug_info_pass.h"
+#include "source/opt/strip_reflect_info_pass.h"
+#include "source/opt/unify_const_pass.h"
+#include "source/opt/vector_dce.h"
+#include "source/opt/workaround1209.h"
+
#endif // SOURCE_OPT_PASSES_H_
diff --git a/source/opt/private_to_local_pass.cpp b/source/opt/private_to_local_pass.cpp
index 9f498d51..02909a72 100644
--- a/source/opt/private_to_local_pass.cpp
+++ b/source/opt/private_to_local_pass.cpp
@@ -12,17 +12,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "private_to_local_pass.h"
+#include "source/opt/private_to_local_pass.h"
-#include "ir_context.h"
+#include <memory>
+#include <utility>
+#include <vector>
+#include "source/opt/ir_context.h"
+
+namespace spvtools {
+namespace opt {
namespace {
+
const uint32_t kVariableStorageClassInIdx = 0;
const uint32_t kSpvTypePointerTypeIdInIdx = 1;
-} // namespace
-namespace spvtools {
-namespace opt {
+} // namespace
Pass::Status PrivateToLocalPass::Process() {
bool modified = false;
diff --git a/source/opt/private_to_local_pass.h b/source/opt/private_to_local_pass.h
index 159d368b..f706e6e9 100644
--- a/source/opt/private_to_local_pass.h
+++ b/source/opt/private_to_local_pass.h
@@ -15,8 +15,8 @@
#ifndef SOURCE_OPT_PRIVATE_TO_LOCAL_PASS_H_
#define SOURCE_OPT_PRIVATE_TO_LOCAL_PASS_H_
-#include "ir_context.h"
-#include "pass.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/propagator.cpp b/source/opt/propagator.cpp
index bfaa811b..6a1f1aaf 100644
--- a/source/opt/propagator.cpp
+++ b/source/opt/propagator.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "propagator.h"
+#include "source/opt/propagator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/propagator.h b/source/opt/propagator.h
index 2dc2c507..ac7c0e7e 100644
--- a/source/opt/propagator.h
+++ b/source/opt/propagator.h
@@ -20,10 +20,11 @@
#include <set>
#include <unordered_map>
#include <unordered_set>
+#include <utility>
#include <vector>
-#include "ir_context.h"
-#include "module.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/reduce_load_size.cpp b/source/opt/reduce_load_size.cpp
index e82a9e28..b692c6b5 100644
--- a/source/opt/reduce_load_size.cpp
+++ b/source/opt/reduce_load_size.cpp
@@ -12,18 +12,23 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "reduce_load_size.h"
-#include <util/bit_vector.h>
+#include "source/opt/reduce_load_size.h"
-#include "instruction.h"
-#include "ir_builder.h"
-#include "ir_context.h"
+#include <set>
+#include <vector>
+
+#include "source/opt/instruction.h"
+#include "source/opt/ir_builder.h"
+#include "source/opt/ir_context.h"
+#include "source/util/bit_vector.h"
namespace {
+
const uint32_t kExtractCompositeIdInIdx = 0;
const uint32_t kVariableStorageClassInIdx = 0;
const uint32_t kLoadPointerInIdx = 0;
const double kThreshold = 0.9;
+
} // namespace
namespace spvtools {
diff --git a/source/opt/reduce_load_size.h b/source/opt/reduce_load_size.h
index 1071f1de..724a430b 100644
--- a/source/opt/reduce_load_size.h
+++ b/source/opt/reduce_load_size.h
@@ -15,9 +15,11 @@
#ifndef SOURCE_OPT_REDUCE_LOAD_SIZE_H_
#define SOURCE_OPT_REDUCE_LOAD_SIZE_H_
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
+#include <unordered_map>
+
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/redundancy_elimination.cpp b/source/opt/redundancy_elimination.cpp
index 294b84d5..362e54dc 100644
--- a/source/opt/redundancy_elimination.cpp
+++ b/source/opt/redundancy_elimination.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "redundancy_elimination.h"
+#include "source/opt/redundancy_elimination.h"
-#include "value_number_table.h"
+#include "source/opt/value_number_table.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/redundancy_elimination.h b/source/opt/redundancy_elimination.h
index 5cd30fbc..91809b5d 100644
--- a/source/opt/redundancy_elimination.h
+++ b/source/opt/redundancy_elimination.h
@@ -15,10 +15,12 @@
#ifndef SOURCE_OPT_REDUNDANCY_ELIMINATION_H_
#define SOURCE_OPT_REDUNDANCY_ELIMINATION_H_
-#include "ir_context.h"
-#include "local_redundancy_elimination.h"
-#include "pass.h"
-#include "value_number_table.h"
+#include <map>
+
+#include "source/opt/ir_context.h"
+#include "source/opt/local_redundancy_elimination.h"
+#include "source/opt/pass.h"
+#include "source/opt/value_number_table.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/reflect.h b/source/opt/reflect.h
index 8dc11942..fb2de7b1 100644
--- a/source/opt/reflect.h
+++ b/source/opt/reflect.h
@@ -15,7 +15,7 @@
#ifndef SOURCE_OPT_REFLECT_H_
#define SOURCE_OPT_REFLECT_H_
-#include "latest_version_spirv_header.h"
+#include "source/latest_version_spirv_header.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/register_pressure.cpp b/source/opt/register_pressure.cpp
index 729755c2..34dac1d7 100644
--- a/source/opt/register_pressure.cpp
+++ b/source/opt/register_pressure.cpp
@@ -12,16 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "register_pressure.h"
+#include "source/opt/register_pressure.h"
+#include <algorithm>
#include <iterator>
-#include "cfg.h"
-#include "def_use_manager.h"
-#include "dominator_tree.h"
-#include "function.h"
-#include "ir_context.h"
-#include "iterator.h"
+#include "source/opt/cfg.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/dominator_tree.h"
+#include "source/opt/function.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/register_pressure.h b/source/opt/register_pressure.h
index be83f008..cb3d2e27 100644
--- a/source/opt/register_pressure.h
+++ b/source/opt/register_pressure.h
@@ -20,8 +20,8 @@
#include <utility>
#include <vector>
-#include "function.h"
-#include "types.h"
+#include "source/opt/function.h"
+#include "source/opt/types.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/remove_duplicates_pass.cpp b/source/opt/remove_duplicates_pass.cpp
index bfbab4d6..a37e9df9 100644
--- a/source/opt/remove_duplicates_pass.cpp
+++ b/source/opt/remove_duplicates_pass.cpp
@@ -12,20 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "remove_duplicates_pass.h"
-
-#include <cstring>
+#include "source/opt/remove_duplicates_pass.h"
#include <algorithm>
+#include <cstring>
#include <limits>
+#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
-#include "decoration_manager.h"
-#include "ir_context.h"
-#include "opcode.h"
-#include "reflect.h"
+#include "source/opcode.h"
+#include "source/opt/decoration_manager.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/reflect.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/remove_duplicates_pass.h b/source/opt/remove_duplicates_pass.h
index 08e6c13a..8554a987 100644
--- a/source/opt/remove_duplicates_pass.h
+++ b/source/opt/remove_duplicates_pass.h
@@ -16,12 +16,13 @@
#define SOURCE_OPT_REMOVE_DUPLICATES_PASS_H_
#include <unordered_map>
+#include <vector>
-#include "decoration_manager.h"
-#include "def_use_manager.h"
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/decoration_manager.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/replace_invalid_opc.cpp b/source/opt/replace_invalid_opc.cpp
index 711405fb..4e0f24f4 100644
--- a/source/opt/replace_invalid_opc.cpp
+++ b/source/opt/replace_invalid_opc.cpp
@@ -12,9 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "replace_invalid_opc.h"
+#include "source/opt/replace_invalid_opc.h"
#include <bitset>
+#include <vector>
namespace spvtools {
namespace opt {
diff --git a/source/opt/replace_invalid_opc.h b/source/opt/replace_invalid_opc.h
index ef5a2745..4d464058 100644
--- a/source/opt/replace_invalid_opc.h
+++ b/source/opt/replace_invalid_opc.h
@@ -15,7 +15,9 @@
#ifndef SOURCE_OPT_REPLACE_INVALID_OPC_H_
#define SOURCE_OPT_REPLACE_INVALID_OPC_H_
-#include "pass.h"
+#include <string>
+
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/scalar_analysis.cpp b/source/opt/scalar_analysis.cpp
index c124a3ff..38555e64 100644
--- a/source/opt/scalar_analysis.cpp
+++ b/source/opt/scalar_analysis.cpp
@@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "opt/scalar_analysis.h"
+#include "source/opt/scalar_analysis.h"
#include <algorithm>
#include <functional>
#include <string>
#include <utility>
-#include "opt/ir_context.h"
+#include "source/opt/ir_context.h"
// Transforms a given scalar operation instruction into a DAG representation.
//
diff --git a/source/opt/scalar_analysis.h b/source/opt/scalar_analysis.h
index f33f6128..fb6d631f 100644
--- a/source/opt/scalar_analysis.h
+++ b/source/opt/scalar_analysis.h
@@ -20,11 +20,12 @@
#include <map>
#include <memory>
#include <unordered_set>
+#include <utility>
#include <vector>
-#include "opt/basic_block.h"
-#include "opt/instruction.h"
-#include "opt/scalar_analysis_nodes.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/instruction.h"
+#include "source/opt/scalar_analysis_nodes.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/scalar_analysis_nodes.h b/source/opt/scalar_analysis_nodes.h
index 59cd725b..450522ec 100644
--- a/source/opt/scalar_analysis_nodes.h
+++ b/source/opt/scalar_analysis_nodes.h
@@ -19,7 +19,8 @@
#include <memory>
#include <string>
#include <vector>
-#include "opt/tree_iterator.h"
+
+#include "source/opt/tree_iterator.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/scalar_analysis_simplification.cpp b/source/opt/scalar_analysis_simplification.cpp
index 58b08ea7..52f2d6ad 100644
--- a/source/opt/scalar_analysis_simplification.cpp
+++ b/source/opt/scalar_analysis_simplification.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "opt/scalar_analysis.h"
+#include "source/opt/scalar_analysis.h"
#include <functional>
#include <map>
diff --git a/source/opt/scalar_replacement_pass.cpp b/source/opt/scalar_replacement_pass.cpp
index b3e9c52c..c0ec1285 100644
--- a/source/opt/scalar_replacement_pass.cpp
+++ b/source/opt/scalar_replacement_pass.cpp
@@ -12,16 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "scalar_replacement_pass.h"
-
-#include "enum_string_mapping.h"
-#include "extensions.h"
-#include "make_unique.h"
-#include "reflect.h"
-#include "types.h"
+#include "source/opt/scalar_replacement_pass.h"
+#include <algorithm>
#include <queue>
#include <tuple>
+#include <utility>
+
+#include "source/enum_string_mapping.h"
+#include "source/extensions.h"
+#include "source/opt/make_unique.h"
+#include "source/opt/reflect.h"
+#include "source/opt/types.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/scalar_replacement_pass.h b/source/opt/scalar_replacement_pass.h
index 143d5783..c89bbc40 100644
--- a/source/opt/scalar_replacement_pass.h
+++ b/source/opt/scalar_replacement_pass.h
@@ -16,12 +16,15 @@
#define SOURCE_OPT_SCALAR_REPLACEMENT_PASS_H_
#include <cstdio>
-
-#include "function.h"
-#include "pass.h"
-#include "type_manager.h"
-
+#include <memory>
#include <queue>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+
+#include "source/opt/function.h"
+#include "source/opt/pass.h"
+#include "source/opt/type_manager.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/set_spec_constant_default_value_pass.cpp b/source/opt/set_spec_constant_default_value_pass.cpp
index fe97582b..7927b605 100644
--- a/source/opt/set_spec_constant_default_value_pass.cpp
+++ b/source/opt/set_spec_constant_default_value_pass.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "set_spec_constant_default_value_pass.h"
+#include "source/opt/set_spec_constant_default_value_pass.h"
#include <algorithm>
#include <cctype>
@@ -20,13 +20,13 @@
#include <tuple>
#include <vector>
-#include "def_use_manager.h"
-#include "ir_context.h"
-#include "make_unique.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/make_unique.h"
+#include "source/opt/type_manager.h"
+#include "source/opt/types.h"
+#include "source/util/parse_number.h"
#include "spirv-tools/libspirv.h"
-#include "type_manager.h"
-#include "types.h"
-#include "util/parse_number.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/set_spec_constant_default_value_pass.h b/source/opt/set_spec_constant_default_value_pass.h
index a1a6da48..8bd1787c 100644
--- a/source/opt/set_spec_constant_default_value_pass.h
+++ b/source/opt/set_spec_constant_default_value_pass.h
@@ -18,10 +18,12 @@
#include <memory>
#include <string>
#include <unordered_map>
+#include <utility>
+#include <vector>
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/simplification_pass.cpp b/source/opt/simplification_pass.cpp
index 81ceb865..5fbafbdd 100644
--- a/source/opt/simplification_pass.cpp
+++ b/source/opt/simplification_pass.cpp
@@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "simplification_pass.h"
+#include "source/opt/simplification_pass.h"
#include <set>
#include <unordered_set>
#include <vector>
-#include "fold.h"
+#include "source/opt/fold.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/simplification_pass.h b/source/opt/simplification_pass.h
index 6997f7df..348c96a0 100644
--- a/source/opt/simplification_pass.h
+++ b/source/opt/simplification_pass.h
@@ -15,9 +15,9 @@
#ifndef SOURCE_OPT_SIMPLIFICATION_PASS_H_
#define SOURCE_OPT_SIMPLIFICATION_PASS_H_
-#include "function.h"
-#include "ir_context.h"
-#include "pass.h"
+#include "source/opt/function.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/ssa_rewrite_pass.cpp b/source/opt/ssa_rewrite_pass.cpp
index 995b750c..8c3f6269 100644
--- a/source/opt/ssa_rewrite_pass.cpp
+++ b/source/opt/ssa_rewrite_pass.cpp
@@ -39,14 +39,16 @@
// some Phi instructions may be dead
// (https://en.wikipedia.org/wiki/Static_single_assignment_form).
-#include "ssa_rewrite_pass.h"
-#include "cfg.h"
-#include "make_unique.h"
-#include "mem_pass.h"
-#include "opcode.h"
+#include "source/opt/ssa_rewrite_pass.h"
+#include <memory>
#include <sstream>
+#include "source/opcode.h"
+#include "source/opt/cfg.h"
+#include "source/opt/make_unique.h"
+#include "source/opt/mem_pass.h"
+
// Debug logging (0: Off, 1-N: Verbosity level). Replace this with the
// implementation done for
// https://github.com/KhronosGroup/SPIRV-Tools/issues/1351
diff --git a/source/opt/ssa_rewrite_pass.h b/source/opt/ssa_rewrite_pass.h
index e7edbbac..c0373dc0 100644
--- a/source/opt/ssa_rewrite_pass.h
+++ b/source/opt/ssa_rewrite_pass.h
@@ -15,11 +15,16 @@
#ifndef SOURCE_OPT_SSA_REWRITE_PASS_H_
#define SOURCE_OPT_SSA_REWRITE_PASS_H_
-#include "basic_block.h"
-#include "ir_context.h"
-#include "mem_pass.h"
-
+#include <queue>
+#include <string>
#include <unordered_map>
+#include <unordered_set>
+#include <utility>
+#include <vector>
+
+#include "source/opt/basic_block.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/mem_pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/strength_reduction_pass.cpp b/source/opt/strength_reduction_pass.cpp
index fa4b3217..ab7c4eb8 100644
--- a/source/opt/strength_reduction_pass.cpp
+++ b/source/opt/strength_reduction_pass.cpp
@@ -12,18 +12,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "strength_reduction_pass.h"
+#include "source/opt/strength_reduction_pass.h"
#include <algorithm>
#include <cstdio>
#include <cstring>
+#include <memory>
#include <unordered_map>
#include <unordered_set>
+#include <utility>
+#include <vector>
-#include "def_use_manager.h"
-#include "ir_context.h"
-#include "log.h"
-#include "reflect.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/log.h"
+#include "source/opt/reflect.h"
namespace {
// Count the number of trailing zeros in the binary representation of
diff --git a/source/opt/strength_reduction_pass.h b/source/opt/strength_reduction_pass.h
index d7218ebc..8dfeb307 100644
--- a/source/opt/strength_reduction_pass.h
+++ b/source/opt/strength_reduction_pass.h
@@ -15,10 +15,10 @@
#ifndef SOURCE_OPT_STRENGTH_REDUCTION_PASS_H_
#define SOURCE_OPT_STRENGTH_REDUCTION_PASS_H_
-#include "def_use_manager.h"
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/strip_debug_info_pass.cpp b/source/opt/strip_debug_info_pass.cpp
index c98a2274..5d9c5fec 100644
--- a/source/opt/strip_debug_info_pass.cpp
+++ b/source/opt/strip_debug_info_pass.cpp
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "strip_debug_info_pass.h"
-#include "ir_context.h"
+#include "source/opt/strip_debug_info_pass.h"
+#include "source/opt/ir_context.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/strip_debug_info_pass.h b/source/opt/strip_debug_info_pass.h
index 46373ccc..47a2cd40 100644
--- a/source/opt/strip_debug_info_pass.h
+++ b/source/opt/strip_debug_info_pass.h
@@ -15,9 +15,9 @@
#ifndef SOURCE_OPT_STRIP_DEBUG_INFO_PASS_H_
#define SOURCE_OPT_STRIP_DEBUG_INFO_PASS_H_
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/strip_reflect_info_pass.cpp b/source/opt/strip_reflect_info_pass.cpp
index fab2e3d8..14ce31ff 100644
--- a/source/opt/strip_reflect_info_pass.cpp
+++ b/source/opt/strip_reflect_info_pass.cpp
@@ -12,12 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "strip_reflect_info_pass.h"
+#include "source/opt/strip_reflect_info_pass.h"
#include <cstring>
+#include <vector>
-#include "instruction.h"
-#include "ir_context.h"
+#include "source/opt/instruction.h"
+#include "source/opt/ir_context.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/strip_reflect_info_pass.h b/source/opt/strip_reflect_info_pass.h
index 1c0fa178..935a605e 100644
--- a/source/opt/strip_reflect_info_pass.h
+++ b/source/opt/strip_reflect_info_pass.h
@@ -15,9 +15,9 @@
#ifndef SOURCE_OPT_STRIP_REFLECT_INFO_PASS_H_
#define SOURCE_OPT_STRIP_REFLECT_INFO_PASS_H_
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/type_manager.cpp b/source/opt/type_manager.cpp
index 7f615a28..c6352927 100644
--- a/source/opt/type_manager.cpp
+++ b/source/opt/type_manager.cpp
@@ -12,16 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "type_manager.h"
+#include "source/opt/type_manager.h"
+#include <algorithm>
#include <cassert>
#include <cstring>
#include <utility>
-#include "ir_context.h"
-#include "log.h"
-#include "make_unique.h"
-#include "reflect.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/log.h"
+#include "source/opt/make_unique.h"
+#include "source/opt/reflect.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/type_manager.h b/source/opt/type_manager.h
index 10292a7b..c44969e8 100644
--- a/source/opt/type_manager.h
+++ b/source/opt/type_manager.h
@@ -18,11 +18,12 @@
#include <memory>
#include <unordered_map>
#include <unordered_set>
+#include <utility>
#include <vector>
-#include "module.h"
+#include "source/opt/module.h"
+#include "source/opt/types.h"
#include "spirv-tools/libspirv.hpp"
-#include "types.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/types.cpp b/source/opt/types.cpp
index e5d90d09..6045ff2b 100644
--- a/source/opt/types.cpp
+++ b/source/opt/types.cpp
@@ -18,7 +18,7 @@
#include <sstream>
#include <unordered_set>
-#include "types.h"
+#include "source/opt/types.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/types.h b/source/opt/types.h
index d88df00f..625f342a 100644
--- a/source/opt/types.h
+++ b/source/opt/types.h
@@ -23,9 +23,10 @@
#include <string>
#include <unordered_map>
#include <unordered_set>
+#include <utility>
#include <vector>
-#include "latest_version_spirv_header.h"
+#include "source/latest_version_spirv_header.h"
#include "spirv-tools/libspirv.h"
namespace spvtools {
diff --git a/source/opt/unify_const_pass.cpp b/source/opt/unify_const_pass.cpp
index 83bd6c0f..c52f34ac 100644
--- a/source/opt/unify_const_pass.cpp
+++ b/source/opt/unify_const_pass.cpp
@@ -12,14 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "unify_const_pass.h"
+#include "source/opt/unify_const_pass.h"
+#include <memory>
#include <unordered_map>
#include <utility>
+#include <vector>
-#include "def_use_manager.h"
-#include "ir_context.h"
-#include "make_unique.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/make_unique.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/unify_const_pass.h b/source/opt/unify_const_pass.h
index e35f9914..f2b7897c 100644
--- a/source/opt/unify_const_pass.h
+++ b/source/opt/unify_const_pass.h
@@ -15,9 +15,9 @@
#ifndef SOURCE_OPT_UNIFY_CONST_PASS_H_
#define SOURCE_OPT_UNIFY_CONST_PASS_H_
-#include "ir_context.h"
-#include "module.h"
-#include "pass.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/value_number_table.cpp b/source/opt/value_number_table.cpp
index 165540f5..1bac63fa 100644
--- a/source/opt/value_number_table.cpp
+++ b/source/opt/value_number_table.cpp
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "value_number_table.h"
+#include "source/opt/value_number_table.h"
#include <algorithm>
-#include "cfg.h"
-#include "ir_context.h"
+#include "source/opt/cfg.h"
+#include "source/opt/ir_context.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/value_number_table.h b/source/opt/value_number_table.h
index 35dcaf72..39129ffa 100644
--- a/source/opt/value_number_table.h
+++ b/source/opt/value_number_table.h
@@ -17,7 +17,8 @@
#include <cstdint>
#include <unordered_map>
-#include "instruction.h"
+
+#include "source/opt/instruction.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/vector_dce.cpp b/source/opt/vector_dce.cpp
index 8738fccf..911242e0 100644
--- a/source/opt/vector_dce.cpp
+++ b/source/opt/vector_dce.cpp
@@ -12,16 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "vector_dce.h"
+#include "source/opt/vector_dce.h"
+#include <utility>
+
+namespace spvtools {
+namespace opt {
namespace {
+
const uint32_t kExtractCompositeIdInIdx = 0;
const uint32_t kInsertObjectIdInIdx = 0;
const uint32_t kInsertCompositeIdInIdx = 1;
-} // namespace
-namespace spvtools {
-namespace opt {
+} // namespace
Pass::Status VectorDCE::Process() {
bool modified = false;
diff --git a/source/opt/vector_dce.h b/source/opt/vector_dce.h
index 960deb76..48886998 100644
--- a/source/opt/vector_dce.h
+++ b/source/opt/vector_dce.h
@@ -15,8 +15,11 @@
#ifndef SOURCE_OPT_VECTOR_DCE_H_
#define SOURCE_OPT_VECTOR_DCE_H_
-#include <util/bit_vector.h>
-#include "mem_pass.h"
+#include <unordered_map>
+#include <vector>
+
+#include "source/opt/mem_pass.h"
+#include "source/util/bit_vector.h"
namespace spvtools {
namespace opt {
diff --git a/source/opt/workaround1209.cpp b/source/opt/workaround1209.cpp
index fae08b83..d6e9d2cf 100644
--- a/source/opt/workaround1209.cpp
+++ b/source/opt/workaround1209.cpp
@@ -12,10 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "workaround1209.h"
+#include "source/opt/workaround1209.h"
#include <list>
+#include <memory>
#include <stack>
+#include <utility>
namespace spvtools {
namespace opt {
diff --git a/source/opt/workaround1209.h b/source/opt/workaround1209.h
index 22d9f9c9..9a1f88d9 100644
--- a/source/opt/workaround1209.h
+++ b/source/opt/workaround1209.h
@@ -15,7 +15,7 @@
#ifndef SOURCE_OPT_WORKAROUND1209_H_
#define SOURCE_OPT_WORKAROUND1209_H_
-#include "pass.h"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
diff --git a/source/parsed_operand.cpp b/source/parsed_operand.cpp
index 3f10d822..3bb4dd01 100644
--- a/source/parsed_operand.cpp
+++ b/source/parsed_operand.cpp
@@ -14,10 +14,10 @@
// This file contains utility functions for spv_parsed_operand_t.
-#include "parsed_operand.h"
+#include "source/parsed_operand.h"
#include <cassert>
-#include "util/hex_float.h"
+#include "source/util/hex_float.h"
namespace spvtools {
diff --git a/source/parsed_operand.h b/source/parsed_operand.h
index 779677ef..bab86110 100644
--- a/source/parsed_operand.h
+++ b/source/parsed_operand.h
@@ -16,6 +16,7 @@
#define SOURCE_PARSED_OPERAND_H_
#include <ostream>
+
#include "spirv-tools/libspirv.h"
namespace spvtools {
diff --git a/source/print.cpp b/source/print.cpp
index f03c2d68..f75e2d45 100644
--- a/source/print.cpp
+++ b/source/print.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "print.h"
+#include "source/print.h"
#if defined(SPIRV_ANDROID) || defined(SPIRV_LINUX) || defined(SPIRV_MAC) || \
defined(SPIRV_FREEBSD)
diff --git a/source/spirv_constant.h b/source/spirv_constant.h
index d705ff2c..39771ccb 100644
--- a/source/spirv_constant.h
+++ b/source/spirv_constant.h
@@ -15,7 +15,7 @@
#ifndef SOURCE_SPIRV_CONSTANT_H_
#define SOURCE_SPIRV_CONSTANT_H_
-#include "latest_version_spirv_header.h"
+#include "source/latest_version_spirv_header.h"
#include "spirv-tools/libspirv.h"
// Version number macros.
diff --git a/source/spirv_definition.h b/source/spirv_definition.h
index 2513944c..63a4ef0d 100644
--- a/source/spirv_definition.h
+++ b/source/spirv_definition.h
@@ -17,7 +17,7 @@
#include <cstdint>
-#include "latest_version_spirv_header.h"
+#include "source/latest_version_spirv_header.h"
#define spvIsInBitfield(value, bitfield) ((value) == ((value)&bitfield))
diff --git a/source/spirv_endian.cpp b/source/spirv_endian.cpp
index 56eaac85..1d770917 100644
--- a/source/spirv_endian.cpp
+++ b/source/spirv_endian.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "spirv_endian.h"
+#include "source/spirv_endian.h"
#include <cstring>
diff --git a/source/spirv_stats.cpp b/source/spirv_stats.cpp
index 9720d550..bf4107a1 100644
--- a/source/spirv_stats.cpp
+++ b/source/spirv_stats.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "spirv_stats.h"
+#include "source/spirv_stats.h"
#include <cassert>
@@ -20,17 +20,17 @@
#include <memory>
#include <string>
-#include "diagnostic.h"
-#include "enum_string_mapping.h"
-#include "extensions.h"
-#include "id_descriptor.h"
-#include "instruction.h"
-#include "opcode.h"
-#include "operand.h"
+#include "source/diagnostic.h"
+#include "source/enum_string_mapping.h"
+#include "source/extensions.h"
+#include "source/id_descriptor.h"
+#include "source/instruction.h"
+#include "source/opcode.h"
+#include "source/operand.h"
+#include "source/val/instruction.h"
+#include "source/val/validate.h"
+#include "source/val/validation_state.h"
#include "spirv-tools/libspirv.h"
-#include "val/instruction.h"
-#include "val/validate.h"
-#include "val/validation_state.h"
namespace spvtools {
namespace {
diff --git a/source/spirv_stats.h b/source/spirv_stats.h
index fd661d4d..348bba16 100644
--- a/source/spirv_stats.h
+++ b/source/spirv_stats.h
@@ -18,6 +18,7 @@
#include <map>
#include <string>
#include <unordered_map>
+#include <utility>
#include <vector>
#include "spirv-tools/libspirv.hpp"
diff --git a/source/spirv_target_env.cpp b/source/spirv_target_env.cpp
index 3a8766d7..7a11630c 100644
--- a/source/spirv_target_env.cpp
+++ b/source/spirv_target_env.cpp
@@ -12,11 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+#include "source/spirv_target_env.h"
+
#include <cassert>
#include <cstring>
+#include "source/spirv_constant.h"
#include "spirv-tools/libspirv.h"
-#include "spirv_constant.h"
const char* spvTargetEnvDescription(spv_target_env env) {
switch (env) {
diff --git a/source/spirv_validator_options.cpp b/source/spirv_validator_options.cpp
index daa53ebd..0c062536 100644
--- a/source/spirv_validator_options.cpp
+++ b/source/spirv_validator_options.cpp
@@ -15,7 +15,7 @@
#include <cassert>
#include <cstring>
-#include "spirv_validator_options.h"
+#include "source/spirv_validator_options.h"
bool spvParseUniversalLimitsOptions(const char* s, spv_validator_limit* type) {
auto match = [s](const char* b) {
diff --git a/source/table.cpp b/source/table.cpp
index 9f8be862..b10d776d 100644
--- a/source/table.cpp
+++ b/source/table.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "table.h"
+#include "source/table.h"
#include <utility>
diff --git a/source/table.h b/source/table.h
index 0ad5bb52..9790136b 100644
--- a/source/table.h
+++ b/source/table.h
@@ -15,10 +15,10 @@
#ifndef SOURCE_TABLE_H_
#define SOURCE_TABLE_H_
-#include "latest_version_spirv_header.h"
+#include "source/latest_version_spirv_header.h"
-#include "extensions.h"
-#include "message.h"
+#include "source/extensions.h"
+#include "source/message.h"
#include "spirv-tools/libspirv.hpp"
typedef struct spv_opcode_desc_t {
diff --git a/source/text.cpp b/source/text.cpp
index d16e2f47..ba575f90 100644
--- a/source/text.cpp
+++ b/source/text.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "text.h"
+#include "source/text.h"
#include <algorithm>
#include <cassert>
@@ -21,26 +21,28 @@
#include <cstdlib>
#include <cstring>
#include <memory>
+#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
+#include <utility>
#include <vector>
-#include "assembly_grammar.h"
-#include "binary.h"
-#include "diagnostic.h"
-#include "ext_inst.h"
-#include "instruction.h"
-#include "message.h"
-#include "opcode.h"
-#include "operand.h"
+#include "source/assembly_grammar.h"
+#include "source/binary.h"
+#include "source/diagnostic.h"
+#include "source/ext_inst.h"
+#include "source/instruction.h"
+#include "source/message.h"
+#include "source/opcode.h"
+#include "source/operand.h"
+#include "source/spirv_constant.h"
+#include "source/spirv_target_env.h"
+#include "source/table.h"
+#include "source/text_handler.h"
+#include "source/util/bitutils.h"
+#include "source/util/parse_number.h"
#include "spirv-tools/libspirv.h"
-#include "spirv_constant.h"
-#include "spirv_target_env.h"
-#include "table.h"
-#include "text_handler.h"
-#include "util/bitutils.h"
-#include "util/parse_number.h"
bool spvIsValidIDCharacter(const char value) {
return value == '_' || 0 != ::isalnum(value);
diff --git a/source/text.h b/source/text.h
index 727cb2f6..fa34ee16 100644
--- a/source/text.h
+++ b/source/text.h
@@ -17,9 +17,9 @@
#include <string>
-#include "operand.h"
+#include "source/operand.h"
+#include "source/spirv_constant.h"
#include "spirv-tools/libspirv.h"
-#include "spirv_constant.h"
typedef enum spv_literal_type_t {
SPV_LITERAL_TYPE_INT_32,
diff --git a/source/text_handler.cpp b/source/text_handler.cpp
index 49a1675a..37b47fc0 100644
--- a/source/text_handler.cpp
+++ b/source/text_handler.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "text_handler.h"
+#include "source/text_handler.h"
#include <algorithm>
#include <cassert>
@@ -20,15 +20,15 @@
#include <cstring>
#include <tuple>
-#include "assembly_grammar.h"
-#include "binary.h"
-#include "ext_inst.h"
-#include "instruction.h"
-#include "opcode.h"
-#include "text.h"
-#include "util/bitutils.h"
-#include "util/hex_float.h"
-#include "util/parse_number.h"
+#include "source/assembly_grammar.h"
+#include "source/binary.h"
+#include "source/ext_inst.h"
+#include "source/instruction.h"
+#include "source/opcode.h"
+#include "source/text.h"
+#include "source/util/bitutils.h"
+#include "source/util/hex_float.h"
+#include "source/util/parse_number.h"
namespace spvtools {
namespace {
diff --git a/source/text_handler.h b/source/text_handler.h
index daefdc8b..6785f25f 100644
--- a/source/text_handler.h
+++ b/source/text_handler.h
@@ -16,15 +16,18 @@
#define SOURCE_TEXT_HANDLER_H_
#include <iomanip>
+#include <set>
#include <sstream>
+#include <string>
#include <type_traits>
#include <unordered_map>
+#include <utility>
-#include "diagnostic.h"
-#include "instruction.h"
-#include "message.h"
+#include "source/diagnostic.h"
+#include "source/instruction.h"
+#include "source/message.h"
+#include "source/text.h"
#include "spirv-tools/libspirv.h"
-#include "text.h"
namespace spvtools {
diff --git a/source/util/bit_stream.cpp b/source/util/bit_stream.cpp
index e30c6262..a275a63a 100644
--- a/source/util/bit_stream.cpp
+++ b/source/util/bit_stream.cpp
@@ -18,7 +18,7 @@
#include <sstream>
#include <type_traits>
-#include "util/bit_stream.h"
+#include "source/util/bit_stream.h"
namespace spvtools {
namespace utils {
diff --git a/source/util/bit_stream.h b/source/util/bit_stream.h
index d4c81215..58165374 100644
--- a/source/util/bit_stream.h
+++ b/source/util/bit_stream.h
@@ -23,6 +23,7 @@
#include <functional>
#include <sstream>
#include <string>
+#include <utility>
#include <vector>
namespace spvtools {
diff --git a/source/util/bit_vector.cpp b/source/util/bit_vector.cpp
index 61516579..47e275bf 100644
--- a/source/util/bit_vector.cpp
+++ b/source/util/bit_vector.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "bit_vector.h"
+#include "source/util/bit_vector.h"
#include <cassert>
#include <iostream>
diff --git a/source/util/hex_float.h b/source/util/hex_float.h
index 03ce8228..b7baf093 100644
--- a/source/util/hex_float.h
+++ b/source/util/hex_float.h
@@ -24,7 +24,7 @@
#include <sstream>
#include <vector>
-#include "bitutils.h"
+#include "source/util/bitutils.h"
#ifndef __GNUC__
#define GCC_VERSION 0
diff --git a/source/util/huffman_codec.h b/source/util/huffman_codec.h
index ed8d1b90..705bac1c 100644
--- a/source/util/huffman_codec.h
+++ b/source/util/huffman_codec.h
@@ -27,8 +27,10 @@
#include <queue>
#include <sstream>
#include <stack>
+#include <string>
#include <tuple>
#include <unordered_map>
+#include <utility>
#include <vector>
namespace spvtools {
diff --git a/source/util/ilist.h b/source/util/ilist.h
index a2905e93..9837b09b 100644
--- a/source/util/ilist.h
+++ b/source/util/ilist.h
@@ -20,7 +20,7 @@
#include <type_traits>
#include <vector>
-#include "ilist_node.h"
+#include "source/util/ilist_node.h"
namespace spvtools {
namespace utils {
diff --git a/source/util/move_to_front.h b/source/util/move_to_front.h
index 67c6f6eb..bf2eba46 100644
--- a/source/util/move_to_front.h
+++ b/source/util/move_to_front.h
@@ -26,6 +26,7 @@
#include <sstream>
#include <unordered_map>
#include <unordered_set>
+#include <utility>
#include <vector>
namespace spvtools {
diff --git a/source/util/parse_number.cpp b/source/util/parse_number.cpp
index e983072f..d0b13c64 100644
--- a/source/util/parse_number.cpp
+++ b/source/util/parse_number.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "util/parse_number.h"
+#include "source/util/parse_number.h"
#include <functional>
#include <iomanip>
@@ -21,7 +21,7 @@
#include <string>
#include <tuple>
-#include "util/hex_float.h"
+#include "source/util/hex_float.h"
namespace spvtools {
namespace utils {
diff --git a/source/util/parse_number.h b/source/util/parse_number.h
index ef54a9dc..729aac54 100644
--- a/source/util/parse_number.h
+++ b/source/util/parse_number.h
@@ -19,8 +19,8 @@
#include <string>
#include <tuple>
+#include "source/util/hex_float.h"
#include "spirv-tools/libspirv.h"
-#include "util/hex_float.h"
namespace spvtools {
namespace utils {
diff --git a/source/util/small_vector.h b/source/util/small_vector.h
index 2d1a52df..49a03811 100644
--- a/source/util/small_vector.h
+++ b/source/util/small_vector.h
@@ -17,9 +17,11 @@
#include <cassert>
#include <iostream>
+#include <memory>
+#include <utility>
#include <vector>
-#include "opt/make_unique.h"
+#include "source/opt/make_unique.h"
namespace spvtools {
namespace utils {
diff --git a/source/util/string_utils.cpp b/source/util/string_utils.cpp
index 435bbe17..29ce2aa4 100644
--- a/source/util/string_utils.cpp
+++ b/source/util/string_utils.cpp
@@ -16,7 +16,7 @@
#include <cstdint>
#include <type_traits>
-#include "util/string_utils.h"
+#include "source/util/string_utils.h"
namespace spvtools {
namespace utils {
diff --git a/source/util/string_utils.h b/source/util/string_utils.h
index 7d329dd3..322c574f 100644
--- a/source/util/string_utils.h
+++ b/source/util/string_utils.h
@@ -18,7 +18,7 @@
#include <sstream>
#include <string>
-#include "util/string_utils.h"
+#include "source/util/string_utils.h"
namespace spvtools {
namespace utils {
diff --git a/source/util/timer.cpp b/source/util/timer.cpp
index a90e41a2..c8b8d5b6 100644
--- a/source/util/timer.cpp
+++ b/source/util/timer.cpp
@@ -14,7 +14,7 @@
#if defined(SPIRV_TIMER_ENABLED)
-#include "util/timer.h"
+#include "source/util/timer.h"
#include <sys/resource.h>
#include <sys/time.h>
diff --git a/source/val/basic_block.cpp b/source/val/basic_block.cpp
index ce1a3b51..a53103c8 100644
--- a/source/val/basic_block.cpp
+++ b/source/val/basic_block.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "val/basic_block.h"
+#include "source/val/basic_block.h"
#include <algorithm>
#include <utility>
diff --git a/source/val/basic_block.h b/source/val/basic_block.h
index 7d4ded5d..efbd243b 100644
--- a/source/val/basic_block.h
+++ b/source/val/basic_block.h
@@ -15,15 +15,14 @@
#ifndef SOURCE_VAL_BASIC_BLOCK_H_
#define SOURCE_VAL_BASIC_BLOCK_H_
-#include "latest_version_spirv_header.h"
-
#include <cstdint>
-
#include <bitset>
#include <functional>
#include <memory>
#include <vector>
+#include "source/latest_version_spirv_header.h"
+
namespace spvtools {
namespace val {
diff --git a/source/val/construct.cpp b/source/val/construct.cpp
index 6a70ab25..c11a065b 100644
--- a/source/val/construct.cpp
+++ b/source/val/construct.cpp
@@ -12,13 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "val/construct.h"
-#include "val/function.h"
+#include "source/val/construct.h"
#include <cassert>
#include <cstddef>
#include <unordered_set>
+#include "source/val/function.h"
+
namespace spvtools {
namespace val {
diff --git a/source/val/construct.h b/source/val/construct.h
index 6b64ce6b..c7e7a780 100644
--- a/source/val/construct.h
+++ b/source/val/construct.h
@@ -15,12 +15,12 @@
#ifndef SOURCE_VAL_CONSTRUCT_H_
#define SOURCE_VAL_CONSTRUCT_H_
-#include "val/basic_block.h"
-
#include <cstdint>
#include <set>
#include <vector>
+#include "source/val/basic_block.h"
+
namespace spvtools {
namespace val {
diff --git a/source/val/decoration.h b/source/val/decoration.h
index 52a9aad7..ed3320f8 100644
--- a/source/val/decoration.h
+++ b/source/val/decoration.h
@@ -19,7 +19,7 @@
#include <unordered_map>
#include <vector>
-#include "latest_version_spirv_header.h"
+#include "source/latest_version_spirv_header.h"
namespace spvtools {
namespace val {
diff --git a/source/val/function.cpp b/source/val/function.cpp
index d1599b71..f638fb5b 100644
--- a/source/val/function.cpp
+++ b/source/val/function.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "val/function.h"
+#include "source/val/function.h"
#include <cassert>
@@ -22,10 +22,10 @@
#include <unordered_set>
#include <utility>
-#include "cfa.h"
-#include "val/basic_block.h"
-#include "val/construct.h"
-#include "validate.h"
+#include "source/cfa.h"
+#include "source/val/basic_block.h"
+#include "source/val/construct.h"
+#include "source/val/validate.h"
namespace spvtools {
namespace val {
diff --git a/source/val/function.h b/source/val/function.h
index 461a8fba..a052bbda 100644
--- a/source/val/function.h
+++ b/source/val/function.h
@@ -19,14 +19,16 @@
#include <list>
#include <map>
#include <set>
+#include <string>
#include <unordered_map>
#include <unordered_set>
+#include <utility>
#include <vector>
-#include "latest_version_spirv_header.h"
+#include "source/latest_version_spirv_header.h"
+#include "source/val/basic_block.h"
+#include "source/val/construct.h"
#include "spirv-tools/libspirv.h"
-#include "val/basic_block.h"
-#include "val/construct.h"
namespace spvtools {
namespace val {
diff --git a/source/val/instruction.cpp b/source/val/instruction.cpp
index 675d6395..b9155898 100644
--- a/source/val/instruction.cpp
+++ b/source/val/instruction.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "val/instruction.h"
+#include "source/val/instruction.h"
#include <utility>
diff --git a/source/val/instruction.h b/source/val/instruction.h
index 6c78b83b..1fa855fc 100644
--- a/source/val/instruction.h
+++ b/source/val/instruction.h
@@ -21,8 +21,8 @@
#include <utility>
#include <vector>
+#include "source/table.h"
#include "spirv-tools/libspirv.h"
-#include "table.h"
namespace spvtools {
namespace val {
diff --git a/source/val/validate.h b/source/val/validate.h
index 45709c9c..3c64fb6a 100644
--- a/source/val/validate.h
+++ b/source/val/validate.h
@@ -16,6 +16,7 @@
#define SOURCE_VAL_VALIDATE_H_
#include <functional>
+#include <memory>
#include <utility>
#include <vector>
diff --git a/source/val/validate_arithmetics.cpp b/source/val/validate_arithmetics.cpp
index df85276d..2314e7df 100644
--- a/source/val/validate_arithmetics.cpp
+++ b/source/val/validate_arithmetics.cpp
@@ -16,6 +16,8 @@
#include "source/val/validate.h"
+#include <vector>
+
#include "source/diagnostic.h"
#include "source/opcode.h"
#include "source/val/instruction.h"
diff --git a/source/val/validate_barriers.cpp b/source/val/validate_barriers.cpp
index dfeb9937..895df363 100644
--- a/source/val/validate_barriers.cpp
+++ b/source/val/validate_barriers.cpp
@@ -16,6 +16,8 @@
#include "source/val/validate.h"
+#include <string>
+
#include "source/diagnostic.h"
#include "source/opcode.h"
#include "source/spirv_constant.h"
diff --git a/source/val/validate_builtins.cpp b/source/val/validate_builtins.cpp
index 6c885021..c791e428 100644
--- a/source/val/validate_builtins.cpp
+++ b/source/val/validate_builtins.cpp
@@ -22,6 +22,7 @@
#include <set>
#include <sstream>
#include <stack>
+#include <string>
#include <unordered_map>
#include <vector>
diff --git a/source/val/validate_capability.cpp b/source/val/validate_capability.cpp
index bb97ded2..4724b9f7 100644
--- a/source/val/validate_capability.cpp
+++ b/source/val/validate_capability.cpp
@@ -17,6 +17,7 @@
#include "source/val/validate.h"
#include <cassert>
+#include <string>
#include <unordered_set>
#include "source/diagnostic.h"
diff --git a/source/val/validate_decorations.cpp b/source/val/validate_decorations.cpp
index 2f0d007d..bfaa6456 100644
--- a/source/val/validate_decorations.cpp
+++ b/source/val/validate_decorations.cpp
@@ -19,6 +19,7 @@
#include <string>
#include <unordered_map>
#include <utility>
+#include <vector>
#include "source/diagnostic.h"
#include "source/opcode.h"
diff --git a/source/val/validate_derivatives.cpp b/source/val/validate_derivatives.cpp
index 398e79ab..951e2142 100644
--- a/source/val/validate_derivatives.cpp
+++ b/source/val/validate_derivatives.cpp
@@ -16,6 +16,8 @@
#include "source/val/validate.h"
+#include <string>
+
#include "source/diagnostic.h"
#include "source/opcode.h"
#include "source/val/instruction.h"
diff --git a/source/val/validate_ext_inst.cpp b/source/val/validate_ext_inst.cpp
index b72c3634..24565719 100644
--- a/source/val/validate_ext_inst.cpp
+++ b/source/val/validate_ext_inst.cpp
@@ -17,6 +17,8 @@
#include "source/val/validate.h"
#include <sstream>
+#include <string>
+#include <vector>
#include "source/diagnostic.h"
#include "source/latest_version_glsl_std_450_header.h"
diff --git a/source/val/validate_id.cpp b/source/val/validate_id.cpp
index af690518..ee1f0b54 100644
--- a/source/val/validate_id.cpp
+++ b/source/val/validate_id.cpp
@@ -20,6 +20,7 @@
#include <iostream>
#include <iterator>
#include <stack>
+#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
diff --git a/source/val/validate_image.cpp b/source/val/validate_image.cpp
index 47c3e43e..f2be9dca 100644
--- a/source/val/validate_image.cpp
+++ b/source/val/validate_image.cpp
@@ -16,6 +16,8 @@
#include "source/val/validate.h"
+#include <string>
+
#include "source/diagnostic.h"
#include "source/opcode.h"
#include "source/spirv_target_env.h"
diff --git a/source/val/validate_instruction.cpp b/source/val/validate_instruction.cpp
index 33e1bc77..85995caa 100644
--- a/source/val/validate_instruction.cpp
+++ b/source/val/validate_instruction.cpp
@@ -18,9 +18,9 @@
#include <algorithm>
#include <cassert>
-
#include <sstream>
#include <string>
+#include <vector>
#include "source/binary.h"
#include "source/diagnostic.h"
diff --git a/source/val/validate_interfaces.cpp b/source/val/validate_interfaces.cpp
index 354e4be4..b5d680e5 100644
--- a/source/val/validate_interfaces.cpp
+++ b/source/val/validate_interfaces.cpp
@@ -15,6 +15,7 @@
#include "source/val/validate.h"
#include <algorithm>
+#include <vector>
#include "source/diagnostic.h"
#include "source/val/function.h"
diff --git a/source/val/validate_memory.cpp b/source/val/validate_memory.cpp
index 7f0f5788..55060921 100644
--- a/source/val/validate_memory.cpp
+++ b/source/val/validate_memory.cpp
@@ -15,6 +15,8 @@
#include "source/val/validate.h"
#include <algorithm>
+#include <string>
+#include <vector>
#include "source/opcode.h"
#include "source/val/instruction.h"
diff --git a/source/val/validation_state.cpp b/source/val/validation_state.cpp
index 27d1fa63..e0c9e5ba 100644
--- a/source/val/validation_state.cpp
+++ b/source/val/validation_state.cpp
@@ -12,17 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "val/validation_state.h"
+#include "source/val/validation_state.h"
#include <cassert>
#include <stack>
+#include <utility>
-#include "opcode.h"
+#include "source/opcode.h"
+#include "source/spirv_target_env.h"
+#include "source/val/basic_block.h"
+#include "source/val/construct.h"
+#include "source/val/function.h"
#include "spirv-tools/libspirv.h"
-#include "spirv_target_env.h"
-#include "val/basic_block.h"
-#include "val/construct.h"
-#include "val/function.h"
namespace spvtools {
namespace val {
diff --git a/source/val/validation_state.h b/source/val/validation_state.h
index 3dbc2d77..d93fe1e9 100644
--- a/source/val/validation_state.h
+++ b/source/val/validation_state.h
@@ -15,6 +15,7 @@
#ifndef SOURCE_VAL_VALIDATION_STATE_H_
#define SOURCE_VAL_VALIDATION_STATE_H_
+#include <map>
#include <set>
#include <string>
#include <tuple>
@@ -22,17 +23,17 @@
#include <unordered_set>
#include <vector>
-#include "assembly_grammar.h"
-#include "decoration.h"
-#include "diagnostic.h"
-#include "disassemble.h"
-#include "enum_set.h"
-#include "latest_version_spirv_header.h"
+#include "source/assembly_grammar.h"
+#include "source/diagnostic.h"
+#include "source/disassemble.h"
+#include "source/enum_set.h"
+#include "source/latest_version_spirv_header.h"
+#include "source/spirv_definition.h"
+#include "source/spirv_validator_options.h"
+#include "source/val/decoration.h"
+#include "source/val/function.h"
+#include "source/val/instruction.h"
#include "spirv-tools/libspirv.h"
-#include "spirv_definition.h"
-#include "spirv_validator_options.h"
-#include "val/function.h"
-#include "val/instruction.h"
namespace spvtools {
namespace val {