Alphan Ulusoy | 95fb5d4 | 2023-01-04 12:37:12 -0500 | [diff] [blame] | 1 | diff --git a/lib/profile/InstrProfiling.c b/lib/profile/InstrProfiling.c |
| 2 | index 6df65f66d..5d20a762f 100644 |
| 3 | --- a/lib/profile/InstrProfiling.c |
| 4 | +++ b/lib/profile/InstrProfiling.c |
| 5 | @@ -10,12 +10,10 @@ |
| 6 | // with freestanding compilation. See `darwin_add_builtin_libraries`. |
| 7 | |
| 8 | #include <limits.h> |
| 9 | -#include <stdio.h> |
| 10 | -#include <stdlib.h> |
| 11 | -#include <string.h> |
| 12 | |
| 13 | #include "InstrProfiling.h" |
| 14 | #include "InstrProfilingInternal.h" |
| 15 | +#include "sw/device/lib/base/memory.h" |
| 16 | |
| 17 | #define INSTR_PROF_VALUE_PROF_DATA |
| 18 | #include "profile/InstrProfData.inc" |
| 19 | diff --git a/lib/profile/InstrProfiling.h b/lib/profile/InstrProfiling.h |
| 20 | index 237acb33f..9e37253b3 100644 |
| 21 | --- a/lib/profile/InstrProfiling.h |
| 22 | +++ b/lib/profile/InstrProfiling.h |
| 23 | @@ -10,7 +10,6 @@ |
| 24 | #define PROFILE_INSTRPROFILING_H_ |
| 25 | |
| 26 | #include "InstrProfilingPort.h" |
| 27 | -#include <stdio.h> |
| 28 | |
| 29 | #define INSTR_PROF_VISIBILITY COMPILER_RT_VISIBILITY |
| 30 | #include "profile/InstrProfData.inc" |
| 31 | @@ -219,7 +218,6 @@ void __llvm_profile_set_filename(const char *Name); |
| 32 | * program initialization time. Support for transferring the mmap'd profile |
| 33 | * counts to a new file has not been implemented. |
| 34 | */ |
| 35 | -void __llvm_profile_set_file_object(FILE *File, int EnableMerge); |
| 36 | |
| 37 | /*! \brief Register to write instrumentation data to file at exit. */ |
| 38 | int __llvm_profile_register_write_file_atexit(void); |
| 39 | diff --git a/lib/profile/InstrProfilingMerge.c b/lib/profile/InstrProfilingMerge.c |
| 40 | index 16ebc2f8b..9ef47a06d 100644 |
| 41 | --- a/lib/profile/InstrProfilingMerge.c |
| 42 | +++ b/lib/profile/InstrProfilingMerge.c |
| 43 | @@ -11,7 +11,6 @@ |
| 44 | |
| 45 | #include "InstrProfiling.h" |
| 46 | #include "InstrProfilingInternal.h" |
| 47 | -#include "InstrProfilingUtil.h" |
| 48 | |
| 49 | #define INSTR_PROF_VALUE_PROF_DATA |
| 50 | #include "profile/InstrProfData.inc" |
| 51 | diff --git a/lib/profile/InstrProfilingPlatformOther.c b/lib/profile/InstrProfilingPlatformOther.c |
| 52 | index 0e59148e2..4fd2a5170 100644 |
| 53 | --- a/lib/profile/InstrProfilingPlatformOther.c |
| 54 | +++ b/lib/profile/InstrProfilingPlatformOther.c |
| 55 | @@ -10,8 +10,7 @@ |
| 56 | !(defined(__sun__) && defined(__svr4__)) && !defined(__NetBSD__) && \ |
| 57 | !defined(_WIN32) |
| 58 | |
| 59 | -#include <stdlib.h> |
| 60 | -#include <stdio.h> |
| 61 | +#include <stddef.h> |
| 62 | |
| 63 | #include "InstrProfiling.h" |
| 64 | #include "InstrProfilingInternal.h" |
| 65 | diff --git a/lib/profile/InstrProfilingPort.h b/lib/profile/InstrProfilingPort.h |
| 66 | index ed0905cc5..ddc1f408f 100644 |
| 67 | --- a/lib/profile/InstrProfilingPort.h |
| 68 | +++ b/lib/profile/InstrProfilingPort.h |
| 69 | @@ -88,7 +88,6 @@ |
| 70 | (DomType *)__sync_fetch_and_add((long *)&PtrVar, sizeof(DomType) * PtrIncr) |
| 71 | #endif |
| 72 | #else /* COMPILER_RT_HAS_ATOMICS != 1 */ |
| 73 | -#include "InstrProfilingUtil.h" |
| 74 | #define COMPILER_RT_BOOL_CMPXCHG(Ptr, OldV, NewV) \ |
| 75 | lprofBoolCmpXchg((void **)Ptr, OldV, NewV) |
| 76 | #define COMPILER_RT_PTR_FETCH_ADD(DomType, PtrVar, PtrIncr) \ |
| 77 | @@ -117,17 +116,11 @@ static inline size_t getpagesize() { |
| 78 | return S.dwPageSize; |
| 79 | } |
| 80 | #else /* defined(_WIN32) */ |
| 81 | -#include <unistd.h> |
| 82 | #endif /* defined(_WIN32) */ |
| 83 | |
| 84 | -#define PROF_ERR(Format, ...) \ |
| 85 | - fprintf(stderr, "LLVM Profile Error: " Format, __VA_ARGS__); |
| 86 | - |
| 87 | -#define PROF_WARN(Format, ...) \ |
| 88 | - fprintf(stderr, "LLVM Profile Warning: " Format, __VA_ARGS__); |
| 89 | - |
| 90 | -#define PROF_NOTE(Format, ...) \ |
| 91 | - fprintf(stderr, "LLVM Profile Note: " Format, __VA_ARGS__); |
| 92 | +#define PROF_ERR(Format, ...) |
| 93 | +#define PROF_WARN(Format, ...) |
| 94 | +#define PROF_NOTE(Format, ...) |
| 95 | |
| 96 | #ifndef MAP_FILE |
| 97 | #define MAP_FILE 0 |
| 98 | @@ -144,7 +137,7 @@ static inline size_t getpagesize() { |
| 99 | |
| 100 | #else /* defined(__FreeBSD__) */ |
| 101 | |
| 102 | -#include <inttypes.h> |
| 103 | +#include <stddef.h> |
| 104 | #include <stdint.h> |
| 105 | |
| 106 | #endif /* defined(__FreeBSD__) && defined(__i386__) */ |
| 107 | diff --git a/lib/profile/InstrProfilingWriter.c b/lib/profile/InstrProfilingWriter.c |
| 108 | index 25f630293..730262250 100644 |
| 109 | --- a/lib/profile/InstrProfilingWriter.c |
| 110 | +++ b/lib/profile/InstrProfilingWriter.c |
| 111 | @@ -13,7 +13,7 @@ |
| 112 | /* For _alloca */ |
| 113 | #include <malloc.h> |
| 114 | #endif |
| 115 | -#include <string.h> |
| 116 | +#include "sw/device/lib/base/memory.h" |
| 117 | |
| 118 | #include "InstrProfiling.h" |
| 119 | #include "InstrProfilingInternal.h" |