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,15 +53,6 @@ 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")) - list(FIND ARGN "-gen-dag-isel" idx) - if (NOT idx EQUAL -1) - list(APPEND LLVM_TABLEGEN_FLAGS "-omit-comments") - endif() - endif() # MSVC can't support long string literals ("long" > 65534 bytes)[1], so if there's # a possibility of generated tables being consumed by MSVC, generate arrays of diff --git a/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp b/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp --- a/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp +++ b/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp @@ -37,7 +37,12 @@ // To reduce generated source code size. static cl::opt OmitComments("omit-comments", cl::desc("Do not generate comments"), - cl::init(false), cl::cat(DAGISelCat)); +#ifdef NDEBUG + cl::init(true), +#else + cl::init(false), +#endif + cl::cat(DAGISelCat)); static cl::opt InstrumentCoverage( "instrument-coverage",