diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -646,6 +646,11 @@ set(LLVM_USE_HOST_TOOLS ON) endif() +option(LLVM_OMIT_DAGISEL_COMMENTS "Do not add comments to DAG ISel" ON) +if(CMAKE_BUILD_TYPE AND uppercase_CMAKE_BUILD_TYPE MATCHES "^(RELWITHDEBINFO|DEBUG)$") + set(LLVM_OMIT_DAGISEL_COMMENTS OFF) +endif() + if (MSVC_IDE) option(LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION "Configure project to use Visual Studio native visualizers" TRUE) endif() diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake --- a/llvm/cmake/modules/TableGen.cmake +++ b/llvm/cmake/modules/TableGen.cmake @@ -53,10 +53,7 @@ list(APPEND LLVM_TABLEGEN_FLAGS "-gisel-coverage-file=${LLVM_GISEL_COV_PREFIX}all") endif() endif() - # Comments are only useful for Debug builds. Omit them if the backend - # supports it. - if (NOT (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR - uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")) + if (LLVM_OMIT_DAGISEL_COMMENTS) list(FIND ARGN "-gen-dag-isel" idx) if (NOT idx EQUAL -1) list(APPEND LLVM_TABLEGEN_FLAGS "-omit-comments")