[llvm-branch-commits] [clang] [SSAF][UnsafeBufferUsage] Add APIs to the EntityPointerLevel module for UnsafeBufferUsage (PR #191333)
Balázs Benics via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Apr 10 05:07:28 PDT 2026
================
@@ -238,7 +256,62 @@ Expected<EntityPointerLevelSet> clang::ssaf::translateEntityPointerLevel(
return Translator.translate(E);
}
+/// Create an EntityPointerLevel from a ValueDecl of a pointer type.
+Expected<EntityPointerLevel> clang::ssaf::creatEntityPointerLevel(
+ const NamedDecl *D, ASTContext &Ctx,
+ std::function<EntityId(EntityName EN)> AddEntity, bool IsFunRet) {
----------------
steakhal wrote:
`std::function` is an owning type. Here we just invoke this function, thus a `llvm::function_ref` (view) would work perfectly fine - we don't need to take ownership, because we are not storing this callback for later use.
https://github.com/llvm/llvm-project/pull/191333
More information about the llvm-branch-commits
mailing list