Giving a lot more functions prototypes; NFC
authorAaron Ballman <aaron@aaronballman.com>
Sat, 9 Apr 2022 21:23:32 +0000 (17:23 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Sat, 9 Apr 2022 21:25:10 +0000 (17:25 -0400)
This should address https://lab.llvm.org/buildbot/#/builders/37/builds/12315
and speculatively fix other similar diagnostics.

12 files changed:
compiler-rt/lib/builtins/aarch64/fp_mode.c
compiler-rt/lib/builtins/arm/fp_mode.c
compiler-rt/lib/builtins/i386/fp_mode.c
compiler-rt/lib/crt/crtbegin.c
compiler-rt/lib/profile/GCDAProfiling.c
compiler-rt/lib/profile/InstrProfiling.c
compiler-rt/lib/profile/InstrProfilingFile.c
compiler-rt/lib/profile/InstrProfilingInternal.c
compiler-rt/lib/profile/InstrProfilingMerge.c
compiler-rt/lib/profile/InstrProfilingPlatformFuchsia.c
compiler-rt/lib/profile/InstrProfilingUtil.c
compiler-rt/lib/profile/InstrProfilingValue.c

index 94c2ff3..03d75cd 100644 (file)
@@ -27,7 +27,7 @@ CRT_FE_ROUND_MODE __attribute__((weak)) __aarch64_fe_default_rmode =
     CRT_FE_TONEAREST;
 #endif
 
-CRT_FE_ROUND_MODE __fe_getround() {
+CRT_FE_ROUND_MODE __fe_getround(void) {
 #ifdef __ARM_FP
   uint64_t fpcr;
   __asm__ __volatile__("mrs  %0, fpcr" : "=r" (fpcr));
@@ -48,7 +48,7 @@ CRT_FE_ROUND_MODE __fe_getround() {
 #endif
 }
 
-int __fe_raise_inexact() {
+int __fe_raise_inexact(void) {
 #ifdef __ARM_FP
   uint64_t fpsr;
   __asm__ __volatile__("mrs  %0, fpsr" : "=r" (fpsr));
index f356e0b..064f4e9 100644 (file)
@@ -27,7 +27,7 @@ CRT_FE_ROUND_MODE __attribute__((weak)) __arm_fe_default_rmode =
     CRT_FE_TONEAREST;
 #endif
 
-CRT_FE_ROUND_MODE __fe_getround() {
+CRT_FE_ROUND_MODE __fe_getround(void) {
 #ifdef __ARM_FP
   uint32_t fpscr;
   __asm__ __volatile__("vmrs  %0, fpscr" : "=r" (fpscr));
@@ -48,7 +48,7 @@ CRT_FE_ROUND_MODE __fe_getround() {
 #endif
 }
 
-int __fe_raise_inexact() {
+int __fe_raise_inexact(void) {
 #ifdef __ARM_FP
   uint32_t fpscr;
   __asm__ __volatile__("vmrs  %0, fpscr" : "=r" (fpscr));
index 80e272e..887ca9c 100644 (file)
@@ -14,7 +14,7 @@
 #define X87_TOWARDZERO 0x0c00
 #define X87_RMODE_MASK (X87_TONEAREST | X87_UPWARD | X87_DOWNWARD | X87_TOWARDZERO)
 
-CRT_FE_ROUND_MODE __fe_getround() {
+CRT_FE_ROUND_MODE __fe_getround(void) {
   // Assume that the rounding mode state for the fpu agrees with the SSE unit.
   unsigned short cw;
   __asm__ __volatile__ ("fnstcw %0" : "=m" (cw));
@@ -32,7 +32,7 @@ CRT_FE_ROUND_MODE __fe_getround() {
   return CRT_FE_TONEAREST;
 }
 
-int __fe_raise_inexact() {
+int __fe_raise_inexact(void) {
   float f = 1.0f, g = 3.0f;
   __asm__ __volatile__ ("fdivs %1" : "+t" (f) : "m" (g));
   return 0;
index 481c158..7b041ff 100644 (file)
@@ -28,7 +28,7 @@ extern fp __CTOR_LIST_END__[];
 
 extern void __cxa_finalize(void *) __attribute__((weak));
 
-static void __attribute__((used)) __do_init() {
+static void __attribute__((used)) __do_init(void) {
   static _Bool __initialized;
   if (__builtin_expect(__initialized, 0))
     return;
@@ -79,7 +79,7 @@ static fp __DTOR_LIST__[]
 extern fp __DTOR_LIST_END__[];
 #endif
 
-static void __attribute__((used)) __do_fini() {
+static void __attribute__((used)) __do_fini(void) {
   static _Bool __finalized;
   if (__builtin_expect(__finalized, 0))
     return;
index 8e51f57..4aa15e9 100644 (file)
@@ -83,7 +83,7 @@ static HANDLE mmap_handle = NULL;
 #endif
 static int fd = -1;
 
-typedef void (*fn_ptr)();
+typedef void (*fn_ptr)(void);
 
 typedef void* dynamic_object_id;
 // The address of this variable identifies a given dynamic object.
@@ -183,7 +183,7 @@ static void write_64bit_value(uint64_t i) {
   write_32bit_value(hi);
 }
 
-static uint32_t read_32bit_value() {
+static uint32_t read_32bit_value(void) {
   uint32_t val;
 
   if (new_file)
@@ -194,7 +194,7 @@ static uint32_t read_32bit_value() {
   return val;
 }
 
-static uint64_t read_64bit_value() {
+static uint64_t read_64bit_value(void) {
   // GCOV uses a lo-/hi-word format even on big-endian systems.
   // See also GCOVBuffer::readInt64 in LLVM.
   uint32_t lo = read_32bit_value();
@@ -218,7 +218,7 @@ static char *mangle_filename(const char *orig_filename) {
   return new_filename;
 }
 
-static int map_file() {
+static int map_file(void) {
   fseek(output_file, 0L, SEEK_END);
   file_size = ftell(output_file);
 
@@ -262,7 +262,7 @@ static int map_file() {
   return 0;
 }
 
-static void unmap_file() {
+static void unmap_file(void) {
 #if defined(_WIN32)
   if (!FlushViewOfFile(write_buffer, file_size)) {
     fprintf(stderr, "profiling: %s: cannot flush mapped view: %lu\n", filename,
@@ -449,7 +449,7 @@ void llvm_gcda_emit_arcs(uint32_t num_counters, uint64_t *counters) {
 }
 
 COMPILER_RT_VISIBILITY
-void llvm_gcda_summary_info() {
+void llvm_gcda_summary_info(void) {
   uint32_t runs = 1;
   static uint32_t run_counted = 0; // We only want to increase the run count once.
   uint32_t val = 0;
@@ -513,7 +513,7 @@ void llvm_gcda_summary_info() {
 }
 
 COMPILER_RT_VISIBILITY
-void llvm_gcda_end_file() {
+void llvm_gcda_end_file(void) {
   /* Write out EOF record. */
   if (output_file) {
     write_bytes("\0\0\0\0\0\0\0\0", 8);
index ead5e93..4bf8463 100644 (file)
@@ -25,7 +25,7 @@ COMPILER_RT_VISIBILITY uint64_t __llvm_profile_get_magic(void) {
                                             : (INSTR_PROF_RAW_MAGIC_32);
 }
 
-COMPILER_RT_VISIBILITY void __llvm_profile_set_dumped() {
+COMPILER_RT_VISIBILITY void __llvm_profile_set_dumped(void) {
   lprofSetProfileDumped(1);
 }
 
index 81aa2c0..31cd776 100644 (file)
@@ -231,18 +231,18 @@ static int mmapForContinuousMode(uint64_t CurrentFileOffset, FILE *File) {
 }
 #endif
 
-static int isProfileMergeRequested() { return ProfileMergeRequested; }
+static int isProfileMergeRequested(void) { return ProfileMergeRequested; }
 static void setProfileMergeRequested(int EnableMerge) {
   ProfileMergeRequested = EnableMerge;
 }
 
 static FILE *ProfileFile = NULL;
-static FILE *getProfileFile() { return ProfileFile; }
+static FILE *getProfileFile(void) { return ProfileFile; }
 static void setProfileFile(FILE *File) { ProfileFile = File; }
 
-static int getCurFilenameLength();
+static int getCurFilenameLength(void);
 static const char *getCurFilename(char *FilenameBuf, int ForceUseBuf);
-static unsigned doMerging() {
+static unsigned doMerging(void) {
   return lprofCurFilename.MergePoolSize || isProfileMergeRequested();
 }
 
@@ -303,7 +303,7 @@ lprofCreateBufferIOInternal(void *File, uint32_t BufferSz) {
   return IO;
 }
 
-static void setupIOBuffer() {
+static void setupIOBuffer(void) {
   const char *BufferSzStr = 0;
   BufferSzStr = getenv("LLVM_VP_BUFFER_SIZE");
   if (BufferSzStr && BufferSzStr[0]) {
@@ -822,7 +822,7 @@ static void parseAndSetFilename(const char *FilenamePat,
  * filename with PID and hostname substitutions. */
 /* The length to hold uint64_t followed by 3 digits pool id including '_' */
 #define SIGLEN 24
-static int getCurFilenameLength() {
+static int getCurFilenameLength(void) {
   int Len;
   if (!lprofCurFilename.FilenamePat || !lprofCurFilename.FilenamePat[0])
     return 0;
index edd38ad..3dd659f 100644 (file)
@@ -15,7 +15,7 @@
 
 static unsigned ProfileDumped = 0;
 
-COMPILER_RT_VISIBILITY unsigned lprofProfileDumped() {
+COMPILER_RT_VISIBILITY unsigned lprofProfileDumped(void) {
   return ProfileDumped;
 }
 
index adf866e..4da88b7 100644 (file)
@@ -20,7 +20,7 @@ COMPILER_RT_VISIBILITY
 void (*VPMergeHook)(ValueProfData *, __llvm_profile_data *);
 
 COMPILER_RT_VISIBILITY
-uint64_t lprofGetLoadModuleSignature() {
+uint64_t lprofGetLoadModuleSignature(void) {
   /* A very fast way to compute a module signature.  */
   uint64_t Version = __llvm_profile_get_version();
   uint64_t NumCounters = __llvm_profile_get_num_counters(
index ee2bd56..fdcb82e 100644 (file)
@@ -37,7 +37,7 @@
 /* This variable is an external reference to symbol defined by the compiler. */
 COMPILER_RT_VISIBILITY extern intptr_t INSTR_PROF_PROFILE_COUNTER_BIAS_VAR;
 
-COMPILER_RT_VISIBILITY unsigned lprofProfileDumped() {
+COMPILER_RT_VISIBILITY unsigned lprofProfileDumped(void) {
   return 1;
 }
 COMPILER_RT_VISIBILITY void lprofSetProfileDumped(unsigned Value) {}
index d563e33..cd179d0 100644 (file)
@@ -324,7 +324,7 @@ COMPILER_RT_VISIBILITY const char *lprofFindLastDirSeparator(const char *Path) {
   return Sep;
 }
 
-COMPILER_RT_VISIBILITY int lprofSuspendSigKill() {
+COMPILER_RT_VISIBILITY int lprofSuspendSigKill(void) {
 #if defined(__linux__)
   int PDeachSig = 0;
   /* Temporarily suspend getting SIGKILL upon exit of the parent process. */
@@ -342,7 +342,7 @@ COMPILER_RT_VISIBILITY int lprofSuspendSigKill() {
 #endif
 }
 
-COMPILER_RT_VISIBILITY void lprofRestoreSigKill() {
+COMPILER_RT_VISIBILITY void lprofRestoreSigKill(void) {
 #if defined(__linux__)
   prctl(PR_SET_PDEATHSIG, SIGKILL);
 #elif defined(__FreeBSD__)
index 08197fd..c819a38 100644 (file)
@@ -39,7 +39,7 @@ COMPILER_RT_VISIBILITY ValueProfNode
 COMPILER_RT_VISIBILITY uint32_t VPMaxNumValsPerSite =
     INSTR_PROF_DEFAULT_NUM_VAL_PER_SITE;
 
-COMPILER_RT_VISIBILITY void lprofSetupValueProfiler() {
+COMPILER_RT_VISIBILITY void lprofSetupValueProfiler(void) {
   const char *Str = 0;
   Str = getenv("LLVM_VP_MAX_NUM_VALS_PER_SITE");
   if (Str && Str[0]) {
@@ -353,6 +353,6 @@ static VPDataReaderType TheVPDataReader = {
     getFirstValueProfRecord,          getNumValueDataForSiteWrapper,
     getValueProfDataSizeWrapper,      getNextNValueData};
 
-COMPILER_RT_VISIBILITY VPDataReaderType *lprofGetVPDataReader() {
+COMPILER_RT_VISIBILITY VPDataReaderType *lprofGetVPDataReader(void) {
   return &TheVPDataReader;
 }