From 84fe490be27fc2e5d338bad88ee734ed9743b2ec Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Fri, 7 Jun 2024 09:52:01 -0700 Subject: [PATCH] [BOLT][NFC] Unset UseAssemblerInfoForParsing for emission Summary: Use workaround for quadratic behavior inside AttemptToFoldSymbolOffsetDifference called from BinaryEmitter::emitLSDA. https://github.com/llvm/llvm-project/commit/b06e736982a3568fe2bcea8688550f9e393b7450#commitcomment-142836456 --- bolt/lib/Core/BinaryEmitter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bolt/lib/Core/BinaryEmitter.cpp b/bolt/lib/Core/BinaryEmitter.cpp index 0b44acb0816f2..5793963f9b80d 100644 --- a/bolt/lib/Core/BinaryEmitter.cpp +++ b/bolt/lib/Core/BinaryEmitter.cpp @@ -194,6 +194,7 @@ class BinaryEmitter { void BinaryEmitter::emitAll(StringRef OrgSecPrefix) { Streamer.initSections(false, *BC.STI); + Streamer.setUseAssemblerInfoForParsing(false); if (opts::UpdateDebugSections && BC.isELF()) { // Force the emission of debug line info into allocatable section to ensure @@ -226,6 +227,7 @@ void BinaryEmitter::emitAll(StringRef OrgSecPrefix) { // TODO Enable for Mach-O once BinaryContext::getDataSection supports it. if (BC.isELF()) AddressMap::emit(Streamer, BC); + Streamer.setUseAssemblerInfoForParsing(true); } void BinaryEmitter::emitFunctions() {