mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 02:21:45 +00:00
ELF: Simplify. NFCI.
We don't need to take a slice of SectionCommands in addOrphanSections() because it is not modified until the end of the function. Differential Revision: https://reviews.llvm.org/D59239 llvm-svn: 355954
This commit is contained in:
parent
18408d5e79
commit
2da7b32684
@ -636,7 +636,6 @@ static OutputSection *addInputSec(StringMap<OutputSection *> &Map,
|
||||
|
||||
// Add sections that didn't match any sections command.
|
||||
void LinkerScript::addOrphanSections() {
|
||||
unsigned End = SectionCommands.size();
|
||||
StringMap<OutputSection *> Map;
|
||||
std::vector<OutputSection *> V;
|
||||
|
||||
@ -651,8 +650,7 @@ void LinkerScript::addOrphanSections() {
|
||||
else if (Config->OrphanHandling == OrphanHandlingPolicy::Warn)
|
||||
warn(toString(S) + " is being placed in '" + Name + "'");
|
||||
|
||||
if (OutputSection *Sec =
|
||||
findByName(makeArrayRef(SectionCommands).slice(0, End), Name)) {
|
||||
if (OutputSection *Sec = findByName(SectionCommands, Name)) {
|
||||
Sec->addSection(cast<InputSection>(S));
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user