Add the IRContext (part 1)
authorSteven Perron <stevenperron@google.com>
Mon, 30 Oct 2017 15:13:24 +0000 (11:13 -0400)
committerSteven Perron <stevenperron@google.com>
Tue, 31 Oct 2017 17:46:05 +0000 (13:46 -0400)
commit476cae6f7d415d03d607265cd1e8267e66be9f35
tree413641c721a1295b53f2c62a089ac09638fb0d56
parentd861ceffd41d72f5eccc345eced950d649ff8a85
Add the IRContext (part 1)

This is the first part of adding the IRContext.  This class is meant to
hold the extra data that is build on top of the module that it
owns.

The first part will simply create the IRContext class and get it passed
to the passes in place of the module.  For now it does not have any
functionality of its own, but it acts more as a wrapper for the module.

The functions that I added to the IRContext are those that either
traverse the headers or add to them.  I did this because we may decide
to have other ways of dealing with these sections (for example adding a
type pool, or use the decoration manager).

I also added the function that add to the header because the IRContext
needs to know when an instruction is added to update other data
structures appropriately.

Note that there is still lots of work that needs to be done.  There are
still many places that change the module, and do not inform the context.
That will be the next step.
66 files changed:
source/link/linker.cpp
source/opt/CMakeLists.txt
source/opt/aggressive_dead_code_elim_pass.cpp
source/opt/aggressive_dead_code_elim_pass.h
source/opt/block_merge_pass.cpp
source/opt/block_merge_pass.h
source/opt/cfg_cleanup_pass.cpp
source/opt/cfg_cleanup_pass.h
source/opt/common_uniform_elim_pass.cpp
source/opt/common_uniform_elim_pass.h
source/opt/compact_ids_pass.cpp
source/opt/compact_ids_pass.h
source/opt/dead_branch_elim_pass.cpp
source/opt/dead_branch_elim_pass.h
source/opt/dead_variable_elimination.cpp
source/opt/dead_variable_elimination.h
source/opt/eliminate_dead_constant_pass.cpp
source/opt/eliminate_dead_constant_pass.h
source/opt/eliminate_dead_functions_pass.cpp
source/opt/eliminate_dead_functions_pass.h
source/opt/flatten_decoration_pass.cpp
source/opt/flatten_decoration_pass.h
source/opt/fold_spec_constant_op_and_composite_pass.cpp
source/opt/fold_spec_constant_op_and_composite_pass.h
source/opt/freeze_spec_constant_value_pass.cpp
source/opt/freeze_spec_constant_value_pass.h
source/opt/inline_exhaustive_pass.cpp
source/opt/inline_exhaustive_pass.h
source/opt/inline_opaque_pass.cpp
source/opt/inline_opaque_pass.h
source/opt/inline_pass.cpp
source/opt/inline_pass.h
source/opt/insert_extract_elim.cpp
source/opt/insert_extract_elim.h
source/opt/ir_context.cpp [new file with mode: 0644]
source/opt/ir_context.h [new file with mode: 0644]
source/opt/local_access_chain_convert_pass.cpp
source/opt/local_access_chain_convert_pass.h
source/opt/local_single_block_elim_pass.cpp
source/opt/local_single_block_elim_pass.h
source/opt/local_single_store_elim_pass.cpp
source/opt/local_single_store_elim_pass.h
source/opt/local_ssa_elim_pass.cpp
source/opt/local_ssa_elim_pass.h
source/opt/mem_pass.cpp
source/opt/mem_pass.h
source/opt/null_pass.h
source/opt/optimizer.cpp
source/opt/pass.cpp
source/opt/pass.h
source/opt/pass_manager.cpp
source/opt/pass_manager.h
source/opt/remove_duplicates_pass.cpp
source/opt/remove_duplicates_pass.h
source/opt/set_spec_constant_default_value_pass.cpp
source/opt/set_spec_constant_default_value_pass.h
source/opt/strength_reduction_pass.cpp
source/opt/strength_reduction_pass.h
source/opt/strip_debug_info_pass.cpp
source/opt/strip_debug_info_pass.h
source/opt/unify_const_pass.cpp
source/opt/unify_const_pass.h
test/opt/line_debug_info_test.cpp
test/opt/pass_fixture.h
test/opt/pass_manager_test.cpp
test/opt/pass_test.cpp