Skip to content

Commit 987eeeb

Browse files
author
Wael Yehia
committed
define COMPILER_RT_UNUSED
1 parent 04d66b2 commit 987eeeb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compiler-rt/lib/profile/InstrProfilingPort.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define COMPILER_RT_FTRUNCATE(f,l) _chsize(_fileno(f),l)
2424
#define COMPILER_RT_ALWAYS_INLINE __forceinline
2525
#define COMPILER_RT_CLEANUP(x)
26+
#define COMPILER_RT_UNUSED
2627
#define COMPILER_RT_USED
2728
#elif __GNUC__
2829
#ifdef _WIN32
@@ -38,6 +39,7 @@
3839
#define COMPILER_RT_ALLOCA __builtin_alloca
3940
#define COMPILER_RT_ALWAYS_INLINE inline __attribute((always_inline))
4041
#define COMPILER_RT_CLEANUP(x) __attribute__((cleanup(x)))
42+
#define COMPILER_RT_UNUSED __attribute__((unused))
4143
#define COMPILER_RT_USED __attribute__((used))
4244
#endif
4345

compiler-rt/lib/profile/InstrProfilingUtil.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ COMPILER_RT_VISIBILITY FILE *lprofOpenFileEx(const char *ProfileName) {
269269

270270
// Return 1 (true) if the file descriptor Fd represents a file that is on a
271271
// local filesystem, otherwise return 0.
272-
static int is_local_filesystem(int Fd) {
272+
COMPILER_RT_UNUSED static int is_local_filesystem(int Fd) {
273273
#if defined(_AIX)
274274
struct statfs Vfs;
275275
if (fstatfs(Fd, &Vfs) != 0) {
@@ -317,7 +317,6 @@ static int is_local_filesystem(int Fd) {
317317
static int isMmapSafe(int Fd) {
318318
if (getenv("LLVM_NO_MMAP")) // For testing purposes.
319319
return 0;
320-
(void)&is_local_filesystem; // a fake reference to satisfy -Wunused-function
321320
#ifdef _AIX
322321
return is_local_filesystem(Fd);
323322
#else

0 commit comments

Comments
 (0)