diff options
-rw-r--r-- | lld/wasm/Driver.cpp | 4 | ||||
-rw-r--r-- | lld/wasm/InputChunks.cpp | 6 | ||||
-rw-r--r-- | lld/wasm/InputChunks.h | 5 | ||||
-rw-r--r-- | lld/wasm/InputFiles.h | 2 | ||||
-rw-r--r-- | lld/wasm/OutputSections.cpp | 5 | ||||
-rw-r--r-- | lld/wasm/SymbolTable.h | 2 | ||||
-rw-r--r-- | lld/wasm/Symbols.h | 6 | ||||
-rw-r--r-- | lld/wasm/Writer.cpp | 16 | ||||
-rw-r--r-- | lld/wasm/WriterUtils.cpp | 2 |
9 files changed, 25 insertions, 23 deletions
diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp index e68a7ce7056..ef0794c3073 100644 --- a/lld/wasm/Driver.cpp +++ b/lld/wasm/Driver.cpp @@ -310,7 +310,7 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) { &NullSignature); // Handle the `--undefined <sym>` options. - for (auto* Arg : Args.filtered(OPT_undefined)) + for (auto *Arg : Args.filtered(OPT_undefined)) Symtab->addUndefinedFunction(Arg->getValue(), 0, nullptr, nullptr); } @@ -331,7 +331,7 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) { // -u/--undefined since these undefined symbols have only names and no // function signature, which means they cannot be written to the final // output. - for (auto* Arg : Args.filtered(OPT_undefined)) { + for (auto *Arg : Args.filtered(OPT_undefined)) { Symbol *Sym = Symtab->find(Arg->getValue()); if (!Sym->isDefined()) error("function forced with --undefined not found: " + Sym->getName()); diff --git a/lld/wasm/InputChunks.cpp b/lld/wasm/InputChunks.cpp index 546fb516b4a..f5df6eb0eb1 100644 --- a/lld/wasm/InputChunks.cpp +++ b/lld/wasm/InputChunks.cpp @@ -104,13 +104,15 @@ void InputChunk::writeRelocations(raw_ostream &OS) const { } void InputFunction::setOutputIndex(uint32_t Index) { - DEBUG(dbgs() << "InputFunction::setOutputIndex: " << getName() << " -> " << Index << "\n"); + DEBUG(dbgs() << "InputFunction::setOutputIndex: " << getName() << " -> " + << Index << "\n"); assert(!hasOutputIndex()); OutputIndex = Index; } void InputFunction::setTableIndex(uint32_t Index) { - DEBUG(dbgs() << "InputFunction::setTableIndex: " << getName() << " -> " << Index << "\n"); + DEBUG(dbgs() << "InputFunction::setTableIndex: " << getName() << " -> " + << Index << "\n"); assert(!hasTableIndex()); TableIndex = Index; } diff --git a/lld/wasm/InputChunks.h b/lld/wasm/InputChunks.h index 1aadbe90d49..72203095918 100644 --- a/lld/wasm/InputChunks.h +++ b/lld/wasm/InputChunks.h @@ -26,11 +26,11 @@ #include "lld/Common/ErrorHandler.h" #include "llvm/Object/Wasm.h" +using llvm::object::WasmSection; using llvm::object::WasmSegment; using llvm::wasm::WasmFunction; using llvm::wasm::WasmRelocation; using llvm::wasm::WasmSignature; -using llvm::object::WasmSection; namespace llvm { class raw_ostream; @@ -116,8 +116,7 @@ protected: // combined to create the final output CODE section. class InputFunction : public InputChunk { public: - InputFunction(const WasmSignature &S, const WasmFunction *Func, - ObjFile *F) + InputFunction(const WasmSignature &S, const WasmFunction *Func, ObjFile *F) : InputChunk(F, InputChunk::Function), Signature(S), Function(Func) {} static bool classof(const InputChunk *C) { diff --git a/lld/wasm/InputFiles.h b/lld/wasm/InputFiles.h index 97d41d8150c..478820195bb 100644 --- a/lld/wasm/InputFiles.h +++ b/lld/wasm/InputFiles.h @@ -25,8 +25,8 @@ using llvm::object::WasmSection; using llvm::object::WasmSymbol; using llvm::wasm::WasmGlobal; using llvm::wasm::WasmImport; -using llvm::wasm::WasmSignature; using llvm::wasm::WasmRelocation; +using llvm::wasm::WasmSignature; namespace lld { namespace wasm { diff --git a/lld/wasm/OutputSections.cpp b/lld/wasm/OutputSections.cpp index 915f0aa3b3e..9683a2d340d 100644 --- a/lld/wasm/OutputSections.cpp +++ b/lld/wasm/OutputSections.cpp @@ -108,9 +108,8 @@ void CodeSection::writeTo(uint8_t *Buf) { memcpy(Buf, CodeSectionHeader.data(), CodeSectionHeader.size()); // Write code section bodies - parallelForEach(Functions, [&](const InputChunk *Chunk) { - Chunk->writeTo(Buf); - }); + parallelForEach(Functions, + [&](const InputChunk *Chunk) { Chunk->writeTo(Buf); }); } uint32_t CodeSection::numRelocations() const { diff --git a/lld/wasm/SymbolTable.h b/lld/wasm/SymbolTable.h index 466ed101c5d..a4d1851d4fc 100644 --- a/lld/wasm/SymbolTable.h +++ b/lld/wasm/SymbolTable.h @@ -16,8 +16,8 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/Support/raw_ostream.h" -using llvm::wasm::WasmSignature; using llvm::wasm::WasmGlobalType; +using llvm::wasm::WasmSignature; namespace lld { namespace wasm { diff --git a/lld/wasm/Symbols.h b/lld/wasm/Symbols.h index 90e62e5af11..103a301066a 100644 --- a/lld/wasm/Symbols.h +++ b/lld/wasm/Symbols.h @@ -16,9 +16,9 @@ using llvm::object::Archive; using llvm::object::WasmSymbol; -using llvm::wasm::WasmSignature; using llvm::wasm::WasmGlobal; using llvm::wasm::WasmGlobalType; +using llvm::wasm::WasmSignature; using llvm::wasm::WasmSymbolType; namespace lld { @@ -48,8 +48,8 @@ public: Kind kind() const { return SymbolKind; } bool isDefined() const { - return SymbolKind == DefinedFunctionKind || - SymbolKind == DefinedDataKind || SymbolKind == DefinedGlobalKind; + return SymbolKind == DefinedFunctionKind || SymbolKind == DefinedDataKind || + SymbolKind == DefinedGlobalKind; } bool isUndefined() const { diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index d936afe5975..5e645b66a48 100644 --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -93,8 +93,7 @@ private: void layoutMemory(); void createHeader(); void createSections(); - SyntheticSection *createSyntheticSection(uint32_t Type, - StringRef Name = ""); + SyntheticSection *createSyntheticSection(uint32_t Type, StringRef Name = ""); // Builtin sections void createTypeSection(); @@ -472,8 +471,11 @@ void Writer::createLinkingSection() { Sub.writeTo(OS); } - struct ComdatEntry { unsigned Kind; uint32_t Index; }; - std::map<StringRef,std::vector<ComdatEntry>> Comdats; + struct ComdatEntry { + unsigned Kind; + uint32_t Index; + }; + std::map<StringRef, std::vector<ComdatEntry>> Comdats; for (const InputFunction *F : InputFunctions) { StringRef Comdat = F->getComdat(); @@ -873,9 +875,9 @@ void Writer::createCtorFunction() { } const WasmSignature *Sig = WasmSym::CallCtors->getFunctionType(); - SyntheticFunction *F = make<SyntheticFunction>( - *Sig, toArrayRef(Saver.save(FunctionBody)), - WasmSym::CallCtors->getName()); + SyntheticFunction *F = + make<SyntheticFunction>(*Sig, toArrayRef(Saver.save(FunctionBody)), + WasmSym::CallCtors->getName()); F->setOutputIndex(FunctionIndex); F->Live = true; diff --git a/lld/wasm/WriterUtils.cpp b/lld/wasm/WriterUtils.cpp index e2494b58b68..5f7b4a2c1b8 100644 --- a/lld/wasm/WriterUtils.cpp +++ b/lld/wasm/WriterUtils.cpp @@ -195,5 +195,5 @@ std::string lld::toString(const WasmSignature &Sig) { std::string lld::toString(const WasmGlobalType &Sig) { return (Sig.Mutable ? "var " : "const ") + - toString(static_cast<ValType>(Sig.Type)); + toString(static_cast<ValType>(Sig.Type)); } |