[clang] [clang][dataflow] Expose fields, globals, and functions referenced. (PR #88534)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 15 02:32:53 PDT 2024
================
@@ -62,6 +62,52 @@ FieldSet getObjectFields(QualType Type);
bool containsSameFields(const FieldSet &Fields,
const RecordStorageLocation::FieldToLoc &FieldLocs);
+/// Returns the fields of a `RecordDecl` that are initialized by an
+/// `InitListExpr`, in the order in which they appear in
+/// `InitListExpr::inits()`.
+/// `Init->getType()` must be a record type.
+std::vector<const FieldDecl *>
+getFieldsForInitListExpr(const InitListExpr *InitList);
----------------
martinboehme wrote:
This appears to be used only in DataflowEnvironment.cpp -- would suggest simply making it a static function there (not exposed in any header).
(I believe it used to be that this was used more widely, but `RecordInitListHelper` made that unnecessary, and I didn't notice that when I introduced this class?)
https://github.com/llvm/llvm-project/pull/88534
More information about the cfe-commits
mailing list