mirror of
https://gitee.com/openharmony/third_party_spirv-tools
synced 2024-11-23 15:30:36 +00:00
Add two more utility functions for sending errors to consumer.
This commit is contained in:
parent
74afb5d112
commit
3767e32b1f
@ -123,6 +123,24 @@ void Logf(const MessageConsumer& consumer, spv_message_level_t level,
|
||||
#endif
|
||||
}
|
||||
|
||||
// Calls the given |consumer| by supplying the given error |message|. The
|
||||
// |message| is from the given |source| and |location|.
|
||||
inline void Error(const MessageConsumer& consumer, const char* source,
|
||||
const spv_position_t& position, const char* message) {
|
||||
Log(consumer, SPV_MSG_ERROR, source, position, message);
|
||||
}
|
||||
|
||||
// Calls the given |consumer| by supplying the error message composed according
|
||||
// to the given |format|. The |message| is from the given |source| and
|
||||
// |location|.
|
||||
template <typename... Args>
|
||||
inline void Errorf(const MessageConsumer& consumer, const char* source,
|
||||
const spv_position_t& position, const char* format,
|
||||
Args&&... args) {
|
||||
Logf(consumer, SPV_MSG_ERROR, source, position, format,
|
||||
std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
} // namespace spvtools
|
||||
|
||||
#define SPIRV_ASSERT_IMPL(consumer, ...) \
|
||||
|
Loading…
Reference in New Issue
Block a user