disassemble.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright (c) 2018 Google Inc.
  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. #ifndef SOURCE_DISASSEMBLE_H_
  15. #define SOURCE_DISASSEMBLE_H_
  16. #include <string>
  17. #include "spirv-tools/libspirv.h"
  18. namespace spvtools {
  19. // Decodes the given SPIR-V instruction binary representation to its assembly
  20. // text. The context is inferred from the provided module binary. The options
  21. // parameter is a bit field of spv_binary_to_text_options_t. Decoded text will
  22. // be stored into *text. Any error will be written into *diagnostic if
  23. // diagnostic is non-null.
  24. std::string spvInstructionBinaryToText(const spv_target_env env,
  25. const uint32_t* inst_binary,
  26. const size_t inst_word_count,
  27. const uint32_t* binary,
  28. const size_t word_count,
  29. const uint32_t options);
  30. } // namespace spvtools
  31. #endif // SOURCE_DISASSEMBLE_H_