[llvm] Skip stack protectors on alloca's which have new metadata to opt out (PR #170229)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 19 09:46:27 PST 2025


================
@@ -431,6 +431,11 @@ bool SSPLayoutAnalysis::requiresStackProtector(Function *F,
   for (const BasicBlock &BB : *F) {
     for (const Instruction &I : BB) {
       if (const AllocaInst *AI = dyn_cast<AllocaInst>(&I)) {
+        if (MDNode* MD = AI->getMetadata("stack-protector")) {
----------------
cooperp wrote:

I think we should add support for setting it to `1` in future yeah.  Will need to work out what that means for clang, as it would need a new attribute if we want to support that.  Will be an easy change to this code to support it when needed.

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


More information about the llvm-commits mailing list