projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e85b4df
)
Add an early return.
author
Rafael Espindola
<rafael.espindola@gmail.com>
Wed, 6 Dec 2017 19:13:23 +0000
(19:13 +0000)
committer
Rafael Espindola
<rafael.espindola@gmail.com>
Wed, 6 Dec 2017 19:13:23 +0000
(19:13 +0000)
Total memory allocation when linking clang goes from 281.80MB to
270.96MB.
llvm-svn: 319930
lld/ELF/LinkerScript.cpp
patch
|
blob
|
history
diff --git
a/lld/ELF/LinkerScript.cpp
b/lld/ELF/LinkerScript.cpp
index 7db282bdb72146252536aeb9ec978e11b732c02e..f301afc403173c04650acdf82b323eb238d21444 100644
(file)
--- a/
lld/ELF/LinkerScript.cpp
+++ b/
lld/ELF/LinkerScript.cpp
@@
-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))