Skip to content
Snippets Groups Projects
Commit 7f1c266e authored by Rui Ueyama's avatar Rui Ueyama
Browse files

Move a loop invariant outside the loop.

llvm-svn: 315404
parent ac27de9d
No related branches found
No related tags found
No related merge requests found
...@@ -201,13 +201,12 @@ static std::string filename(InputFile *File) { ...@@ -201,13 +201,12 @@ static std::string filename(InputFile *File) {
} }
bool LinkerScript::shouldKeep(InputSectionBase *S) { bool LinkerScript::shouldKeep(InputSectionBase *S) {
for (InputSectionDescription *ID : KeptSections) { std::string Filename = filename(S->File);
std::string Filename = filename(S->File); for (InputSectionDescription *ID : KeptSections)
if (ID->FilePat.match(Filename)) if (ID->FilePat.match(Filename))
for (SectionPattern &P : ID->SectionPatterns) for (SectionPattern &P : ID->SectionPatterns)
if (P.SectionPat.match(S->Name)) if (P.SectionPat.match(S->Name))
return true; return true;
}
return false; return false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment