summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/lib/profile/InstrProfilingFile.c4
-rw-r--r--compiler-rt/lib/profile/InstrProfilingPort.h7
-rw-r--r--compiler-rt/lib/profile/InstrProfilingRuntime.cc3
3 files changed, 8 insertions, 6 deletions
diff --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c
index 4fc7693345b..ac0eeff6bda 100644
--- a/compiler-rt/lib/profile/InstrProfilingFile.c
+++ b/compiler-rt/lib/profile/InstrProfilingFile.c
@@ -56,8 +56,8 @@ static int writeFileWithName(const char *OutputName) {
return RetVal;
}
-__attribute__((weak)) int __llvm_profile_OwnsFilename = 0;
-__attribute__((weak)) const char *__llvm_profile_CurrentFilename = NULL;
+LLVM_LIBRARY_WEAK int __llvm_profile_OwnsFilename = 0;
+LLVM_LIBRARY_WEAK const char *__llvm_profile_CurrentFilename = NULL;
static void truncateCurrentFile(void) {
const char *Filename;
diff --git a/compiler-rt/lib/profile/InstrProfilingPort.h b/compiler-rt/lib/profile/InstrProfilingPort.h
index 977dc63f747..12f5ca78e83 100644
--- a/compiler-rt/lib/profile/InstrProfilingPort.h
+++ b/compiler-rt/lib/profile/InstrProfilingPort.h
@@ -11,12 +11,15 @@
#define PROFILE_INSTRPROFILING_PORT_H_
#ifdef _MSC_VER
-# define LLVM_ALIGNAS(x) __declspec(align(x))
+#define LLVM_ALIGNAS(x) __declspec(align(x))
+#define LLVM_LIBRARY_VISIBILITY
+#define LLVM_LIBRARY_WEAK __declspec(selectany)
#elif __GNUC__
#define LLVM_ALIGNAS(x) __attribute__((aligned(x)))
+#define LLVM_LIBRARY_VISIBILITY __attribute__((visibility("hidden")))
+#define LLVM_LIBRARY_WEAK __attribute__((weak))
#endif
-#define LLVM_LIBRARY_VISIBILITY __attribute__((visibility("hidden")))
#define LLVM_SECTION(Sect) __attribute__((section(Sect)))
#define PROF_ERR(Format, ...) \
diff --git a/compiler-rt/lib/profile/InstrProfilingRuntime.cc b/compiler-rt/lib/profile/InstrProfilingRuntime.cc
index 081ecb29e98..77fca472a62 100644
--- a/compiler-rt/lib/profile/InstrProfilingRuntime.cc
+++ b/compiler-rt/lib/profile/InstrProfilingRuntime.cc
@@ -11,8 +11,7 @@ extern "C" {
#include "InstrProfiling.h"
-__attribute__((visibility("hidden"))) int __llvm_profile_runtime;
-
+LLVM_LIBRARY_VISIBILITY int __llvm_profile_runtime;
}
namespace {
OpenPOWER on IntegriCloud