[runtime] Improve unrecognized-selector error message for pure-Swift classes.

Swift SVN r20577
This commit is contained in:
Greg Parker
2014-07-25 23:42:29 +00:00
parent 92637e786b
commit dc407c6235
3 changed files with 32 additions and 1 deletions

View File

@@ -22,6 +22,7 @@
#include <pthread.h>
#include <malloc/malloc.h>
#include <asl.h>
#include "Debug.h"
#if SWIFT_HAVE_CRASHREPORTERCLIENT
@@ -70,6 +71,24 @@ reportNow(const char *message)
}
// Report a fatal error to system console, stderr, and crash logs, then abort.
LLVM_ATTRIBUTE_NORETURN
void
swift::fatalError(const char *format, ...)
{
va_list args;
va_start(args, format);
char *log;
vasprintf(&log, format, args);
reportNow(log);
reportOnCrash(log);
abort();
}
// Report a fatal error to system console, stderr, and crash logs.
// <prefix>: <message>: file <file>, line <line>\n
// The message may be omitted by passing messageLength=0.