mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
Make the initialization calls return argc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11261 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
1 parent
c6f7591f5a
commit
affce4fd93
4 files changed
+13
-9
No files matched your search
@@ -34,10 +34,11 @@ static void BlockProfAtExitHandler() {
|
|||||||
/* llvm_start_block_profiling - This is the main entry point of the block
|
/* llvm_start_block_profiling - This is the main entry point of the block
|
||||||
* profiling library. It is responsible for setting up the atexit handler.
|
* profiling library. It is responsible for setting up the atexit handler.
|
||||||
*/
|
*/
|
||||||
void llvm_start_block_profiling(int argc, const char **argv,
|
int llvm_start_block_profiling(int argc, const char **argv,
|
||||||
unsigned *arrayStart, unsigned numElements) {
|
unsigned *arrayStart, unsigned numElements) {
|
||||||
save_arguments(argc, argv);
|
int Ret = save_arguments(argc, argv);
|
||||||
ArrayStart = arrayStart;
|
ArrayStart = arrayStart;
|
||||||
NumElements = numElements;
|
NumElements = numElements;
|
||||||
atexit(BlockProfAtExitHandler);
|
atexit(BlockProfAtExitHandler);
|
||||||
|
return Ret;
|
||||||
}
|
}
|
||||||
@@ -27,9 +27,9 @@ static unsigned SavedArgsLength = 0;
|
|||||||
/* save_arguments - Save argc and argv as passed into the program for the file
|
/* save_arguments - Save argc and argv as passed into the program for the file
|
||||||
* we output.
|
* we output.
|
||||||
*/
|
*/
|
||||||
void save_arguments(int argc, const char **argv) {
|
int save_arguments(int argc, const char **argv) {
|
||||||
unsigned Length, i;
|
unsigned Length, i;
|
||||||
if (SavedArgs || !argv) return; /* This can be called multiple times */
|
if (SavedArgs || !argv) return argc; /* This can be called multiple times */
|
||||||
|
|
||||||
for (Length = 0, i = 0; i != (unsigned)argc; ++i)
|
for (Length = 0, i = 0; i != (unsigned)argc; ++i)
|
||||||
Length += strlen(argv[i])+1;
|
Length += strlen(argv[i])+1;
|
||||||
@@ -43,6 +43,8 @@ void save_arguments(int argc, const char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SavedArgsLength = Length;
|
SavedArgsLength = Length;
|
||||||
|
|
||||||
|
return argc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,11 @@ static void FuncProfAtExitHandler() {
|
|||||||
/* llvm_start_func_profiling - This is the main entry point of the function
|
/* llvm_start_func_profiling - This is the main entry point of the function
|
||||||
* profiling library. It is responsible for setting up the atexit handler.
|
* profiling library. It is responsible for setting up the atexit handler.
|
||||||
*/
|
*/
|
||||||
void llvm_start_func_profiling(int argc, const char **argv,
|
int llvm_start_func_profiling(int argc, const char **argv,
|
||||||
unsigned *arrayStart, unsigned numElements) {
|
unsigned *arrayStart, unsigned numElements) {
|
||||||
save_arguments(argc, argv);
|
int Ret = save_arguments(argc, argv);
|
||||||
ArrayStart = arrayStart;
|
ArrayStart = arrayStart;
|
||||||
NumElements = numElements;
|
NumElements = numElements;
|
||||||
atexit(FuncProfAtExitHandler);
|
atexit(FuncProfAtExitHandler);
|
||||||
|
return Ret;
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
/* save_arguments - Save argc and argv as passed into the program for the file
|
/* save_arguments - Save argc and argv as passed into the program for the file
|
||||||
* we output.
|
* we output.
|
||||||
*/
|
*/
|
||||||
void save_arguments(int argc, const char **argv);
|
int save_arguments(int argc, const char **argv);
|
||||||
|
|
||||||
enum ProfilingType {
|
enum ProfilingType {
|
||||||
Arguments = 1, /* The command line argument block */
|
Arguments = 1, /* The command line argument block */
|
||||||
|
|||||||
Reference in new issue
Block a user