SPIRV-Tools/source/opt
Pierre Moreau 7183ad526e Linker code cleanups
Turn `Linker::Link()` into free functions

  As very little information was kept in the Linker class, we can get rid
  of the whole class and have the `Link()` as free functions instead; the
  environment target as well as the consumer are passed along through an
  `spv_context` object.
  The resulting linked_binary is passed as a pointer rather than a
  reference to follow the Google C++ Style guidelines.

  Addresses remaining comments from
  https://github.com/KhronosGroup/SPIRV-Tools/pull/693 about the SPIR-V
  linker.

Fix variable naming in the linker

  Some of the variables were using mixed case, which did not follow the
  Google C++ Style guidelines.

Linker: Use EXPECT_EQ when possible and update some test

* Replace occurrences of ASSERT_EQ by EXPECT_EQ when possible;
* Reformulated some of the error messages;
* Added the symbol name in the error message when there is a type or
  decoration mismatch between the imported and exported declarations.

Opt: List all duplicates removed by RemoveDuplicatePass in the header

Opt: Make the const version of GetLabelInst() return a pointer

  For consistency with the non-const version, as well as other similar
  functions.

Opt: Rename function_end to EndInst()

  As pointed out by dneto0 the previous name was quite confusing and could
  be mistaken with a function returning an end iterator.
  Also change the return type of the const version to a pointer rather
  than a reference, for consistency.

Opt: Add performance comment to RemoveDuplicateTypes and decorations

  This comment was requested during the review of
  https://github.com/KhronosGroup/SPIRV-Tools/pull/693.

Opt: Add comments and fix variable naming in RemoveDuplicatePass

* Add missing comments to private functions;
* Rename variables that were using mixed case;
* Add TODO for moving AreTypesEqual out.

Linker: Remove commented out code and add TODOs

Linker: Merged together strings that were too much splitted

Implement a C++ RAII wrapper around spv_context
2018-01-05 13:28:44 -05:00
..
aggressive_dead_code_elim_pass.cpp Address review comments from https://github.com/KhronosGroup/SPIRV-Tools/pull/985. 2018-01-04 13:20:49 -05:00
aggressive_dead_code_elim_pass.h Allow pointers to pointers in logical addressing mode. 2017-12-19 14:29:14 -05:00
basic_block.cpp Linker code cleanups 2018-01-05 13:28:44 -05:00
basic_block.h Linker code cleanups 2018-01-05 13:28:44 -05:00
block_merge_pass.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
block_merge_pass.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
build_module.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
build_module.h Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
ccp_pass.cpp Do not insert Phi nodes in CCP propagator. 2018-01-03 15:12:25 -05:00
ccp_pass.h Implement SSA CCP (SSA Conditional Constant Propagation). 2017-12-21 14:29:45 -05:00
cfg_cleanup_pass.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
cfg_cleanup_pass.h Have all MemPasses preserve the def-use manager. 2017-11-10 11:17:12 -05:00
cfg.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
cfg.h Convert the CFG to an on-demand analysis - NFC. 2017-11-28 13:25:41 -05:00
CMakeLists.txt Implement SSA CCP (SSA Conditional Constant Propagation). 2017-12-21 14:29:45 -05:00
common_uniform_elim_pass.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
common_uniform_elim_pass.h Change IRContext::KillInst to delete instructions. 2017-12-04 11:07:45 -05:00
compact_ids_pass.cpp Add a new constant manager class. 2017-12-08 14:14:55 -05:00
compact_ids_pass.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
constants.cpp Implement SSA CCP (SSA Conditional Constant Propagation). 2017-12-21 14:29:45 -05:00
constants.h Fix https://github.com/KhronosGroup/SPIRV-Tools/issues/1130 2017-12-22 13:33:17 -05:00
dead_branch_elim_pass.cpp dead branch elim: Track killed backedges 2018-01-04 19:06:55 -05:00
dead_branch_elim_pass.h Have all MemPasses preserve the def-use manager. 2017-11-10 11:17:12 -05:00
dead_variable_elimination.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
dead_variable_elimination.h Have all MemPasses preserve the def-use manager. 2017-11-10 11:17:12 -05:00
decoration_manager.cpp Opt: Make DecorationManager::HaveTheSameDecorations symmetric 2018-01-04 14:07:25 -05:00
decoration_manager.h Opt: Fix implementation and comment of AreDecorationsTheSame 2017-12-19 15:36:47 -05:00
def_use_manager.cpp Add scalar replacement 2017-12-11 10:51:13 -05:00
def_use_manager.h Add scalar replacement 2017-12-11 10:51:13 -05:00
dominator_analysis.h Dominator Tree Analysis (#3) 2017-12-05 22:59:43 -05:00
dominator_tree.cpp Add depth first iterator for trees 2017-12-07 10:07:56 -05:00
dominator_tree.h Add depth first iterator for trees 2017-12-07 10:07:56 -05:00
eliminate_dead_constant_pass.cpp Change IRContext::KillInst to delete instructions. 2017-12-04 11:07:45 -05:00
eliminate_dead_constant_pass.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
eliminate_dead_functions_pass.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
eliminate_dead_functions_pass.h Have all MemPasses preserve the def-use manager. 2017-11-10 11:17:12 -05:00
feature_manager.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
feature_manager.h Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
flatten_decoration_pass.cpp Adding an unique id to Instruction generated by IRContext 2017-11-20 17:49:10 -05:00
flatten_decoration_pass.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
fold_spec_constant_op_and_composite_pass.cpp Implement SSA CCP (SSA Conditional Constant Propagation). 2017-12-21 14:29:45 -05:00
fold_spec_constant_op_and_composite_pass.h Improving the usability of the type manager. The type manager hashes 2017-12-18 08:20:56 -05:00
fold.cpp Fix https://github.com/KhronosGroup/SPIRV-Tools/issues/1130 2017-12-22 13:33:17 -05:00
fold.h Fix https://github.com/KhronosGroup/SPIRV-Tools/issues/1130 2017-12-22 13:33:17 -05:00
freeze_spec_constant_value_pass.cpp Replace calls to ToNop by KillInst. 2018-01-04 11:03:04 -05:00
freeze_spec_constant_value_pass.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
function.cpp Linker code cleanups 2018-01-05 13:28:44 -05:00
function.h Linker code cleanups 2018-01-05 13:28:44 -05:00
inline_exhaustive_pass.cpp Set the parent for basic blocks during inlining. 2017-12-12 13:39:08 -05:00
inline_exhaustive_pass.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
inline_opaque_pass.cpp Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
inline_opaque_pass.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
inline_pass.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
inline_pass.h Convert private variables to function scope. 2017-12-19 14:21:04 -05:00
insert_extract_elim.cpp Change IRContext::KillInst to delete instructions. 2017-12-04 11:07:45 -05:00
insert_extract_elim.h Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
instruction_list.cpp Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
instruction_list.h Refactor include of latest spir-v header versions 2017-12-14 11:18:20 -05:00
instruction.cpp Allow getting the base pointer of an image load/store. 2018-01-05 13:26:10 -05:00
instruction.h Allow getting the base pointer of an image load/store. 2018-01-05 13:26:10 -05:00
ir_context.cpp Improving the usability of the type manager. The type manager hashes 2017-12-18 08:20:56 -05:00
ir_context.h Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
ir_loader.cpp Fixed typo that leaked to the binary 2017-12-03 20:42:14 -05:00
ir_loader.h Adding an unique id to Instruction generated by IRContext 2017-11-20 17:49:10 -05:00
iterator.h Fix move semantics in iterator make_range 2017-11-21 17:36:15 -05:00
local_access_chain_convert_pass.cpp Change IRContext::KillInst to delete instructions. 2017-12-04 11:07:45 -05:00
local_access_chain_convert_pass.h Change IRContext::KillInst to delete instructions. 2017-12-04 11:07:45 -05:00
local_redundancy_elimination.cpp Add global redundancy elimination 2017-12-07 18:35:38 -05:00
local_redundancy_elimination.h Add global redundancy elimination 2017-12-07 18:35:38 -05:00
local_single_block_elim_pass.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
local_single_block_elim_pass.h Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
local_single_store_elim_pass.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
local_single_store_elim_pass.h Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
local_ssa_elim_pass.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
local_ssa_elim_pass.h Have all MemPasses preserve the def-use manager. 2017-11-10 11:17:12 -05:00
log.h Avoid snprintf warning in GCC 7.1 2017-05-08 15:58:24 -04:00
make_unique.h Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00
mem_pass.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
mem_pass.h Allow pointers to pointers in logical addressing mode. 2017-12-19 14:29:14 -05:00
merge_return_pass.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
merge_return_pass.h Initial implementation of merge return pass. 2017-11-15 10:27:04 -05:00
module.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
module.h Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
null_pass.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
optimizer.cpp Add --print-all optimizer option 2018-01-04 18:34:18 -05:00
pass_manager.cpp Add --print-all optimizer option 2018-01-04 18:34:18 -05:00
pass_manager.h Add --print-all optimizer option 2018-01-04 18:34:18 -05:00
pass.cpp Add a new constant manager class. 2017-12-08 14:14:55 -05:00
pass.h Add a new constant manager class. 2017-12-08 14:14:55 -05:00
passes.h Implement SSA CCP (SSA Conditional Constant Propagation). 2017-12-21 14:29:45 -05:00
private_to_local_pass.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
private_to_local_pass.h Convert private variables to function scope. 2017-12-19 14:21:04 -05:00
propagator.cpp Fix infinite simulation cycles in SSA propagator. 2018-01-05 10:29:39 -05:00
propagator.h Fix infinite simulation cycles in SSA propagator. 2018-01-05 10:29:39 -05:00
redundancy_elimination.cpp Add global redundancy elimination 2017-12-07 18:35:38 -05:00
redundancy_elimination.h Add global redundancy elimination 2017-12-07 18:35:38 -05:00
reflect.h Opt: Make DecorationManager::HaveTheSameDecorations symmetric 2018-01-04 14:07:25 -05:00
remove_duplicates_pass.cpp Linker code cleanups 2018-01-05 13:28:44 -05:00
remove_duplicates_pass.h Linker code cleanups 2018-01-05 13:28:44 -05:00
scalar_replacement_pass.cpp Improving the usability of the type manager. The type manager hashes 2017-12-18 08:20:56 -05:00
scalar_replacement_pass.h Add scalar replacement 2017-12-11 10:51:13 -05:00
set_spec_constant_default_value_pass.cpp Improving the usability of the type manager. The type manager hashes 2017-12-18 08:20:56 -05:00
set_spec_constant_default_value_pass.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
strength_reduction_pass.cpp Improving the usability of the type manager. The type manager hashes 2017-12-18 08:20:56 -05:00
strength_reduction_pass.h Improving the usability of the type manager. The type manager hashes 2017-12-18 08:20:56 -05:00
strip_debug_info_pass.cpp Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
strip_debug_info_pass.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
tree_iterator.h Add depth first iterator for trees 2017-12-07 10:07:56 -05:00
type_manager.cpp Fixing bugs in type manager memory management 2017-12-21 08:59:06 -05:00
type_manager.h Fixing bugs in type manager memory management 2017-12-21 08:59:06 -05:00
types.cpp Improving the usability of the type manager. The type manager hashes 2017-12-18 08:20:56 -05:00
types.h Improving the usability of the type manager. The type manager hashes 2017-12-18 08:20:56 -05:00
unify_const_pass.cpp Change IRContext::KillInst to delete instructions. 2017-12-04 11:07:45 -05:00
unify_const_pass.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
value_number_table.cpp Add global redundancy elimination 2017-12-07 18:35:38 -05:00
value_number_table.h Add global redundancy elimination 2017-12-07 18:35:38 -05:00