[compiler-rt] r204396 - PGO: Declare zero-argument C functions as foo(void)
Duncan P. N. Exon Smith
dexonsmith at apple.com
Thu Mar 20 13:55:00 PDT 2014
Author: dexonsmith
Date: Thu Mar 20 15:55:00 2014
New Revision: 204396
URL: http://llvm.org/viewvc/llvm-project?rev=204396&view=rev
Log:
PGO: Declare zero-argument C functions as foo(void)
It turns out this is C code. Specify foo(void).
<rdar://problem/15943240>
Modified:
compiler-rt/trunk/lib/profile/InstrProfiling.h
compiler-rt/trunk/lib/profile/InstrProfilingExtras.c
compiler-rt/trunk/lib/profile/InstrProfilingExtras.h
compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c
compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c
Modified: compiler-rt/trunk/lib/profile/InstrProfiling.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfiling.h?rev=204396&r1=204395&r2=204396&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfiling.h (original)
+++ compiler-rt/trunk/lib/profile/InstrProfiling.h Thu Mar 20 15:55:00 2014
@@ -51,9 +51,9 @@ typedef struct __llvm_profile_data {
*/
void __llvm_profile_write_buffer(FILE *OutputFile);
-const __llvm_profile_data *__llvm_profile_data_begin();
-const __llvm_profile_data *__llvm_profile_data_end();
-const char *__llvm_profile_names_begin();
-const char *__llvm_profile_names_end();
-uint64_t *__llvm_profile_counters_begin();
-uint64_t *__llvm_profile_counters_end();
+const __llvm_profile_data *__llvm_profile_data_begin(void);
+const __llvm_profile_data *__llvm_profile_data_end(void);
+const char *__llvm_profile_names_begin(void);
+const char *__llvm_profile_names_end(void);
+uint64_t *__llvm_profile_counters_begin(void);
+uint64_t *__llvm_profile_counters_end(void);
Modified: compiler-rt/trunk/lib/profile/InstrProfilingExtras.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingExtras.c?rev=204396&r1=204395&r2=204396&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingExtras.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingExtras.c Thu Mar 20 15:55:00 2014
@@ -29,7 +29,7 @@ void __llvm_profile_set_filename(const c
CurrentFilename = Filename;
}
-void __llvm_profile_write_file() {
+void __llvm_profile_write_file(void) {
const char *Filename = CurrentFilename;
#define UPDATE_FILENAME(NextFilename) \
@@ -41,7 +41,7 @@ void __llvm_profile_write_file() {
__llvm_profile_write_file_with_name(Filename);
}
-void __llvm_profile_register_write_file_atexit() {
+void __llvm_profile_register_write_file_atexit(void) {
static int HasBeenRegistered = 0;
if (!HasBeenRegistered) {
Modified: compiler-rt/trunk/lib/profile/InstrProfilingExtras.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingExtras.h?rev=204396&r1=204395&r2=204396&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingExtras.h (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingExtras.h Thu Mar 20 15:55:00 2014
@@ -14,7 +14,7 @@
* or if it hasn't been called, the \c LLVM_PROFILE_FILE environment variable,
* or if that's not set, \c "default.profdata".
*/
-void __llvm_profile_write_file();
+void __llvm_profile_write_file(void);
/*!
* \brief Set the filename for writing instrumentation data.
@@ -25,4 +25,4 @@ void __llvm_profile_write_file();
void __llvm_profile_set_filename(const char *Name);
/*! \brief Register to write instrumentation data to file at exit. */
-void __llvm_profile_register_write_file_atexit();
+void __llvm_profile_register_write_file_atexit(void);
Modified: compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c?rev=204396&r1=204395&r2=204396&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c Thu Mar 20 15:55:00 2014
@@ -17,9 +17,13 @@ extern char NamesEnd __asm("section$en
extern uint64_t CountersStart __asm("section$start$__DATA$__llvm_prf_cnts");
extern uint64_t CountersEnd __asm("section$end$__DATA$__llvm_prf_cnts");
-const __llvm_profile_data *__llvm_profile_data_begin() { return &DataStart; }
-const __llvm_profile_data *__llvm_profile_data_end() { return &DataEnd; }
-const char *__llvm_profile_names_begin() { return &NamesStart; }
-const char *__llvm_profile_names_end() { return &NamesEnd; }
-uint64_t *__llvm_profile_counters_begin() { return &CountersStart; }
-uint64_t *__llvm_profile_counters_end() { return &CountersEnd; }
+const __llvm_profile_data *__llvm_profile_data_begin(void) {
+ return &DataStart;
+}
+const __llvm_profile_data *__llvm_profile_data_end(void) {
+ return &DataEnd;
+}
+const char *__llvm_profile_names_begin(void) { return &NamesStart; }
+const char *__llvm_profile_names_end(void) { return &NamesEnd; }
+uint64_t *__llvm_profile_counters_begin(void) { return &CountersStart; }
+uint64_t *__llvm_profile_counters_end(void) { return &CountersEnd; }
Modified: compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c?rev=204396&r1=204395&r2=204396&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c Thu Mar 20 15:55:00 2014
@@ -51,9 +51,13 @@ void __llvm_profile_register_function(vo
#undef UPDATE_LAST
}
-const __llvm_profile_data *__llvm_profile_data_begin() { return DataFirst; }
-const __llvm_profile_data *__llvm_profile_data_end() { return DataLast; }
-const char *__llvm_profile_names_begin() { return NamesFirst; }
-const char *__llvm_profile_names_end() { return NamesLast; }
-uint64_t *__llvm_profile_counters_begin() { return CountersFirst; }
-uint64_t *__llvm_profile_counters_end() { return CountersLast; }
+const __llvm_profile_data *__llvm_profile_data_begin(void) {
+ return DataFirst;
+}
+const __llvm_profile_data *__llvm_profile_data_end(void) {
+ return DataLast;
+}
+const char *__llvm_profile_names_begin(void) { return NamesFirst; }
+const char *__llvm_profile_names_end(void) { return NamesLast; }
+uint64_t *__llvm_profile_counters_begin(void) { return CountersFirst; }
+uint64_t *__llvm_profile_counters_end(void) { return CountersLast; }
More information about the llvm-commits
mailing list