From 1079f1c6eaa686b3010fd7c43cf71fc355ec6e69 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Wed, 28 Sep 2022 15:57:19 -0700 Subject: [PATCH] [lld][COFF][LTO] Don't disable verifier in assert builds We should catch more issues this way. This previously the behavior and was dropped in cde5e5b600b06. Reviewed By: hans Differential Revision: https://reviews.llvm.org/D134839 --- lld/COFF/LTO.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lld/COFF/LTO.cpp b/lld/COFF/LTO.cpp index a66cbca6123f..12ba1976b21e 100644 --- a/lld/COFF/LTO.cpp +++ b/lld/COFF/LTO.cpp @@ -76,7 +76,11 @@ static lto::Config createConfig() { c.RelocModel = Reloc::Static; else c.RelocModel = Reloc::PIC_; +#ifndef NDEBUG + c.DisableVerify = false; +#else c.DisableVerify = true; +#endif c.DiagHandler = diagnosticHandler; c.OptLevel = config->ltoo; c.CPU = getCPUStr();