working on rewriting SPIR-V to LLVM IR translation code
authorJacob Lifshay <programmerjake@gmail.com>
Sun, 22 Oct 2017 08:56:37 +0000 (01:56 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Sun, 22 Oct 2017 08:56:37 +0000 (01:56 -0700)
commit6e48c7591a7e86f97bd9b05a199558530004362c
tree4b18d4a264e3f863b0f765f173d64bdb7ee14262
parent46d4bf1ef1060130950c5e9dcf006a57a7c6fb81
working on rewriting SPIR-V to LLVM IR translation code

The old code was a giant mess, so, I'm hoping to organize the new code into different SPIR-V facets.
I'm planning on ending up with a class diagram like this:
         spirv::Parser_callbacks
                 |
                 v
         Parser_callbacks_base
          |      |          |
   +------+      |          +-------------------------+
   |             |                                    |
   |             +--------------+                     |
   | virtual                    | virtual             | virtual
   v                            v                     v
Parser_header_callbacks Parser_debug_callbacks ... <other>
   |                            |                     |
   |             +--------------+                     |
   |             |                                    |
   +------+      |         +--------------------------+
          |      |         |
          v      v         v
        Parser_callbacks_implementation

where each intermediate class implements a facet of
SPIR-V parsing/translation.

So, Parser_header_callbacks implements the handle_header() function,
Parser_debug_callbacks implements the source-level debug instructions,
and the rest of the intermediate classes implement the rest of the
instructions. Parser_callbacks_implementation just serves to combine
them all into one non-abstract type.

Using virtual inheritence shouldn't affect the compilation speed appreciably
because most of the compilation time should be spent by LLVM's optimization
passes and by LLVM's code generation back-end.
src/pipeline/pipeline.h
src/spirv_to_llvm/CMakeLists.txt
src/spirv_to_llvm/debug_info.cpp [new file with mode: 0644]
src/spirv_to_llvm/debug_info.h [new file with mode: 0644]
src/spirv_to_llvm/spirv_id.h [new file with mode: 0644]
src/spirv_to_llvm/spirv_to_llvm.h
src/spirv_to_llvm/spirv_to_llvm_implementation.h [deleted file]
src/spirv_to_llvm/stages.h [new file with mode: 0644]
src/spirv_to_llvm/translator.cpp [new file with mode: 0644]
src/spirv_to_llvm/translator.h [new file with mode: 0644]
src/vulkan/api_objects.h