Skip to content

Commit 59844ee

Browse files
committed
formatting fixes
1 parent 0304b6d commit 59844ee

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

lld/wasm/Driver.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,8 @@ static void createSyntheticSymbols() {
964964
// See:
965965
// https://github.com/WebAssembly/tool-conventions/blob/main/DynamicLinking.md
966966
auto *globalType = is64 ? &globalTypeI64 : &globalTypeI32;
967-
ctx.wasmSym->memoryBase = createUndefinedGlobal("__memory_base", globalType);
967+
ctx.wasmSym->memoryBase =
968+
createUndefinedGlobal("__memory_base", globalType);
968969
ctx.wasmSym->tableBase = createUndefinedGlobal("__table_base", globalType);
969970
ctx.wasmSym->memoryBase->markLive();
970971
ctx.wasmSym->tableBase->markLive();
@@ -980,9 +981,8 @@ static void createSyntheticSymbols() {
980981
ctx.wasmSym->tlsAlign = createGlobalVariable("__tls_align", false);
981982
ctx.wasmSym->initTLS = symtab->addSyntheticFunction(
982983
"__wasm_init_tls", WASM_SYMBOL_VISIBILITY_HIDDEN,
983-
make<SyntheticFunction>(
984-
is64 ? i64ArgSignature : i32ArgSignature,
985-
"__wasm_init_tls"));
984+
make<SyntheticFunction>(is64 ? i64ArgSignature : i32ArgSignature,
985+
"__wasm_init_tls"));
986986
}
987987
}
988988

@@ -1001,8 +1001,10 @@ static void createOptionalSymbols() {
10011001
ctx.wasmSym->globalBase = symtab->addOptionalDataSymbol("__global_base");
10021002
ctx.wasmSym->heapBase = symtab->addOptionalDataSymbol("__heap_base");
10031003
ctx.wasmSym->heapEnd = symtab->addOptionalDataSymbol("__heap_end");
1004-
ctx.wasmSym->definedMemoryBase = symtab->addOptionalDataSymbol("__memory_base");
1005-
ctx.wasmSym->definedTableBase = symtab->addOptionalDataSymbol("__table_base");
1004+
ctx.wasmSym->definedMemoryBase =
1005+
symtab->addOptionalDataSymbol("__memory_base");
1006+
ctx.wasmSym->definedTableBase =
1007+
symtab->addOptionalDataSymbol("__table_base");
10061008
}
10071009

10081010
ctx.wasmSym->firstPageEnd =

lld/wasm/InputChunks.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,8 @@ bool InputChunk::generateRelocationCode(raw_ostream &os) const {
413413
if (isTLS())
414414
writeUleb128(os, ctx.wasmSym->tlsBase->getGlobalIndex(), "tls_base");
415415
else
416-
writeUleb128(os, ctx.wasmSym->memoryBase->getGlobalIndex(), "memory_base");
416+
writeUleb128(os, ctx.wasmSym->memoryBase->getGlobalIndex(),
417+
"memory_base");
417418
writeU8(os, opcode_ptr_add, "ADD");
418419
}
419420

@@ -436,7 +437,7 @@ bool InputChunk::generateRelocationCode(raw_ostream &os) const {
436437
}
437438
} else {
438439
assert(ctx.isPic);
439-
const GlobalSymbol* baseSymbol = ctx.wasmSym->memoryBase;
440+
const GlobalSymbol *baseSymbol = ctx.wasmSym->memoryBase;
440441
if (rel.Type == R_WASM_TABLE_INDEX_I32 ||
441442
rel.Type == R_WASM_TABLE_INDEX_I64)
442443
baseSymbol = ctx.wasmSym->tableBase;

lld/wasm/OutputSections.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ void DataSection::finalizeContents() {
137137
if (ctx.isPic) {
138138
assert(segment->startVA == 0);
139139
initExpr.Inst.Opcode = WASM_OPCODE_GLOBAL_GET;
140-
initExpr.Inst.Value.Global = ctx.wasmSym->memoryBase->getGlobalIndex();
140+
initExpr.Inst.Value.Global =
141+
ctx.wasmSym->memoryBase->getGlobalIndex();
141142
} else {
142143
initExpr = intConst(segment->startVA, is64);
143144
}

lld/wasm/SyntheticSections.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,8 @@ void GlobalSection::generateRelocationCode(raw_ostream &os, bool TLS) const {
456456
continue;
457457
// Get __table_base
458458
writeU8(os, WASM_OPCODE_GLOBAL_GET, "GLOBAL_GET");
459-
writeUleb128(os, ctx.wasmSym->tableBase->getGlobalIndex(), "__table_base");
459+
writeUleb128(os, ctx.wasmSym->tableBase->getGlobalIndex(),
460+
"__table_base");
460461

461462
// Add the table index to __table_base
462463
writeU8(os, opcode_ptr_const, "CONST");

lld/wasm/Writer.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,8 @@ static void finalizeIndirectFunctionTable() {
936936

937937
uint32_t tableSize = ctx.arg.tableBase + out.elemSec->numEntries();
938938
WasmLimits limits = {0, tableSize, 0, 0};
939-
if (ctx.wasmSym->indirectFunctionTable->isDefined() && !ctx.arg.growableTable) {
939+
if (ctx.wasmSym->indirectFunctionTable->isDefined() &&
940+
!ctx.arg.growableTable) {
940941
limits.Flags |= WASM_LIMITS_FLAG_HAS_MAX;
941942
limits.Maximum = limits.Minimum;
942943
}
@@ -1182,8 +1183,7 @@ void Writer::createSyntheticInitFunctions() {
11821183
if (llvm::any_of(segments, hasTLSRelocs)) {
11831184
ctx.wasmSym->applyTLSRelocs = symtab->addSyntheticFunction(
11841185
"__wasm_apply_tls_relocs", WASM_SYMBOL_VISIBILITY_HIDDEN,
1185-
make<SyntheticFunction>(nullSignature,
1186-
"__wasm_apply_tls_relocs"));
1186+
make<SyntheticFunction>(nullSignature, "__wasm_apply_tls_relocs"));
11871187
ctx.wasmSym->applyTLSRelocs->markLive();
11881188
}
11891189
}
@@ -1286,7 +1286,8 @@ void Writer::createInitMemoryFunction() {
12861286
writeUleb128(os, 2, "local count");
12871287
writeU8(os, is64 ? WASM_TYPE_I64 : WASM_TYPE_I32, "address type");
12881288
writeU8(os, WASM_OPCODE_GLOBAL_GET, "GLOBAL_GET");
1289-
writeUleb128(os, ctx.wasmSym->memoryBase->getGlobalIndex(), "memory_base");
1289+
writeUleb128(os, ctx.wasmSym->memoryBase->getGlobalIndex(),
1290+
"memory_base");
12901291
writePtrConst(os, flagAddress, is64, "flag address");
12911292
writeU8(os, is64 ? WASM_OPCODE_I64_ADD : WASM_OPCODE_I32_ADD, "add");
12921293
writeU8(os, WASM_OPCODE_LOCAL_SET, "local.set");

0 commit comments

Comments
 (0)