[compiler-rt] r202296 - Emulate C99/C++11 __func__ for Visual C++.

Reid Kleckner rnk at google.com
Wed Feb 26 13:06:48 PST 2014


I'd really rather not muck around in the implementors namespace like this.
 If the compiler is actually clang-cl (which claims to be MSVC) or MSVC
2013 CTP, then __func__ will be available, and who knows what will happen.


On Wed, Feb 26, 2014 at 12:31 PM, Joerg Sonnenberger <joerg at bec.de> wrote:

> Author: joerg
> Date: Wed Feb 26 14:31:17 2014
> New Revision: 202296
>
> URL: http://llvm.org/viewvc/llvm-project?rev=202296&view=rev
> Log:
> Emulate C99/C++11 __func__ for Visual C++.
>
> Modified:
>     compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake
>
> Modified: compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake?rev=202296&r1=202295&r2=202296&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake (original)
> +++ compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake Wed Feb 26
> 14:31:17 2014
> @@ -11,6 +11,9 @@ macro(clang_compile object_file source)
>    if(NOT COMPILER_RT_STANDALONE_BUILD)
>      list(APPEND SOURCE_DEPS clang)
>    endif()
> +  if (MSVC)
> +    list(APPEND SOURCE_CFLAGS -D__func__=__FUNCTION__)
> +  endif()
>    add_custom_command(
>      OUTPUT ${object_file}
>      COMMAND ${COMPILER_RT_TEST_COMPILER} ${SOURCE_CFLAGS} -c -o
> "${object_file}"
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140226/98403f1f/attachment.html>


More information about the llvm-commits mailing list