Skip to content

Commit 67113cf

Browse files
stereotype441Commit Queue
authored and
Commit Queue
committed
[flow analysis] Rename SsaNode.getOrCreatePropertyNode.
The old name (`getProperty`) was unclear because (a) the thing being returned isn't the property itself but the property's SSA node, and (b) it didn't give any indication that if the property node was not present, it would be created. Thanks to Konstantin for pointing this out. Change-Id: Ib64315b0bb635545c0ee9253c965277c391f36c4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418661 Reviewed-by: Konstantin Shcheglov <[email protected]> Auto-Submit: Paul Berry <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 284a7ee commit 67113cf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -3858,7 +3858,7 @@ class SsaNode<Type extends Object> {
38583858
/// If a new SSA node is created, it is allocated a fresh promotion key using
38593859
/// [promotionKeyStore], so that type promotions for it can be tracked
38603860
/// separately from other type promotions.
3861-
_PropertySsaNode<Type> getProperty(
3861+
_PropertySsaNode<Type> getOrCreatePropertyNode(
38623862
String propertyName, PromotionKeyStore<Object> promotionKeyStore,
38633863
{required bool isPromotable}) {
38643864
if (isPromotable) {
@@ -6034,9 +6034,9 @@ class _FlowAnalysisImpl<Node extends Object, Statement extends Node,
60346034
bool isPromotable = propertyMember != null &&
60356035
fieldPromotionEnabled &&
60366036
operations.isPropertyPromotable(propertyMember);
6037-
_PropertySsaNode<Type> propertySsaNode = targetSsaNode.getProperty(
6038-
propertyName, promotionKeyStore,
6039-
isPromotable: isPromotable);
6037+
_PropertySsaNode<Type> propertySsaNode =
6038+
targetSsaNode.getOrCreatePropertyNode(propertyName, promotionKeyStore,
6039+
isPromotable: isPromotable);
60406040
Type? promotedType;
60416041
if (isPromotable) {
60426042
PromotionModel<Type>? promotionInfo =

0 commit comments

Comments
 (0)