[compiler-rt] r270181 - [profile] Remove anther malloc use

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 22:44:25 PDT 2016


Hi David,

I'm seeing a bot failure after this commit:

FAILED: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iprojects/compiler-rt/lib/profile -I/Users/buildslave/jenkins/sharedspace/apple-clang-master-RA-stage1-cmake-incremental at 2/clang/src/projects/compiler-rt/lib/profile -Iinclude -I/Users/buildslave/jenkins/sharedspace/apple-clang-master-RA-stage1-cmake-incremental at 2/clang/src/include -fPIC -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wdelete-non-virtual-dtor -Werror=date-time -fcolor-diagnostics -Wall -O3  -arch i386 -arch x86_64 -arch x86_64h   -UNDEBUG  -mmacosx-version-min=10.4 -MMD -MT projects/compiler-rt/lib/profile/CMakeFiles/clang_rt.profile_osx.dir/InstrProfilingFile.c.o -MF projects/compiler-rt/lib/profile/CMakeFiles/clang_rt.profile_osx.dir/InstrProfilingFile.c.o.d -o projects/compiler-rt/lib/profile/CMakeFiles/clang_rt.profile_osx.dir/InstrProfilingFile.c.o   -c '/Users/buildslave/jenkins/sharedspace/apple-clang-master-RA-stage1-cmake-incremental at 2/clang/src/projects/compiler-rt/lib/profile/InstrProfilingFile.c'

/Users/buildslave/jenkins/sharedspace/apple-clang-master-RA-stage1-cmake-incremental at 2/clang/src/projects/compiler-rt/lib/profile/InstrProfilingFile.c:20:10: fatal error: 'malloc.h' file not found
#include <malloc.h>

Not sure why malloc.h isn't on the bots. Any tips?

vedant


> On May 19, 2016, at 9:52 PM, Xinliang David Li via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> Author: davidxl
> Date: Thu May 19 23:52:27 2016
> New Revision: 270181
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=270181&view=rev
> Log:
> [profile] Remove anther malloc use
> 
> Modified:
>    compiler-rt/trunk/lib/profile/InstrProfilingFile.c
> 
> Modified: compiler-rt/trunk/lib/profile/InstrProfilingFile.c
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingFile.c?rev=270181&r1=270180&r2=270181&view=diff
> ==============================================================================
> --- compiler-rt/trunk/lib/profile/InstrProfilingFile.c (original)
> +++ compiler-rt/trunk/lib/profile/InstrProfilingFile.c Thu May 19 23:52:27 2016
> @@ -14,6 +14,11 @@
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> +#ifdef _MSC_VER
> +/* For _alloca */
> +#endif
> +#include <malloc.h>
> +
> 
> #define UNCONST(ptr) ((void *)(uintptr_t)(ptr))
> 
> @@ -83,10 +88,9 @@ static void truncateCurrentFile(void) {
> 
>   /* Create the directory holding the file, if needed. */
>   if (strchr(Filename, '/') || strchr(Filename, '\\')) {
> -    char *Copy = malloc(strlen(Filename) + 1);
> +    char *Copy = (char *)COMPILER_RT_ALLOCA(strlen(Filename) + 1);
>     strcpy(Copy, Filename);
>     __llvm_profile_recursive_mkdir(Copy);
> -    free(Copy);
>   }
> 
>   /* Truncate the file.  Later we'll reopen and append. */
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list