[llvm-branch-commits] [clang] [MSVC] work-around for compile time issue 102513 (PR #111314)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Oct 6 14:47:30 PDT 2024


https://github.com/bd1976bris created https://github.com/llvm/llvm-project/pull/111314

Manual cherry-pick of #110986 to the LLVM 19 release branch.

>From c4b52d9d07533084090a183c263477feb9b195f5 Mon Sep 17 00:00:00 2001
From: bd1976bris <bd1976llvm at gmail.com>
Date: Sun, 6 Oct 2024 22:47:02 +0100
Subject: [PATCH] [MSVC] work-around for compile time issue 102513

Manual cherry-pick of #110986 to the LLVM 19 release branch.
---
 clang/lib/AST/Interp/Interp.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/clang/lib/AST/Interp/Interp.cpp b/clang/lib/AST/Interp/Interp.cpp
index 6fcd90e5f58498..0f9eedc3f38ea1 100644
--- a/clang/lib/AST/Interp/Interp.cpp
+++ b/clang/lib/AST/Interp/Interp.cpp
@@ -925,6 +925,10 @@ void diagnoseEnumValue(InterpState &S, CodePtr OpPC, const EnumDecl *ED,
   }
 }
 
+// https://github.com/llvm/llvm-project/issues/102513
+#if defined(_WIN32) && !defined(__clang__) && !defined(NDEBUG)
+#pragma optimize("", off)
+#endif
 bool Interpret(InterpState &S, APValue &Result) {
   // The current stack frame when we started Interpret().
   // This is being used by the ops to determine wheter
@@ -949,6 +953,10 @@ bool Interpret(InterpState &S, APValue &Result) {
     }
   }
 }
+// https://github.com/llvm/llvm-project/issues/102513
+#if defined(_WIN32) && !defined(__clang__) && !defined(NDEBUG)
+#pragma optimize("", on)
+#endif
 
 } // namespace interp
 } // namespace clang



More information about the llvm-branch-commits mailing list