[lld] r358663 - [wasm] Simplify. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 18 06:33:30 PDT 2019
Author: maskray
Date: Thu Apr 18 06:33:29 2019
New Revision: 358663
URL: http://llvm.org/viewvc/llvm-project?rev=358663&view=rev
Log:
[wasm] Simplify. NFC
Modified:
lld/trunk/wasm/SymbolTable.cpp
lld/trunk/wasm/Writer.cpp
lld/trunk/wasm/WriterUtils.cpp
Modified: lld/trunk/wasm/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/SymbolTable.cpp?rev=358663&r1=358662&r2=358663&view=diff
==============================================================================
--- lld/trunk/wasm/SymbolTable.cpp (original)
+++ lld/trunk/wasm/SymbolTable.cpp Thu Apr 18 06:33:29 2019
@@ -491,7 +491,7 @@ bool SymbolTable::getFunctionVariant(Sym
// Linear search through symbol variants. Should never be more than two
// or three entries here.
auto &Variants = SymVariants[CachedHashStringRef(Sym->getName())];
- if (Variants.size() == 0)
+ if (Variants.empty())
Variants.push_back(Sym);
for (Symbol* V : Variants) {
Modified: lld/trunk/wasm/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/Writer.cpp?rev=358663&r1=358662&r2=358663&view=diff
==============================================================================
--- lld/trunk/wasm/Writer.cpp (original)
+++ lld/trunk/wasm/Writer.cpp Thu Apr 18 06:33:29 2019
@@ -718,12 +718,12 @@ void Writer::createProducersSection() {
}
void Writer::createTargetFeaturesSection() {
- if (TargetFeatures.size() == 0)
+ if (TargetFeatures.empty())
return;
SmallVector<std::string, 8> Emitted(TargetFeatures.begin(),
TargetFeatures.end());
- std::sort(Emitted.begin(), Emitted.end());
+ llvm::sort(Emitted);
SyntheticSection *Section =
createSyntheticSection(WASM_SEC_CUSTOM, "target_features");
auto &OS = Section->getStream();
Modified: lld/trunk/wasm/WriterUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/WriterUtils.cpp?rev=358663&r1=358662&r2=358663&view=diff
==============================================================================
--- lld/trunk/wasm/WriterUtils.cpp (original)
+++ lld/trunk/wasm/WriterUtils.cpp Thu Apr 18 06:33:29 2019
@@ -196,7 +196,7 @@ std::string lld::toString(const WasmSign
S += toString(Type);
}
S += ") -> ";
- if (Sig.Returns.size() == 0)
+ if (Sig.Returns.empty())
S += "void";
else
S += toString(Sig.Returns[0]);
More information about the llvm-commits
mailing list