[clang] [clang][dataflow] Expose simple access to child StorageLocation presence. (PR #145520)
https://github.com/bazuzi closed https://github.com/llvm/llvm-project/pull/145520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][dataflow] Expose simple access to child StorageLocation presence. (PR #145520)
https://github.com/bazuzi created https://github.com/llvm/llvm-project/pull/145520 `getChild` does not offer this knowledge, and a map lookup is significantly cheaper than iteration over `children()`. >From 9b8f866a5102dbe23b671760bf35549b30a30a74 Mon Sep 17 00:00:00 2001 From: Samira Bakon Date: Tue, 24 Jun 2025 10:23:11 -0400 Subject: [PATCH] [clang][dataflow] Expose simple access to whether a child StorageLocation is present. `getChild` does not offer this knowledge, and a map lookup is significantly cheaper than iteration over `children()`. --- clang/include/clang/Analysis/FlowSensitive/StorageLocation.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h b/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h index 8fcc6a44027a0..8b263b16d5b1e 100644 --- a/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h +++ b/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h @@ -168,6 +168,8 @@ class RecordStorageLocation final : public StorageLocation { return {Children.begin(), Children.end()}; } + bool hasChild(const ValueDecl &D) const { return Children.contains(&D); } + private: FieldToLoc Children; SyntheticFieldMap SyntheticFields; ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][dataflow] Expose simple access to child StorageLocation presence. (PR #145520)
bazuzi wrote: No underlying bug, but I was able to simplify my approach out-of-tree and avoid exposing this function that doesn't capture the intended semantics. I'll revert this. https://github.com/llvm/llvm-project/pull/145520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Revert "[clang][dataflow] Expose simple access to child StorageLocation presence." (PR #145710)
bazuzi wrote: This reverts a simple change added <24 hours ago and reverting has been discussed directly with original change reviewers. Merging without additional review. https://github.com/llvm/llvm-project/pull/145710 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Revert "[clang][dataflow] Expose simple access to child StorageLocation presence." (PR #145710)
https://github.com/bazuzi closed https://github.com/llvm/llvm-project/pull/145710 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Revert "[clang][dataflow] Expose simple access to child StorageLocation presence." (PR #145710)
https://github.com/bazuzi created https://github.com/llvm/llvm-project/pull/145710 Reverts llvm/llvm-project#145520 Exposed function is no longer needed and side-stepped the intended contract that the present children are the same set returned by `getModeledFields()` and presence shouldn't need to be queried for arbitrary fields. >From 5ef48b36e5ebc5e0cd1058a502c7ef0cd9347d15 Mon Sep 17 00:00:00 2001 From: Samira Bakon Date: Wed, 25 Jun 2025 10:17:15 -0400 Subject: [PATCH] =?UTF-8?q?Revert=20"[clang][dataflow]=20Expose=20simple?= =?UTF-8?q?=20access=20to=20child=20StorageLocation=20prese=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 09b43a5a862f453aabd95ec01e0b53c46ca3e340. --- clang/include/clang/Analysis/FlowSensitive/StorageLocation.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h b/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h index 8b263b16d5b1e..8fcc6a44027a0 100644 --- a/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h +++ b/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h @@ -168,8 +168,6 @@ class RecordStorageLocation final : public StorageLocation { return {Children.begin(), Children.end()}; } - bool hasChild(const ValueDecl &D) const { return Children.contains(&D); } - private: FieldToLoc Children; SyntheticFieldMap SyntheticFields; ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits