diff options
author | dim <dim@FreeBSD.org> | 2015-02-22 22:31:36 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-02-22 22:31:36 +0000 |
commit | 64036a7c35233ad0f5289d81af95a2b7023eee7e (patch) | |
tree | c80ef9cb2d1e54757027bc3e1b32b98c01ad850c /contrib/compiler-rt/lib/profile/InstrProfilingFile.c | |
parent | 62a5f71b46f317b1666b2f5240bdb30f0c2a2b98 (diff) | |
parent | 5c652b16dfa55fef6d0953359e6e8f6933ee3a0f (diff) | |
download | FreeBSD-src-64036a7c35233ad0f5289d81af95a2b7023eee7e.zip FreeBSD-src-64036a7c35233ad0f5289d81af95a2b7023eee7e.tar.gz |
Update compiler-rt to trunk r228651. This enables using Address
Sanitizer and Undefined Behavior Sanitizer with clang 3.6.0.
Diffstat (limited to 'contrib/compiler-rt/lib/profile/InstrProfilingFile.c')
-rw-r--r-- | contrib/compiler-rt/lib/profile/InstrProfilingFile.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/compiler-rt/lib/profile/InstrProfilingFile.c b/contrib/compiler-rt/lib/profile/InstrProfilingFile.c index 5aef390..346665f 100644 --- a/contrib/compiler-rt/lib/profile/InstrProfilingFile.c +++ b/contrib/compiler-rt/lib/profile/InstrProfilingFile.c @@ -11,6 +11,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <sys/errno.h> #define UNCONST(ptr) ((void *)(uintptr_t)(ptr)) @@ -175,7 +176,11 @@ int __llvm_profile_write_file(void) { return -1; /* Write the file. */ - return writeFileWithName(__llvm_profile_CurrentFilename); + int rc = writeFileWithName(__llvm_profile_CurrentFilename); + if (rc && getenv("LLVM_PROFILE_VERBOSE_ERRORS")) + fprintf(stderr, "LLVM Profile: Failed to write file \"%s\": %s\n", + __llvm_profile_CurrentFilename, strerror(errno)); + return rc; } static void writeFileWithoutReturn(void) { |