[clang] [LifetimeSafety] Track origins for lifetimebound calls returning record types (PR #187917)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 26 03:18:55 PDT 2026


================
@@ -169,6 +171,14 @@ class OriginManager {
   template <typename T>
   OriginList *buildListForType(QualType QT, const T *Node);
 
+  void initializeThisOrigins(const Decl *D);
+
+  /// Pre-scans the function body (and constructor init lists) to discover
+  /// return types of [[clang::lifetimebound]] calls, registering them for
+  /// origin tracking.
+  void collectLifetimeboundOriginTypes(const AnalysisDeclContext &AC);
----------------
Xazax-hun wrote:

Similarly, in the future we might want to also support `lifetime_capture_by`, so I wonder if a more general name like collectLifetimeAnnotatedOriginTypes would be better? 

https://github.com/llvm/llvm-project/pull/187917


More information about the cfe-commits mailing list