samitolvanen added inline comments.

================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2268-2272
+    if (!AddressTaken && F.hasLocalLinkage()) {
+      F.setPrefixData(nullptr);
+      F.removeFnAttr("kcfi");
+      continue;
+    }
----------------
nickdesaulniers wrote:
> Can we not compute whether the address was taken BEFORE adding the prefix + 
> Fn Attr and avoid adding these only to remove them later?
> Can we not compute whether the address was taken BEFORE adding the prefix + 
> Fn Attr and avoid adding these only to remove them later?

Setting these in `SetFunctionAttributes` where we have convenient access to the 
`FunctionDecl` seemed like the right thing to do, and I don't believe we know 
whether the address is taken until we're done with the module. Is there a 
better place for this?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119296/new/

https://reviews.llvm.org/D119296

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to