Commit Graph

7 Commits

Author SHA1 Message Date
Lei Zhang
dc6e4834d6 Clean up header dependency. 2016-09-22 18:15:23 -04:00
Lei Zhang
1ca817a38e Use nullptr as the default message consumer to ignore all messages.
There is no difference between the previous IgnoreMessage() function
and a null std::function, from functionality's perspective.
The user can set nullptr as the MessageConsumer, so need to guard
against nullptr before calling the consumer anyway. It's better
we use it internally so that it may expose problems by us instead
of the user.
2016-09-21 17:23:03 -04:00
Lei Zhang
620f05e679 Publish the C++ interface. 2016-09-21 14:41:47 -04:00
Lei Zhang
6849a3cefd Use C style names for MessageLevel. 2016-09-21 12:44:37 -04:00
Lei Zhang
80eb0793c9 Change to use enum instead of enum class for MessageLevel.
This allows us to create C interface with MessageLevel later.
2016-09-21 11:30:41 -04:00
Lei Zhang
114af21994 Add MessageConsumer to PassManager, Pass, and analysis interfaces.
Also convert some uses of assert() in optimization code to use
SPIRV_ASSERT(), SPIRV_UNIMPLEMENTED(), or SPIRV_UNREACHABLE()
accordingly.
2016-09-16 13:14:57 -04:00
Lei Zhang
755f97f534 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.
2016-09-15 12:35:48 -04:00