From: Chris Lattner Date: Tue, 10 Feb 2004 17:36:25 +0000 (+0000) Subject: Make the initialization calls return argc. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=affce4fd93e9f8ee863f10bdef8a107591341e5d;p=oota-llvm.git Make the initialization calls return argc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11261 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/runtime/libprofile/BlockProfiling.c b/runtime/libprofile/BlockProfiling.c index 01b80a88e01..8170ce4cb43 100644 --- a/runtime/libprofile/BlockProfiling.c +++ b/runtime/libprofile/BlockProfiling.c @@ -34,10 +34,11 @@ static void BlockProfAtExitHandler() { /* llvm_start_block_profiling - This is the main entry point of the block * profiling library. It is responsible for setting up the atexit handler. */ -void llvm_start_block_profiling(int argc, const char **argv, - unsigned *arrayStart, unsigned numElements) { - save_arguments(argc, argv); +int llvm_start_block_profiling(int argc, const char **argv, + unsigned *arrayStart, unsigned numElements) { + int Ret = save_arguments(argc, argv); ArrayStart = arrayStart; NumElements = numElements; atexit(BlockProfAtExitHandler); + return Ret; } diff --git a/runtime/libprofile/CommonProfiling.c b/runtime/libprofile/CommonProfiling.c index b88ea9cf8b0..5569a66414f 100644 --- a/runtime/libprofile/CommonProfiling.c +++ b/runtime/libprofile/CommonProfiling.c @@ -27,9 +27,9 @@ static unsigned SavedArgsLength = 0; /* save_arguments - Save argc and argv as passed into the program for the file * we output. */ -void save_arguments(int argc, const char **argv) { +int save_arguments(int argc, const char **argv) { 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) Length += strlen(argv[i])+1; @@ -43,6 +43,8 @@ void save_arguments(int argc, const char **argv) { } SavedArgsLength = Length; + + return argc; } diff --git a/runtime/libprofile/FunctionProfiling.c b/runtime/libprofile/FunctionProfiling.c index 8bee2f9ba62..5f9c4f2e388 100644 --- a/runtime/libprofile/FunctionProfiling.c +++ b/runtime/libprofile/FunctionProfiling.c @@ -32,10 +32,11 @@ static void FuncProfAtExitHandler() { /* llvm_start_func_profiling - This is the main entry point of the function * profiling library. It is responsible for setting up the atexit handler. */ -void llvm_start_func_profiling(int argc, const char **argv, - unsigned *arrayStart, unsigned numElements) { - save_arguments(argc, argv); +int llvm_start_func_profiling(int argc, const char **argv, + unsigned *arrayStart, unsigned numElements) { + int Ret = save_arguments(argc, argv); ArrayStart = arrayStart; NumElements = numElements; atexit(FuncProfAtExitHandler); + return Ret; } diff --git a/runtime/libprofile/Profiling.h b/runtime/libprofile/Profiling.h index bb7cc8bc96c..947460a29e3 100644 --- a/runtime/libprofile/Profiling.h +++ b/runtime/libprofile/Profiling.h @@ -18,7 +18,7 @@ /* save_arguments - Save argc and argv as passed into the program for the file * we output. */ -void save_arguments(int argc, const char **argv); +int save_arguments(int argc, const char **argv); enum ProfilingType { Arguments = 1, /* The command line argument block */