From: George Rimar Date: Thu, 21 Jul 2016 07:48:54 +0000 (+0000) Subject: [ELF] - Linkerscript: remove excessive ScriptConfiguration::Filler field X-Git-Tag: llvmorg-4.0.0-rc1~14661 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6c3ccef5ed51587bb60bbe245c10874fcd08d75;p=platform%2Fupstream%2Fllvm.git [ELF] - Linkerscript: remove excessive ScriptConfiguration::Filler field Previously OutputSectionCommand::Filler was introduced, but unused. Patch fixes that. Differential revision: https://reviews.llvm.org/D22615 llvm-svn: 276253 --- diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 85bfae7..7fa953d 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -410,10 +410,11 @@ LinkerScript::createPhdrs(ArrayRef *> Sections) { template ArrayRef LinkerScript::getFiller(StringRef Name) { - auto I = Opt.Filler.find(Name); - if (I == Opt.Filler.end()) - return {}; - return I->second; + for (const std::unique_ptr &Base : Opt.Commands) + if (auto *Cmd = dyn_cast(Base.get())) + if (Cmd->Name == Name) + return Cmd->Filler; + return {}; } // Returns the index of the given section name in linker script @@ -754,7 +755,7 @@ void ScriptParser::readOutputSectionDescription(StringRef OutSec) { return; } Tok = Tok.substr(3); - Opt.Filler[OutSec] = parseHex(Tok); + Cmd->Filler = parseHex(Tok); next(); } } diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h index 20ab4be0..104cfca 100644 --- a/lld/ELF/LinkerScript.h +++ b/lld/ELF/LinkerScript.h @@ -86,9 +86,6 @@ struct ScriptConfiguration { // SECTIONS commands. std::vector Sections; - // Section fill attribute for each section. - llvm::StringMap> Filler; - // Used to assign addresses to sections. std::vector> Commands;