blob: 2d6bafd68264106811709d3926414a91e327cb03 [file] [log] [blame]
// Copyright 2020 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SRC_TINT_LANG_SPIRV_WRITER_SPV_DUMP_H_
#define SRC_TINT_LANG_SPIRV_WRITER_SPV_DUMP_H_
#include <string>
#include <vector>
#include "src/tint/lang/spirv/writer/module.h"
namespace tint::spirv::writer {
/// Disassembles SPIR-V binary data into its textual form.
/// @param data the SPIR-V binary data
/// @param options the additional SPIR-V disassembler options to use
/// @returns the disassembled SPIR-V string
std::string Disassemble(const std::vector<uint32_t>& data, uint32_t options = 0u);
/// Dumps the given module to a SPIR-V disassembly string
/// @param module the module to convert
/// @returns the module as a SPIR-V disassembly string
std::string DumpModule(Module& module);
/// Dumps the given instruction to a SPIR-V disassembly string
/// @param inst the instruction to dump
/// @returns the instruction as a SPIR-V disassembly string
std::string DumpInstruction(const Instruction& inst);
/// Dumps the given instructions to a SPIR-V disassembly string
/// @param insts the instructions to dump
/// @returns the instruction as a SPIR-V disassembly string
std::string DumpInstructions(const InstructionList& insts);
} // namespace tint::spirv::writer
#endif // SRC_TINT_LANG_SPIRV_WRITER_SPV_DUMP_H_