mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Make runtime warnings about missing metadata more descriptive.
Describe the consequences of missing metadata instead of just posting a scary message about a bug. Furthermore, since these warnings tend to show up in playgrounds, and probably aren't relevant to the user of a playground, suppress them when running in a playground. rdar://problem/44642942
This commit is contained in:
@@ -352,22 +352,29 @@ swift::fatalError(uint32_t flags, const char *format, ...)
|
||||
|
||||
// Report a warning to system console and stderr.
|
||||
void
|
||||
swift::warning(uint32_t flags, const char *format, ...)
|
||||
swift::warningv(uint32_t flags, const char *format, va_list args)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
char *log;
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wuninitialized"
|
||||
swift_vasprintf(&log, format, args);
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
|
||||
reportNow(flags, log);
|
||||
|
||||
|
||||
free(log);
|
||||
}
|
||||
|
||||
// Report a warning to system console and stderr.
|
||||
void
|
||||
swift::warning(uint32_t flags, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
warningv(flags, format, args);
|
||||
}
|
||||
|
||||
// Crash when a deleted method is called by accident.
|
||||
SWIFT_RUNTIME_EXPORT
|
||||
LLVM_ATTRIBUTE_NORETURN
|
||||
|
||||
Reference in New Issue
Block a user