[llvm] 905c58f - [MC] Remove unneeded setBeginSymbol. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 23 17:00:34 PDT 2024


Author: Fangrui Song
Date: 2024-06-23T17:00:29-07:00
New Revision: 905c58f5aa33f1cd6370913bcadcd2e7dd8abbd0

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

LOG: [MC] Remove unneeded setBeginSymbol. NFC

getELFSection ensures that the section symbol exists.

Added: 
    

Modified: 
    llvm/lib/MC/MCParser/ELFAsmParser.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/MCParser/ELFAsmParser.cpp b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
index 773fce5f102b7..bb48ee78248e5 100644
--- a/llvm/lib/MC/MCParser/ELFAsmParser.cpp
+++ b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
@@ -716,16 +716,8 @@ bool ELFAsmParser::ParseSectionArguments(bool IsPush, SMLoc loc) {
       (Section->getFlags() & ELF::SHF_ALLOC) &&
       (Section->getFlags() & ELF::SHF_EXECINSTR)) {
     bool InsertResult = getContext().addGenDwarfSection(Section);
-    if (InsertResult) {
-      if (getContext().getDwarfVersion() <= 2)
-        Warning(loc, "DWARF2 only supports one section per compilation unit");
-
-      if (!Section->getBeginSymbol()) {
-        MCSymbol *SectionStartSymbol = getContext().createTempSymbol();
-        getStreamer().emitLabel(SectionStartSymbol);
-        Section->setBeginSymbol(SectionStartSymbol);
-      }
-    }
+    if (InsertResult && getContext().getDwarfVersion() <= 2)
+      Warning(loc, "DWARF2 only supports one section per compilation unit");
   }
 
   return false;


        


More information about the llvm-commits mailing list