Skip to content

Commit

Permalink
Giving a lot more functions prototypes; NFC
Browse files Browse the repository at this point in the history
This should address https://lab.llvm.org/buildbot/#/builders/37/builds/12315
and speculatively fix other similar diagnostics.
  • Loading branch information
AaronBallman committed Apr 9, 2022
1 parent 77e71bc commit bdbfaf0
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/aarch64/fp_mode.c
Expand Up @@ -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));
Expand All @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/arm/fp_mode.c
Expand Up @@ -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));
Expand All @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/i386/fp_mode.c
Expand Up @@ -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));
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/crt/crtbegin.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions compiler-rt/lib/profile/GCDAProfiling.c
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand All @@ -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();
Expand All @@ -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);

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/InstrProfiling.c
Expand Up @@ -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);
}

Expand Down
12 changes: 6 additions & 6 deletions compiler-rt/lib/profile/InstrProfilingFile.c
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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]) {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/InstrProfilingInternal.c
Expand Up @@ -15,7 +15,7 @@

static unsigned ProfileDumped = 0;

COMPILER_RT_VISIBILITY unsigned lprofProfileDumped() {
COMPILER_RT_VISIBILITY unsigned lprofProfileDumped(void) {
return ProfileDumped;
}

Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/InstrProfilingMerge.c
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/InstrProfilingPlatformFuchsia.c
Expand Up @@ -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) {}
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/profile/InstrProfilingUtil.c
Expand Up @@ -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. */
Expand All @@ -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__)
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/profile/InstrProfilingValue.c
Expand Up @@ -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]) {
Expand Down Expand Up @@ -353,6 +353,6 @@ static VPDataReaderType TheVPDataReader = {
getFirstValueProfRecord, getNumValueDataForSiteWrapper,
getValueProfDataSizeWrapper, getNextNValueData};

COMPILER_RT_VISIBILITY VPDataReaderType *lprofGetVPDataReader() {
COMPILER_RT_VISIBILITY VPDataReaderType *lprofGetVPDataReader(void) {
return &TheVPDataReader;
}

0 comments on commit bdbfaf0

Please sign in to comment.