Skip to content

Commit b113211

Browse files
committed
Define away PROF_ERR etc.
Simplifies uses a bit.
1 parent 250108b commit b113211

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

compiler-rt/lib/profile/InstrProfilingMerge.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,9 @@ COMPILER_RT_VISIBILITY
130130
int __llvm_profile_merge_from_buffer(const char *ProfileData,
131131
uint64_t ProfileSize) {
132132
if (__llvm_profile_get_version() & VARIANT_MASK_TEMPORAL_PROF) {
133-
#ifndef COMPILER_RT_PROFILE_BAREMETAL
134133
PROF_ERR("%s\n",
135134
"Temporal profiles do not support profile merging at runtime. "
136135
"Instead, merge raw profiles using the llvm-profdata tool.");
137-
#endif
138136
return 1;
139137
}
140138

compiler-rt/lib/profile/InstrProfilingPort.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ static inline size_t getpagesize(void) {
122122
#endif
123123
#endif /* defined(_WIN32) */
124124

125+
#ifdef COMPILER_RT_PROFILE_BAREMETAL
126+
// Baremetal doesn't support logging
127+
#define PROF_ERR(Format, ...)
128+
#define PROF_WARN(Format, ...)
129+
#define PROF_NOTE(Format, ...)
130+
#else
125131
#define PROF_ERR(Format, ...) \
126132
fprintf(stderr, "LLVM Profile Error: " Format, __VA_ARGS__);
127133

@@ -130,6 +136,7 @@ static inline size_t getpagesize(void) {
130136

131137
#define PROF_NOTE(Format, ...) \
132138
fprintf(stderr, "LLVM Profile Note: " Format, __VA_ARGS__);
139+
#endif /* COMPILER_RT_PROFILE_BAREMETAL */
133140

134141
#ifndef MAP_FILE
135142
#define MAP_FILE 0

0 commit comments

Comments
 (0)