forked from OSchip/llvm-project
Add an early return.
Total memory allocation when linking clang goes from 281.80MB to 270.96MB. llvm-svn: 319930
This commit is contained in:
parent
e85b4df435
commit
0ab9d8b6ed
|
@ -184,6 +184,8 @@ static std::string getFilename(InputFile *File) {
|
|||
}
|
||||
|
||||
bool LinkerScript::shouldKeep(InputSectionBase *S) {
|
||||
if (KeptSections.empty())
|
||||
return false;
|
||||
std::string Filename = getFilename(S->File);
|
||||
for (InputSectionDescription *ID : KeptSections)
|
||||
if (ID->FilePat.match(Filename))
|
||||
|
|
Loading…
Reference in New Issue