[clang] [SSAF] Let function parameters inherit linkage from their parent functions (PR #201946)

Ziqing Luo via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 10:54:54 PDT 2026


================
@@ -34,7 +34,7 @@ static EntityLinkageType getLinkageForDecl(const Decl *D) {
   //   to be assigned different EntityIDs. As a result, the behavior of the
   //   parameter across multiple TUs cannot be correlated.
   if (const auto *PVD = dyn_cast<ParmVarDecl>(D)) {
-    if (const auto *FD = llvm::dyn_cast<FunctionDecl>(
+    if (const auto *FD = llvm::dyn_cast_or_null<FunctionDecl>(
----------------
ziqingluo-90 wrote:

`getParentFunctionOrMethod` can also return a  ObjCMethodDecl or a BlockDecl.

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


More information about the cfe-commits mailing list