@@ -124,8 +124,8 @@ void DylinkSection::writeBody() {
124
124
125
125
for (const Symbol *sym : importInfo) {
126
126
LLVM_DEBUG (llvm::dbgs () << " imports info: " << toString (*sym) << " \n " );
127
- StringRef module = sym->importModule .getValueOr (defaultModule);
128
- StringRef name = sym->importName .getValueOr (sym->getName ());
127
+ StringRef module = sym->importModule .value_or (defaultModule);
128
+ StringRef name = sym->importName .value_or (sym->getName ());
129
129
writeStr (sub.os , module, " import module" );
130
130
writeStr (sub.os , name, " import name" );
131
131
writeUleb128 (sub.os , sym->flags , " sym flags" );
@@ -184,8 +184,8 @@ void ImportSection::addGOTEntry(Symbol *sym) {
184
184
185
185
void ImportSection::addImport (Symbol *sym) {
186
186
assert (!isSealed);
187
- StringRef module = sym->importModule .getValueOr (defaultModule);
188
- StringRef name = sym->importName .getValueOr (sym->getName ());
187
+ StringRef module = sym->importModule .value_or (defaultModule);
188
+ StringRef name = sym->importName .value_or (sym->getName ());
189
189
if (auto *f = dyn_cast<FunctionSymbol>(sym)) {
190
190
ImportKey<WasmSignature> key (*(f->getSignature ()), module, name);
191
191
auto entry = importedFunctions.try_emplace (key, numImportedFunctions);
@@ -232,7 +232,7 @@ void ImportSection::writeBody() {
232
232
233
233
writeUleb128 (os, getNumImports (), " import count" );
234
234
235
- bool is64 = config->is64 .getValueOr (false );
235
+ bool is64 = config->is64 .value_or (false );
236
236
237
237
if (config->importMemory ) {
238
238
WasmImport import;
@@ -254,8 +254,8 @@ void ImportSection::writeBody() {
254
254
255
255
for (const Symbol *sym : importedSymbols) {
256
256
WasmImport import;
257
- import.Field = sym->importName .getValueOr (sym->getName ());
258
- import.Module = sym->importModule .getValueOr (defaultModule);
257
+ import.Field = sym->importName .value_or (sym->getName ());
258
+ import.Module = sym->importModule .value_or (defaultModule);
259
259
260
260
if (auto *functionSym = dyn_cast<FunctionSymbol>(sym)) {
261
261
import.Kind = WASM_EXTERNAL_FUNCTION;
@@ -357,7 +357,7 @@ void MemorySection::writeBody() {
357
357
flags |= WASM_LIMITS_FLAG_HAS_MAX;
358
358
if (config->sharedMemory )
359
359
flags |= WASM_LIMITS_FLAG_IS_SHARED;
360
- if (config->is64 .getValueOr (false ))
360
+ if (config->is64 .value_or (false ))
361
361
flags |= WASM_LIMITS_FLAG_IS_64;
362
362
writeUleb128 (os, flags, " memory limits flags" );
363
363
writeUleb128 (os, numMemoryPages, " initial pages" );
@@ -415,7 +415,7 @@ void GlobalSection::addInternalGOTEntry(Symbol *sym) {
415
415
416
416
void GlobalSection::generateRelocationCode (raw_ostream &os, bool TLS) const {
417
417
assert (!config->extendedConst );
418
- bool is64 = config->is64 .getValueOr (false );
418
+ bool is64 = config->is64 .value_or (false );
419
419
unsigned opcode_ptr_const = is64 ? WASM_OPCODE_I64_CONST
420
420
: WASM_OPCODE_I32_CONST;
421
421
unsigned opcode_ptr_add = is64 ? WASM_OPCODE_I64_ADD
@@ -465,7 +465,7 @@ void GlobalSection::writeBody() {
465
465
writeGlobalType (os, g->getType ());
466
466
writeInitExpr (os, g->getInitExpr ());
467
467
}
468
- bool is64 = config->is64 .getValueOr (false );
468
+ bool is64 = config->is64 .value_or (false );
469
469
uint8_t itype = is64 ? WASM_TYPE_I64 : WASM_TYPE_I32;
470
470
for (const Symbol *sym : internalGotSymbols) {
471
471
bool mutable_ = false ;
@@ -569,8 +569,8 @@ void ElemSection::writeBody() {
569
569
if (config->isPic ) {
570
570
initExpr.Inst .Opcode = WASM_OPCODE_GLOBAL_GET;
571
571
initExpr.Inst .Value .Global =
572
- (config->is64 .getValueOr (false ) ? WasmSym::tableBase32
573
- : WasmSym::tableBase)
572
+ (config->is64 .value_or (false ) ? WasmSym::tableBase32
573
+ : WasmSym::tableBase)
574
574
->getGlobalIndex ();
575
575
} else {
576
576
initExpr.Inst .Opcode = WASM_OPCODE_I32_CONST;
0 commit comments