[lld] 077b16a - [ELF] Remove unneeded make<InputSection>. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 21:51:44 PDT 2022


Author: Fangrui Song
Date: 2022-08-03T21:51:39-07:00
New Revision: 077b16aa6cc488a5ad3db2f607ba74647420bb54

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

LOG: [ELF] Remove unneeded make<InputSection>. NFC

Added: 
    

Modified: 
    lld/ELF/InputFiles.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 77dc7508d06e..378023abc192 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -871,8 +871,8 @@ InputSectionBase *ObjFile<ELFT>::createInputSection(uint32_t idx,
     if (Error e = attributes.parse(contents, config->ekind == ELF32LEKind
                                                  ? support::little
                                                  : support::big)) {
-      auto *isec = make<InputSection>(*this, sec, name);
-      warn(toString(isec) + ": " + llvm::toString(std::move(e)));
+      InputSection isec(*this, sec, name);
+      warn(toString(&isec) + ": " + llvm::toString(std::move(e)));
     } else {
       updateSupportedARMFeatures(attributes);
       updateARMVFPArgs(attributes, this);
@@ -893,8 +893,8 @@ InputSectionBase *ObjFile<ELFT>::createInputSection(uint32_t idx,
     RISCVAttributeParser attributes;
     ArrayRef<uint8_t> contents = check(this->getObj().getSectionContents(sec));
     if (Error e = attributes.parse(contents, support::little)) {
-      auto *isec = make<InputSection>(*this, sec, name);
-      warn(toString(isec) + ": " + llvm::toString(std::move(e)));
+      InputSection isec(*this, sec, name);
+      warn(toString(&isec) + ": " + llvm::toString(std::move(e)));
     } else {
       // FIXME: Validate arch tag contains C if and only if EF_RISCV_RVC is
       // present.


        


More information about the llvm-commits mailing list