================ @@ -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); ---------------- erichkeane wrote:
Instead of `unsafe`, I'd suggest something like `getInstantiationOfIfExists` and `getInstantiationOf` (or similar) rather than `unsafe`. `unsafe` means, to me, that there is a precondition that if you don't setup correctly, it fails. Not that it migth just return null. Finally, as interface, is there a reason these are returning a pointer to a pointer union? Seems oen should return by value, the other in an `optional`. 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