[llvm] 7722082 - [MC] Maintain MCRelaxAll after reset() (#94945)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 11:41:25 PDT 2024


Author: aengelke
Date: 2024-06-10T20:41:21+02:00
New Revision: 77220823daa06c0e177d7571f73d9b69112861cc

URL: https://github.com/llvm/llvm-project/commit/77220823daa06c0e177d7571f73d9b69112861cc
DIFF: https://github.com/llvm/llvm-project/commit/77220823daa06c0e177d7571f73d9b69112861cc.diff

LOG: [MC] Maintain MCRelaxAll after reset() (#94945)

RelaxAll was set in the constructor, but cleared after reset().

Added: 
    

Modified: 
    llvm/lib/MC/MCObjectStreamer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index 0ccade91677a4..8d3873bed9efd 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -175,8 +175,11 @@ void MCObjectStreamer::emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi,
 }
 
 void MCObjectStreamer::reset() {
-  if (Assembler)
+  if (Assembler) {
     Assembler->reset();
+    if (getContext().getTargetOptions())
+      Assembler->setRelaxAll(getContext().getTargetOptions()->MCRelaxAll);
+  }
   CurInsertionPoint = MCSection::iterator();
   EmitEHFrame = true;
   EmitDebugFrame = false;


        


More information about the llvm-commits mailing list