kubamracek wrote: I've been trying to work in the same area (on <https://github.com/llvm/llvm-project/pull/229078>) with my motivation to fix <https://github.com/llvm/llvm-project/issues/66709>.
This PR is highly related, and I wonder if we can agree on a plan and co-ordinate progress? As I understand it, we want to eventually simplify and remove the classification from LLVM, and end up without any logic for the "basic heuristic" or "GS heuristic" in LLVM. LLVM would only have the sspstrong/sspreq function-level attributes (no ssp) and a single alloca-attached metadata (`!stack-protector`). It wouldn't do any per-type analysis (ContainsProtectableArray). I proposed to draft a PR to start moving the heuristic(s) to Clang (https://github.com/llvm/llvm-project/pull/183623#issuecomment-6081796526), which I'm happy to do, but I wonder whether we should: (a) pursue the GS buffer heuristic the way it's done here in this PR (adding a new heuristic mode into LLVM), and then follow-up with the refactor of removing the notion of the GS mode from LLVM in favor of marking all allocas in Clang (I'm happy to take on that task). or (b) lift the current "basic" heuristics (extract a part of https://github.com/llvm/llvm-project/pull/183623 into a standalone PR) into Clang first (also happy to take on that), and then build GS on top of that. I personally don't view (a) as being problematic, and it seems like the shorter way forward (and we can use the newly added tests to make the follow-up an NFC), and I can start preparing the follow-up(s) on top of this PR. But it would be best to check with @nikic and @efriedma-quic to see if they agree with that strategy. Or if that's in any way problematic, we could: (c) split out addition the 0/1/2 values (describing small/large) to the !stack-protector per-alloca metadata, which is what is needed regardless. What do you all think? https://github.com/llvm/llvm-project/pull/225626 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
