[llvm] e7622ab - [MC] Remove unused MCObjectStreamer::CurSubsectionIdx. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 22 23:23:52 PDT 2024


Author: Fangrui Song
Date: 2024-06-22T23:23:47-07:00
New Revision: e7622ab4721141d9e6af6041fa7f9bbc1029e9aa

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

LOG: [MC] Remove unused MCObjectStreamer::CurSubsectionIdx. NFC

Added: 
    

Modified: 
    llvm/include/llvm/MC/MCObjectStreamer.h
    llvm/lib/MC/MCObjectStreamer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/MC/MCObjectStreamer.h b/llvm/include/llvm/MC/MCObjectStreamer.h
index a9c0c71ae88a7..1d1af6f48d2ef 100644
--- a/llvm/include/llvm/MC/MCObjectStreamer.h
+++ b/llvm/include/llvm/MC/MCObjectStreamer.h
@@ -43,7 +43,6 @@ class MCObjectStreamer : public MCStreamer {
   std::unique_ptr<MCAssembler> Assembler;
   bool EmitEHFrame;
   bool EmitDebugFrame;
-  unsigned CurSubsectionIdx = 0;
   struct PendingMCFixup {
     const MCSymbol *Sym;
     MCFixup Fixup;

diff  --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index 25c576865bfe2..5dc73c5b7887a 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -295,8 +295,7 @@ bool MCObjectStreamer::changeSectionImpl(MCSection *Section,
   getContext().clearDwarfLocSeen();
 
   bool Created = getAssembler().registerSection(*Section);
-  CurSubsectionIdx = Subsection;
-  Section->switchSubsection(CurSubsectionIdx);
+  Section->switchSubsection(Subsection);
   return Created;
 }
 


        


More information about the llvm-commits mailing list