Skip to content

Commit

Permalink
[lld] llvm::Optional::value => operator*/operator->
Browse files Browse the repository at this point in the history
std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.
  • Loading branch information
MaskRay committed Dec 17, 2022
1 parent 9464bd8 commit d88e8dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lld/wasm/SyntheticSections.cpp
Expand Up @@ -236,8 +236,8 @@ void ImportSection::writeBody() {

if (config->memoryImport) {
WasmImport import;
import.Module = config->memoryImport.value().first;
import.Field = config->memoryImport.value().second;
import.Module = config->memoryImport->first;
import.Field = config->memoryImport->second;
import.Kind = WASM_EXTERNAL_MEMORY;
import.Memory.Flags = 0;
import.Memory.Minimum = out.memorySec->numMemoryPages;
Expand Down
4 changes: 2 additions & 2 deletions lld/wasm/Writer.cpp
Expand Up @@ -475,15 +475,15 @@ void Writer::populateTargetFeatures() {
}

if (config->extraFeatures.has_value()) {
auto &extraFeatures = config->extraFeatures.value();
auto &extraFeatures = *config->extraFeatures;
allowed.insert(extraFeatures.begin(), extraFeatures.end());
}

// Only infer used features if user did not specify features
bool inferFeatures = !config->features.has_value();

if (!inferFeatures) {
auto &explicitFeatures = config->features.value();
auto &explicitFeatures = *config->features;
allowed.insert(explicitFeatures.begin(), explicitFeatures.end());
if (!config->checkFeatures)
goto done;
Expand Down

0 comments on commit d88e8dc

Please sign in to comment.