[lld] r332952 - [ELF] Simplify. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon May 21 23:28:00 PDT 2018
Author: maskray
Date: Mon May 21 23:28:00 2018
New Revision: 332952
URL: http://llvm.org/viewvc/llvm-project?rev=332952&view=rev
Log:
[ELF] Simplify. NFC
Modified:
lld/trunk/ELF/LTO.cpp
Modified: lld/trunk/ELF/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.cpp?rev=332952&r1=332951&r2=332952&view=diff
==============================================================================
--- lld/trunk/ELF/LTO.cpp (original)
+++ lld/trunk/ELF/LTO.cpp Mon May 21 23:28:00 2018
@@ -155,8 +155,8 @@ BitcodeCompiler::BitcodeCompiler() {
for (Symbol *Sym : Symtab->getSymbols()) {
StringRef Name = Sym->getName();
for (StringRef Prefix : {"__start_", "__stop_"})
- if (Name.startswith(Prefix))
- UsedStartStop.insert(Name.substr(Prefix.size()));
+ if (Name.consume_front(Prefix))
+ UsedStartStop.insert(Name);
}
}
More information about the llvm-commits
mailing list