Make the initialization calls return argc.
authorChris Lattner <sabre@nondot.org>
Tue, 10 Feb 2004 17:36:25 +0000 (17:36 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 10 Feb 2004 17:36:25 +0000 (17:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11261 91177308-0d34-0410-b5e6-96231b3b80d8

runtime/libprofile/BlockProfiling.c
runtime/libprofile/CommonProfiling.c
runtime/libprofile/FunctionProfiling.c
runtime/libprofile/Profiling.h

index 01b80a88e01a7eb3bc07b174b18d355d0c928920..8170ce4cb43e5edf483c0ce18b5f372fbc770d4b 100644 (file)
@@ -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;
 }
index b88ea9cf8b0ede0b76500ab4340779caa882c6c0..5569a66414f4315490e90fc47c32510564dfa27d 100644 (file)
@@ -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;
 }
 
 
index 8bee2f9ba620e491aafa7a772f2c70e975bab20c..5f9c4f2e388a396f3613aacb871fbb7c6ce699f1 100644 (file)
@@ -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;
 }
index bb7cc8bc96c8b79570b64324bd644e4b1011070f..947460a29e327e98c0d96ff4756f83c01c4c56ab 100644 (file)
@@ -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 */