Skip to content

Commit 87f65d3

Browse files
committed
unique_ptr -> optional
1 parent 5ef3db8 commit 87f65d3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/passes/TranslateEH.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ struct TranslateEHOldToNew
193193
}
194194
};
195195

196-
std::unique_ptr<LabelUtils::LabelManager> labels;
197-
std::unique_ptr<TargetTryLabelScanner> labelScanner;
198-
std::unique_ptr<ExnrefLocalAssigner> localAssigner;
196+
std::optional<LabelUtils::LabelManager> labels;
197+
std::optional<TargetTryLabelScanner> labelScanner;
198+
std::optional<ExnrefLocalAssigner> localAssigner;
199199

200200
std::unordered_map<Name, Name> delegateTargetToBrTarget;
201201
// Scratch locals used to contain extracted values and (extracted values,
@@ -787,10 +787,10 @@ struct TranslateEHOldToNew
787787
}
788788

789789
void doWalkFunction(Function* func) {
790-
labels = std::make_unique<LabelUtils::LabelManager>(func);
791-
labelScanner = std::make_unique<TargetTryLabelScanner>(func);
790+
labels = std::make_optional<LabelUtils::LabelManager>(func);
791+
labelScanner = std::make_optional<TargetTryLabelScanner>(func);
792792
localAssigner =
793-
std::make_unique<ExnrefLocalAssigner>(func, labelScanner.get());
793+
std::make_optional<ExnrefLocalAssigner>(func, &labelScanner.value());
794794

795795
// Create a unique br target label for each existing delegate target label,
796796
// because we are going to achieve 'delegate's effects with 'br's. See

0 commit comments

Comments
 (0)