Move the smarts of AnalysisGroup registration into PassRegistry.
[oota-llvm.git] / runtime / libprofile / CommonProfiling.c
index 7e9e12e42325521bba47b3c4e37b942d2f24d3ff..8b27a257697429d04acfba512bb23cd0454ffa04 100644 (file)
@@ -2,8 +2,8 @@
 |*
 |*                     The LLVM Compiler Infrastructure
 |*
-|* This file was developed by the LLVM research group and is distributed under
-|* the University of Illinois Open Source License. See LICENSE.TXT for details.
+|* This file is distributed under the University of Illinois Open Source      
+|* License. See LICENSE.TXT for details.                                      
 |* 
 |*===----------------------------------------------------------------------===*|
 |* 
@@ -41,7 +41,7 @@ int save_arguments(int argc, const char **argv) {
      * what to do with it.
      */
     const char *Arg = argv[1];
-    memmove(&argv[1], &argv[2], (argc-2)*sizeof(char*));
+    memmove(&argv[1], &argv[2], (argc-1)*sizeof(char*));
     --argc;
 
     if (!strcmp(Arg, "-llvmprof-output")) {
@@ -49,7 +49,7 @@ int save_arguments(int argc, const char **argv) {
         puts("-llvmprof-output requires a filename argument!");
       else {
         OutputFilename = strdup(argv[1]);
-        memmove(&argv[1], &argv[2], (argc-2)*sizeof(char*));
+        memmove(&argv[1], &argv[2], (argc-1)*sizeof(char*));
         --argc;
       }
     } else {
@@ -88,7 +88,6 @@ void write_profiling_data(enum ProfilingType PT, unsigned *Start,
    * appending, creating it if it does not already exist.
    */
   if (OutFile == -1) {
-    off_t Offset;
     OutFile = open(OutputFilename, O_CREAT | O_WRONLY | O_APPEND, 0666);
     if (OutFile == -1) {
       fprintf(stderr, "LLVM profiling runtime: while opening '%s': ",
@@ -99,7 +98,7 @@ void write_profiling_data(enum ProfilingType PT, unsigned *Start,
 
     /* Output the command line arguments to the file. */
     {
-      int PTy = Arguments;
+      int PTy = ArgumentInfo;
       int Zeros = 0;
       write(OutFile, &PTy, sizeof(int));
       write(OutFile, &SavedArgsLength, sizeof(unsigned));