Add a callback mechanism for communicating messages to callers.
authorLei Zhang <antiagainst@google.com>
Fri, 2 Sep 2016 22:06:18 +0000 (18:06 -0400)
committerLei Zhang <antiagainst@google.com>
Thu, 15 Sep 2016 16:35:48 +0000 (12:35 -0400)
commit755f97f534153519e15636502f1e2d6f4f48cda6
tree254ddf2d9b250035b7da5c458050f4b4d02ca6fc
parente0dd0334143cb31b1b563704fe3001d11a506a95
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.
25 files changed:
include/spirv-tools/libspirv.h
source/binary.cpp
source/diagnostic.cpp
source/diagnostic.h
source/disassemble.cpp
source/message.h [new file with mode: 0644]
source/opt/libspirv.cpp
source/opt/libspirv.hpp
source/table.cpp
source/table.h
source/text.cpp
source/text_handler.h
source/val/ValidationState.cpp
source/val/ValidationState.h
source/validate.cpp
source/validate.h
source/validate_id.cpp
test/BinaryParse.cpp
test/BinaryToText.cpp
test/CMakeLists.txt
test/TextLiteral.cpp
test/TextToBinary.cpp
test/c_interface.cpp [new file with mode: 0644]
test/diagnostic.cpp
test/val/ValidationState.cpp