diff --git a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn --- a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn @@ -329,7 +329,6 @@ "LLVM_HAVE_TFLITE=", "LLVM_HOST_TRIPLE=$llvm_current_triple", "LLVM_NATIVE_ARCH=$native_target", - "LLVM_UNREACHABLE_OPTIMIZE=1", "LLVM_USE_INTEL_JITEVENTS=", "LLVM_USE_OPROFILE=", "LLVM_USE_PERF=", @@ -340,6 +339,12 @@ "PACKAGE_VERSION=${llvm_version}git", ] + if (llvm_enable_assertions) { + values += [ "LLVM_UNREACHABLE_OPTIMIZE=" ] + } else { + values += [ "LLVM_UNREACHABLE_OPTIMIZE=1" ] + } + if (llvm_build_native) { values += [ "LLVM_NATIVE_ASMPARSER=1",