[clang] [llvm] [clang-cl] Use MSVC's "GS buffer" heuristic for the default /GS (PR #225626)

Pan Tao via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 11 23:24:20 PDT 2026


================
@@ -199,6 +199,9 @@ static Instruction *simplifyAllocaArraySize(InstCombinerImpl &IC,
                                                 nullptr, AI.getName());
       New->setAlignment(AI.getAlign());
       New->setUsedWithInAlloca(AI.isUsedWithInAlloca());
+      // It is the same allocation, so it keeps what was said about it, e.g.
+      // "stack-protector".
+      New->copyMetadata(AI);
----------------
PanTao2 wrote:

I split this into https://github.com/llvm/llvm-project/pull/231073.

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


More information about the cfe-commits mailing list