[lld] r321103 - [WebAssembly] Fix a couple of typos. NFC.
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 19 11:56:27 PST 2017
Author: sbc
Date: Tue Dec 19 11:56:27 2017
New Revision: 321103
URL: http://llvm.org/viewvc/llvm-project?rev=321103&view=rev
Log:
[WebAssembly] Fix a couple of typos. NFC.
Also remove unneeded braces and old comment.
Modified:
lld/trunk/wasm/Writer.cpp
Modified: lld/trunk/wasm/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/Writer.cpp?rev=321103&r1=321102&r2=321103&view=diff
==============================================================================
--- lld/trunk/wasm/Writer.cpp (original)
+++ lld/trunk/wasm/Writer.cpp Tue Dec 19 11:56:27 2017
@@ -174,7 +174,7 @@ void Writer::createImportSection() {
Import.Field = Sym->getName();
Import.Kind = WASM_EXTERNAL_GLOBAL;
Import.Global.Mutable = false;
- Import.Global.Type = WASM_TYPE_I32; // Sym->getGlobalType();
+ Import.Global.Type = WASM_TYPE_I32;
writeImport(OS, Import);
}
}
@@ -183,9 +183,8 @@ void Writer::createTypeSection() {
SyntheticSection *Section = createSyntheticSection(WASM_SEC_TYPE);
raw_ostream &OS = Section->getStream();
writeUleb128(OS, Types.size(), "type count");
- for (const WasmSignature *Sig : Types) {
+ for (const WasmSignature *Sig : Types)
writeSig(OS, *Sig);
- }
}
void Writer::createFunctionSection() {
@@ -196,11 +195,9 @@ void Writer::createFunctionSection() {
raw_ostream &OS = Section->getStream();
writeUleb128(OS, NumFunctions, "function count");
- for (ObjFile *File : Symtab->ObjectFiles) {
- for (uint32_t Sig : File->getWasmObj()->functionTypes()) {
+ for (ObjFile *File : Symtab->ObjectFiles)
+ for (uint32_t Sig : File->getWasmObj()->functionTypes())
writeUleb128(OS, File->relocateTypeIndex(Sig), "sig index");
- }
- }
}
void Writer::createMemorySection() {
@@ -358,7 +355,7 @@ void Writer::createDataSection() {
OutputSections.push_back(Section);
}
-// Create reloctions sections in the final output.
+// Create relocations sections in the final output.
// These are only created when relocatable output is requested.
void Writer::createRelocSections() {
log("createRelocSections");
@@ -376,7 +373,7 @@ void Writer::createRelocSections() {
else if (S->Type == WASM_SEC_CODE)
name = "reloc.CODE";
else
- llvm_unreachable("relocations only support for code and data");
+ llvm_unreachable("relocations only supported for code and data");
SyntheticSection *Section = createSyntheticSection(WASM_SEC_CUSTOM, name);
raw_ostream &OS = Section->getStream();
@@ -417,10 +414,9 @@ void Writer::createLinkingSection() {
for (ObjFile *File : Symtab->ObjectFiles) {
const WasmLinkingData &L = File->getWasmObj()->linkingData();
InitFunctions.reserve(InitFunctions.size() + L.InitFunctions.size());
- for (const WasmInitFunc &F : L.InitFunctions) {
+ for (const WasmInitFunc &F : L.InitFunctions)
InitFunctions.emplace_back(WasmInitFunc{
F.Priority, File->relocateFunctionIndex(F.FunctionIndex)});
- }
}
if (!InitFunctions.empty()) {
More information about the llvm-commits
mailing list