Home | History | Annotate | Download | only in opt

Lines Matching refs:consumer

26 // consumer and exits the problem with failure code. Accepts the following
29 // SPIRV_ASSERT(<message-consumer>, <condition-expression>);
30 // SPIRV_ASSERT(<message-consumer>, <condition-expression>, <message>);
31 // SPIRV_ASSERT(<message-consumer>, <condition-expression>,
37 #define SPIRV_ASSERT(consumer, ...) SPIRV_ASSERT_IMPL(consumer, __VA_ARGS__)
39 #define SPIRV_ASSERT(consumer, ...)
42 // Logs a debug message to the consumer. Accepts the following formats:
44 // SPIRV_DEBUG(<message-consumer>, <message>);
45 // SPIRV_DEBUG(<message-consumer>, <message-format>, <variable-arguments>);
50 #define SPIRV_DEBUG(consumer, ...) SPIRV_DEBUG_IMPL(consumer, __VA_ARGS__)
52 #define SPIRV_DEBUG(consumer, ...)
55 // Logs an error message to the consumer saying the given feature is
57 #define SPIRV_UNIMPLEMENTED(consumer, feature) \
59 spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \
63 // Logs an error message to the consumer saying the code location
65 #define SPIRV_UNREACHABLE(consumer) \
67 spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \
80 // Calls the given |consumer| by supplying the |message|. The |message| is from
82 inline void Log(const MessageConsumer& consumer, spv_message_level_t level,
85 if (consumer != nullptr) consumer(level, source, position, message);
88 // Calls the given |consumer| by supplying the message composed according to the
92 void Logf(const MessageConsumer& consumer, spv_message_level_t level,
107 Log(consumer, level, source, position, message);
118 Log(consumer, level, source, position, longer_message.data());
122 Log(consumer, level, source, position, "cannot compose log message");
129 // Calls the given |consumer| by supplying the given error |message|. The
131 inline void Error(const MessageConsumer& consumer, const char* source,
133 Log(consumer, SPV_MSG_ERROR, source, position, message);
136 // Calls the given |consumer| by supplying the error message composed according
140 inline void Errorf(const MessageConsumer& consumer, const char* source,
143 Logf(consumer, SPV_MSG_ERROR, source, position, format,
149 #define SPIRV_ASSERT_IMPL(consumer, ...) \
151 consumer, __VA_ARGS__))
153 #define SPIRV_DEBUG_IMPL(consumer, ...) \
155 consumer, __VA_ARGS__))
157 #define SPIRV_ASSERT_1(consumer, condition) \
160 spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \
166 #define SPIRV_ASSERT_2(consumer, condition, message) \
169 spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \
175 #define SPIRV_ASSERT_more(consumer, condition, format, ...) \
178 spvtools::Logf(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \
185 #define SPIRV_ASSERT_3(consumer, condition, format, ...) \
186 SPIRV_ASSERT_more(consumer, condition, format, __VA_ARGS__)
188 #define SPIRV_ASSERT_4(consumer, condition, format, ...) \
189 SPIRV_ASSERT_more(consumer, condition, format, __VA_ARGS__)
191 #define SPIRV_ASSERT_5(consumer, condition, format, ...) \
192 SPIRV_ASSERT_more(consumer, condition, format, __VA_ARGS__)
194 #define SPIRV_DEBUG_1(consumer, message) \
196 spvtools::Log(consumer, SPV_MSG_DEBUG, __FILE__, {__LINE__, 0, 0}, \
200 #define SPIRV_DEBUG_more(consumer, format, ...) \
202 spvtools::Logf(consumer, SPV_MSG_DEBUG, __FILE__, {__LINE__, 0, 0}, \
206 #define SPIRV_DEBUG_2(consumer, format, ...) \
207 SPIRV_DEBUG_more(consumer, format, __VA_ARGS__)
209 #define SPIRV_DEBUG_3(consumer, format, ...) \
210 SPIRV_DEBUG_more(consumer, format, __VA_ARGS__)
212 #define SPIRV_DEBUG_4(consumer, format, ...) \
213 SPIRV_DEBUG_more(consumer, format, __VA_ARGS__)
215 #define SPIRV_DEBUG_5(consumer, format, ...) \
216 SPIRV_DEBUG_more(consumer, format, __VA_ARGS__)