• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 The Tint Authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SRC_WRITER_SPIRV_SPV_DUMP_H_
16 #define SRC_WRITER_SPIRV_SPV_DUMP_H_
17 
18 #include <string>
19 #include <vector>
20 
21 #include "src/writer/spirv/builder.h"
22 
23 namespace tint {
24 namespace writer {
25 namespace spirv {
26 
27 /// Dumps the given builder to a SPIR-V disassembly string
28 /// @param builder the builder to convert
29 /// @returns the builder as a SPIR-V disassembly string
30 std::string DumpBuilder(Builder& builder);
31 
32 /// Dumps the given instruction to a SPIR-V disassembly string
33 /// @param inst the instruction to dump
34 /// @returns the instruction as a SPIR-V disassembly string
35 std::string DumpInstruction(const Instruction& inst);
36 
37 /// Dumps the given instructions to a SPIR-V disassembly string
38 /// @param insts the instructions to dump
39 /// @returns the instruction as a SPIR-V disassembly string
40 std::string DumpInstructions(const InstructionList& insts);
41 
42 }  // namespace spirv
43 }  // namespace writer
44 }  // namespace tint
45 
46 #endif  // SRC_WRITER_SPIRV_SPV_DUMP_H_
47