[llvm-commits] [llvm] r130879 - /llvm/trunk/runtime/libprofile/GCDAProfiling.c
Francois Pichet
pichet2000 at gmail.com
Wed May 25 10:03:24 PDT 2011
On Wed, May 4, 2011 at 6:34 PM, Nick Lewycky <nicholas at mxc.ca> wrote:
> Author: nicholas
> Date: Wed May 4 17:34:29 2011
> New Revision: 130879
>
> URL: http://llvm.org/viewvc/llvm-project?rev=130879&view=rev
> Log:
> Create the parent directories to place the .gcda files in if they don't exist.
> That's kinda weird because the .gcno files are supposed to already be there,
> but libgcov does this and somehow Google has managed to depend on it.
>
> 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=130879&r1=130878&r2=130879&view=diff
> ==============================================================================
> --- llvm/trunk/runtime/libprofile/GCDAProfiling.c (original)
> +++ llvm/trunk/runtime/libprofile/GCDAProfiling.c Wed May 4 17:34:29 2011
> @@ -24,6 +24,8 @@
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> +#include <sys/stat.h>
> +#include <sys/types.h>
>
> /* #define DEBUG_GCDAPROFILING */
>
> @@ -64,6 +66,21 @@
> return filename;
> }
>
> +static void recursive_mkdir(const char *filename) {
> + char *pathname;
> + int i, e;
> +
> + for (i = 1, e = strlen(filename); i != e; ++i) {
> + if (filename[i] == '/') {
> + pathname = malloc(i + 1);
> + strncpy(pathname, filename, i);
> + pathname[i] = '\0';
> + mkdir(pathname, 0750); /* some of these will fail, ignore it. */
> + free(pathname);
> + }
> + }
> +}
Hi Nick, recursive_mkdir won't work on Windows and it is causing a
warning. Could you use Path::createDirectoryOnDisk instead?
More information about the llvm-commits
mailing list