[clang] [clang][dataflow] Add synthetic fields to `RecordStorageLocation` (PR #73860)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 3 18:31:11 PST 2023
================
@@ -367,3 +394,14 @@ clang::dataflow::FieldSet clang::dataflow::getObjectFields(QualType Type) {
getFieldsFromClassHierarchy(Type, Fields);
return Fields;
}
+
+bool clang::dataflow::containsSameFields(
+ const clang::dataflow::FieldSet &Fields,
+ const clang::dataflow::RecordStorageLocation::FieldToLoc &FieldLocs) {
+ if (Fields.size() != FieldLocs.size())
+ return false;
+ for ([[maybe_unused]] auto [Field, Loc] : FieldLocs)
+ if (!Fields.contains(cast_or_null<FieldDecl>(Field)))
----------------
Xazax-hun wrote:
What are the cases when we expect to see a null pointer here?
https://github.com/llvm/llvm-project/pull/73860
More information about the cfe-commits
mailing list