================
@@ -522,6 +522,12 @@ enum class TemplateSubstitutionKind : char {
     llvm::PointerUnion<Decl *, DeclArgumentPack *> *
     findInstantiationOf(const Decl *D);
 
+    /// Similar to \p findInstantiationOf(), but it wouldn't assert if the
+    /// instantiation was not found within the current instantiation scope. 
This
+    /// is helpful for on-demand declaration instantiation.
+    llvm::PointerUnion<Decl *, DeclArgumentPack *> *
+    findInstantiationUnsafe(const Decl *D);
----------------
zyn0217 wrote:

I renamed it to `getInstantiationOfIfExists.`

> Finally, as interface, is there a reason these are returning a pointer to a 
> pointer union?

It's pre-existing, we track the instantiated decls and packs together within a 
map.

Refactoring the interface (either the return type or the name) would bring a 
lot of churn, for which I think merits a separate PR.

https://github.com/llvm/llvm-project/pull/122423
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to