mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 10:58:11 +08:00
Simplify. NFC.
llvm-svn: 299500
This commit is contained in:
@@ -596,14 +596,10 @@ void LinkerScript::process(BaseCommand &Base) {
|
||||
|
||||
static OutputSection *
|
||||
findSection(StringRef Name, const std::vector<OutputSection *> &Sections) {
|
||||
auto End = Sections.end();
|
||||
auto HasName = [=](OutputSection *Sec) { return Sec->Name == Name; };
|
||||
auto I = std::find_if(Sections.begin(), End, HasName);
|
||||
std::vector<OutputSection *> Ret;
|
||||
if (I == End)
|
||||
return nullptr;
|
||||
assert(std::find_if(I + 1, End, HasName) == End);
|
||||
return *I;
|
||||
for (OutputSection *Sec : Sections)
|
||||
if (Sec->Name == Name)
|
||||
return Sec;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// This function searches for a memory region to place the given output
|
||||
|
||||
Reference in New Issue
Block a user