[compiler-rt] bdbfaf0 - Giving a lot more functions prototypes; NFC
Aaron Ballman via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 9 14:25:19 PDT 2022
Author: Aaron Ballman
Date: 2022-04-09T17:25:10-04:00
New Revision: bdbfaf0ca7c069192c1d05094c0517b4e52a4773
URL: https://github.com/llvm/llvm-project/commit/bdbfaf0ca7c069192c1d05094c0517b4e52a4773
DIFF: https://github.com/llvm/llvm-project/commit/bdbfaf0ca7c069192c1d05094c0517b4e52a4773.diff
LOG: Giving a lot more functions prototypes; NFC
This should address https://lab.llvm.org/buildbot/#/builders/37/builds/12315
and speculatively fix other similar diagnostics.
Added:
Modified:
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
Removed:
################################################################################
diff --git a/compiler-rt/lib/builtins/aarch64/fp_mode.c b/compiler-rt/lib/builtins/aarch64/fp_mode.c
index 94c2ff3bb26d2..03d75cd8be669 100644
--- a/compiler-rt/lib/builtins/aarch64/fp_mode.c
+++ b/compiler-rt/lib/builtins/aarch64/fp_mode.c
@@ -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));
diff --git a/compiler-rt/lib/builtins/arm/fp_mode.c b/compiler-rt/lib/builtins/arm/fp_mode.c
index f356e0b1316b0..064f4e94fb849 100644
--- a/compiler-rt/lib/builtins/arm/fp_mode.c
+++ b/compiler-rt/lib/builtins/arm/fp_mode.c
@@ -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));
diff --git a/compiler-rt/lib/builtins/i386/fp_mode.c b/compiler-rt/lib/builtins/i386/fp_mode.c
index 80e272e4c9a3e..887ca9c34c156 100644
--- a/compiler-rt/lib/builtins/i386/fp_mode.c
+++ b/compiler-rt/lib/builtins/i386/fp_mode.c
@@ -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;
diff --git a/compiler-rt/lib/crt/crtbegin.c b/compiler-rt/lib/crt/crtbegin.c
index 481c158ac7776..7b041ff00b6b6 100644
--- a/compiler-rt/lib/crt/crtbegin.c
+++ b/compiler-rt/lib/crt/crtbegin.c
@@ -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;
diff --git a/compiler-rt/lib/profile/GCDAProfiling.c b/compiler-rt/lib/profile/GCDAProfiling.c
index 8e51f57b09ffb..4aa15e9e95905 100644
--- a/compiler-rt/lib/profile/GCDAProfiling.c
+++ b/compiler-rt/lib/profile/GCDAProfiling.c
@@ -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);
diff --git a/compiler-rt/lib/profile/InstrProfiling.c b/compiler-rt/lib/profile/InstrProfiling.c
index ead5e93307348..4bf8463f1ef9c 100644
--- a/compiler-rt/lib/profile/InstrProfiling.c
+++ b/compiler-rt/lib/profile/InstrProfiling.c
@@ -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);
}
diff --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c
index 81aa2c03c9e55..31cd7766ae79b 100644
--- a/compiler-rt/lib/profile/InstrProfilingFile.c
+++ b/compiler-rt/lib/profile/InstrProfilingFile.c
@@ -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;
diff --git a/compiler-rt/lib/profile/InstrProfilingInternal.c b/compiler-rt/lib/profile/InstrProfilingInternal.c
index edd38ad765c5d..3dd659f905102 100644
--- a/compiler-rt/lib/profile/InstrProfilingInternal.c
+++ b/compiler-rt/lib/profile/InstrProfilingInternal.c
@@ -15,7 +15,7 @@
static unsigned ProfileDumped = 0;
-COMPILER_RT_VISIBILITY unsigned lprofProfileDumped() {
+COMPILER_RT_VISIBILITY unsigned lprofProfileDumped(void) {
return ProfileDumped;
}
diff --git a/compiler-rt/lib/profile/InstrProfilingMerge.c b/compiler-rt/lib/profile/InstrProfilingMerge.c
index adf866e52cf72..4da88b7d7bdb5 100644
--- a/compiler-rt/lib/profile/InstrProfilingMerge.c
+++ b/compiler-rt/lib/profile/InstrProfilingMerge.c
@@ -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(
diff --git a/compiler-rt/lib/profile/InstrProfilingPlatformFuchsia.c b/compiler-rt/lib/profile/InstrProfilingPlatformFuchsia.c
index ee2bd56b4b53b..fdcb82e4d72ba 100644
--- a/compiler-rt/lib/profile/InstrProfilingPlatformFuchsia.c
+++ b/compiler-rt/lib/profile/InstrProfilingPlatformFuchsia.c
@@ -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) {}
diff --git a/compiler-rt/lib/profile/InstrProfilingUtil.c b/compiler-rt/lib/profile/InstrProfilingUtil.c
index d563e333aca83..cd179d03bc831 100644
--- a/compiler-rt/lib/profile/InstrProfilingUtil.c
+++ b/compiler-rt/lib/profile/InstrProfilingUtil.c
@@ -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__)
diff --git a/compiler-rt/lib/profile/InstrProfilingValue.c b/compiler-rt/lib/profile/InstrProfilingValue.c
index 08197fdd9ea24..c819a38553f36 100644
--- a/compiler-rt/lib/profile/InstrProfilingValue.c
+++ b/compiler-rt/lib/profile/InstrProfilingValue.c
@@ -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;
}
More information about the llvm-commits
mailing list