aboutsummaryrefslogtreecommitdiff
path: root/source/validate.h
diff options
context:
space:
mode:
authorLei Zhang <antiagainst@google.com>2016-09-02 18:06:18 -0400
committerLei Zhang <antiagainst@google.com>2016-09-15 12:35:48 -0400
commit755f97f534153519e15636502f1e2d6f4f48cda6 (patch)
tree254ddf2d9b250035b7da5c458050f4b4d02ca6fc /source/validate.h
parente0dd0334143cb31b1b563704fe3001d11a506a95 (diff)
downloadspirv-tools-755f97f534153519e15636502f1e2d6f4f48cda6.tar.gz
Add a callback mechanism for communicating messages to callers.
Every time an event happens in the library that the user should be aware of, the callback will be invoked. The existing diagnostic mechanism is hijacked internally by a callback that creates an diagnostic object each time an event happens.
Diffstat (limited to 'source/validate.h')
-rw-r--r--source/validate.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/validate.h b/source/validate.h
index 2ef341a4..a19e911a 100644
--- a/source/validate.h
+++ b/source/validate.h
@@ -20,6 +20,7 @@
#include <vector>
#include "instruction.h"
+#include "message.h"
#include "spirv-tools/libspirv.h"
#include "table.h"
@@ -154,7 +155,6 @@ spv_result_t InstructionPass(ValidationState_t& _,
/// @param[in] operandTable table of specified operands
/// @param[in] usedefs use-def info from module parsing
/// @param[in,out] position current position in the stream
-/// @param[out] pDiag contains diagnostic on failure
///
/// @return result code
spv_result_t spvValidateInstructionIDs(const spv_instruction_t* pInsts,
@@ -163,8 +163,7 @@ spv_result_t spvValidateInstructionIDs(const spv_instruction_t* pInsts,
const spv_operand_table operandTable,
const spv_ext_inst_table extInstTable,
const libspirv::ValidationState_t& state,
- spv_position position,
- spv_diagnostic* pDiag);
+ spv_position position);
/// @brief Validate the ID's within a SPIR-V binary
///
@@ -174,7 +173,7 @@ spv_result_t spvValidateInstructionIDs(const spv_instruction_t* pInsts,
/// @param[in] opcodeTable table of specified Opcodes
/// @param[in] operandTable table of specified operands
/// @param[in,out] position current word in the binary
-/// @param[out] pDiagnostic contains diagnostic on failure
+/// @param[in] consumer message consumer callback
///
/// @return result code
spv_result_t spvValidateIDs(const spv_instruction_t* pInstructions,
@@ -182,6 +181,7 @@ spv_result_t spvValidateIDs(const spv_instruction_t* pInstructions,
const spv_opcode_table opcodeTable,
const spv_operand_table operandTable,
const spv_ext_inst_table extInstTable,
- spv_position position, spv_diagnostic* pDiagnostic);
+ spv_position position,
+ const spvtools::MessageConsumer& consumer);
#endif // LIBSPIRV_VALIDATE_H_