[compiler-rt] r243480 - [sanitizer] Fix Mac build.
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Tue Jul 28 14:01:43 PDT 2015
Author: eugenis
Date: Tue Jul 28 16:01:42 2015
New Revision: 243480
URL: http://llvm.org/viewvc/llvm-project?rev=243480&view=rev
Log:
[sanitizer] Fix Mac build.
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc?rev=243480&r1=243479&r2=243480&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc Tue Jul 28 16:01:42 2015
@@ -351,6 +351,17 @@ const char *GetProcessName() {
return process_name_cache_str;
}
+static uptr ReadProcessName(/*out*/ char *buf, uptr buf_len) {
+ ReadLongProcessName(buf, buf_len);
+ char *s = const_cast<char *>(StripModuleName(buf));
+ uptr len = internal_strlen(s);
+ if (s != buf) {
+ internal_memmove(buf, s, len);
+ buf[len] = '\0';
+ }
+ return len;
+}
+
void UpdateProcessName() {
ReadProcessName(process_name_cache_str, sizeof(process_name_cache_str));
}
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h?rev=243480&r1=243479&r2=243480&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h Tue Jul 28 16:01:42 2015
@@ -251,7 +251,7 @@ const char *StripModuleName(const char *
// OS
uptr ReadBinaryName(/*out*/char *buf, uptr buf_len);
uptr ReadBinaryNameCached(/*out*/char *buf, uptr buf_len);
-uptr ReadProcessName(/*out*/char *buf, uptr buf_len);
+uptr ReadLongProcessName(/*out*/ char *buf, uptr buf_len);
const char *GetProcessName();
void UpdateProcessName();
void CacheBinaryName();
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=243480&r1=243479&r2=243480&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Tue Jul 28 16:01:42 2015
@@ -730,7 +730,7 @@ uptr ReadBinaryName(/*out*/char *buf, up
return module_name_len;
}
-static uptr ReadLongProcessName(/*out*/ char *buf, uptr buf_len) {
+uptr ReadLongProcessName(/*out*/ char *buf, uptr buf_len) {
#if SANITIZER_LINUX
char *tmpbuf;
uptr tmpsize;
@@ -745,17 +745,6 @@ static uptr ReadLongProcessName(/*out*/
return ReadBinaryName(buf, buf_len);
}
-uptr ReadProcessName(/*out*/ char *buf, uptr buf_len) {
- ReadLongProcessName(buf, buf_len);
- char *s = const_cast<char *>(StripModuleName(buf));
- uptr len = internal_strlen(s);
- if (s != buf) {
- internal_memmove(buf, s, len);
- buf[len] = '\0';
- }
- return len;
-}
-
// Match full names of the form /path/to/base_name{-,.}*
bool LibraryNameIs(const char *full_name, const char *base_name) {
const char *name = full_name;
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc?rev=243480&r1=243479&r2=243480&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc Tue Jul 28 16:01:42 2015
@@ -241,6 +241,10 @@ uptr ReadBinaryName(/*out*/char *buf, up
return 0;
}
+uptr ReadLongProcessName(/*out*/char *buf, uptr buf_len) {
+ return ReadBinaryName(buf, buf_len);
+}
+
void ReExec() {
UNIMPLEMENTED();
}
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc?rev=243480&r1=243479&r2=243480&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc Tue Jul 28 16:01:42 2015
@@ -665,6 +665,10 @@ uptr ReadBinaryName(/*out*/char *buf, up
return 0;
}
+uptr ReadLongProcessName(/*out*/char *buf, uptr buf_len) {
+ return ReadBinaryName(buf, buf_len);
+}
+
} // namespace __sanitizer
#endif // _WIN32
More information about the llvm-commits
mailing list