[llvm] r324504 - Generate PDB files for profiling even in Release build.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 11:37:52 PST 2018


Author: zturner
Date: Wed Feb  7 11:37:52 2018
New Revision: 324504

URL: http://llvm.org/viewvc/llvm-project?rev=324504&view=rev
Log:
Generate PDB files for profiling even in Release build.

This patch enables PDB generation for Release build, which has
slightly different optimize option with RelWithDebInfo on windows.

This helps to know slow part of Release build when profiling.

Patch by Takuto Ikuta
Differential Revision: https://reviews.llvm.org/D42632

Modified:
    llvm/trunk/cmake/modules/HandleLLVMOptions.cmake

Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=324504&r1=324503&r2=324504&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Wed Feb  7 11:37:52 2018
@@ -353,6 +353,12 @@ if( MSVC )
 
   append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
 
+  # Generate PDB even in release for profiling.
+  if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
+    append("/Zi" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    append("/DEBUG" CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  endif (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
+
   # /Zc:strictStrings is incompatible with VS12's (Visual Studio 2013's)
   # debug mode headers. Instead of only enabling them in VS2013's debug mode,
   # we'll just enable them for Visual Studio 2015 (VS 14, MSVC_VERSION 1900)




More information about the llvm-commits mailing list