Skip to content

Commit afac0d9

Browse files
bazuzirlavaee
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 79cbb7b commit afac0d9

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)