[llvm-commits] [llvm] r153558 - /llvm/trunk/runtime/libprofile/GCDAProfiling.c

Bill Wendling isanbard at gmail.com
Tue Mar 27 18:30:51 PDT 2012


Author: void
Date: Tue Mar 27 20:30:51 2012
New Revision: 153558

URL: http://llvm.org/viewvc/llvm-project?rev=153558&view=rev
Log:
Use Nakamura's suggestion of bypassing using 'filename' and just the pointers directly.

Modified:
    llvm/trunk/runtime/libprofile/GCDAProfiling.c

Modified: llvm/trunk/runtime/libprofile/GCDAProfiling.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/runtime/libprofile/GCDAProfiling.c?rev=153558&r1=153557&r2=153558&view=diff
==============================================================================
--- llvm/trunk/runtime/libprofile/GCDAProfiling.c (original)
+++ llvm/trunk/runtime/libprofile/GCDAProfiling.c Tue Mar 27 20:30:51 2012
@@ -114,11 +114,8 @@
   output_file = fopen(filename, "wb");
 
   if (!output_file) {
-    const char *cptr = 0;
-    filename[0] = '\0';  /* The size of filename should be big enough. */
-    cptr = strrchr(orig_filename, '/');
-    strcat(filename, cptr ? cptr + 1 : orig_filename);
-    output_file = fopen(filename, "wb");
+    const char *cptr = strrchr(orig_filename, '/');
+    output_file = fopen(cptr ? cptr + 1 : orig_filename, "wb");
 
     if (!output_file) {
       fprintf(stderr, "LLVM profiling runtime: while opening '%s': ",





More information about the llvm-commits mailing list