Skip to content

Commit c1db75c

Browse files
bazuziAnthony Tran
authored andcommitted
[clang][dataflow] Expose simple access to child StorageLocation presence. (llvm#145520)
`getChild` does not offer this knowledge, and a map lookup is significantly cheaper than iteration over `children()`.
1 parent a9ce4be commit c1db75c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/include/clang/Analysis/FlowSensitive/StorageLocation.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ class RecordStorageLocation final : public StorageLocation {
168168
return {Children.begin(), Children.end()};
169169
}
170170

171+
bool hasChild(const ValueDecl &D) const { return Children.contains(&D); }
172+
171173
private:
172174
FieldToLoc Children;
173175
SyntheticFieldMap SyntheticFields;

0 commit comments

Comments
 (0)