Skip to content

Commit fb2960a

Browse files
authored
[compiler-rt] [profile] Add missing (void) to prototypes, for C sources (#110642)
If built as part of the main llvm build, via ENABLE_LLVM_PROJECTS=compiler-rt, the code gets built with more warning options than if built standalone. Some of these trigger warnings like: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
1 parent 3c1d9b8 commit fb2960a

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

compiler-rt/lib/profile/InstrProfiling.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ char *__llvm_profile_begin_counters(void);
114114
char *__llvm_profile_end_counters(void);
115115
char *__llvm_profile_begin_bitmap(void);
116116
char *__llvm_profile_end_bitmap(void);
117-
ValueProfNode *__llvm_profile_begin_vnodes();
118-
ValueProfNode *__llvm_profile_end_vnodes();
119-
const VTableProfData *__llvm_profile_begin_vtables();
120-
const VTableProfData *__llvm_profile_end_vtables();
121-
uint32_t *__llvm_profile_begin_orderfile();
117+
ValueProfNode *__llvm_profile_begin_vnodes(void);
118+
ValueProfNode *__llvm_profile_end_vnodes(void);
119+
const VTableProfData *__llvm_profile_begin_vtables(void);
120+
const VTableProfData *__llvm_profile_end_vtables(void);
121+
uint32_t *__llvm_profile_begin_orderfile(void);
122122

123123
/*!
124124
* \brief Merge profile data from buffer.
@@ -216,7 +216,7 @@ void __llvm_profile_initialize(void);
216216
* merge mode is turned on for instrumented programs with shared libs).
217217
* Side-effect: this API call will invoke malloc with dynamic memory allocation.
218218
*/
219-
const char *__llvm_profile_get_path_prefix();
219+
const char *__llvm_profile_get_path_prefix(void);
220220

221221
/*!
222222
* \brief Return filename (including path) of the profile data. Note that if the
@@ -229,7 +229,7 @@ const char *__llvm_profile_get_path_prefix();
229229
* instrumented image/DSO). This API only retrieves the filename from the copy
230230
* of the runtime available to the calling image.
231231
*/
232-
const char *__llvm_profile_get_filename();
232+
const char *__llvm_profile_get_filename(void);
233233

234234
/*! \brief Get the magic token for the file format. */
235235
uint64_t __llvm_profile_get_magic(void);
@@ -293,7 +293,7 @@ int __llvm_profile_get_padding_sizes_for_counters(
293293
* certain processes in case the processes don't have permission to write to
294294
* the disks, and trying to do so would result in side effects such as crashes.
295295
*/
296-
void __llvm_profile_set_dumped();
296+
void __llvm_profile_set_dumped(void);
297297

298298
/*!
299299
* This variable is defined in InstrProfilingRuntime.cpp as a hidden

compiler-rt/lib/profile/InstrProfilingInternal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,20 +167,20 @@ int lprofWriteDataImpl(ProfDataWriter *Writer,
167167
void lprofMergeValueProfData(struct ValueProfData *SrcValueProfData,
168168
__llvm_profile_data *DstData);
169169

170-
VPDataReaderType *lprofGetVPDataReader();
170+
VPDataReaderType *lprofGetVPDataReader(void);
171171

172172
/* Internal interface used by test to reset the max number of
173173
* tracked values per value site to be \p MaxVals.
174174
*/
175175
void lprofSetMaxValsPerSite(uint32_t MaxVals);
176-
void lprofSetupValueProfiler();
176+
void lprofSetupValueProfiler(void);
177177

178178
/* Return the profile header 'signature' value associated with the current
179179
* executable or shared library. The signature value can be used to for
180180
* a profile name that is unique to this load module so that it does not
181181
* collide with profiles from other binaries. It also allows shared libraries
182182
* to dump merged profile data into its own profile file. */
183-
uint64_t lprofGetLoadModuleSignature();
183+
uint64_t lprofGetLoadModuleSignature(void);
184184

185185
/*
186186
* Return non zero value if the profile data has already been

compiler-rt/lib/profile/InstrProfilingPort.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111

112112
#if defined(_WIN32)
113113
#include <windows.h>
114-
static inline size_t getpagesize() {
114+
static inline size_t getpagesize(void) {
115115
SYSTEM_INFO S;
116116
GetNativeSystemInfo(&S);
117117
return S.dwPageSize;

compiler-rt/lib/profile/InstrProfilingUtil.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ void *lprofPtrFetchAdd(void **Mem, long ByteIncr);
6969
/* Temporarily suspend SIGKILL. Return value of 1 means a restore is needed.
7070
* Other return values mean no restore is needed.
7171
*/
72-
int lprofSuspendSigKill();
72+
int lprofSuspendSigKill(void);
7373

7474
/* Restore previously suspended SIGKILL. */
75-
void lprofRestoreSigKill();
75+
void lprofRestoreSigKill(void);
7676

7777
static inline size_t lprofRoundUpTo(size_t x, size_t boundary) {
7878
return (x + boundary - 1) & ~(boundary - 1);

0 commit comments

Comments
 (0)