[MSVC] work-around for compile time issue 102513
authorbd1976bris <bd1976llvm@gmail.com>
Sun, 6 Oct 2024 21:47:02 +0000 (22:47 +0100)
committerTobias Hieta <tobias@hieta.se>
Mon, 18 Nov 2024 16:05:08 +0000 (17:05 +0100)
Manual cherry-pick of #110986 to the LLVM 19 release branch.

clang/lib/AST/Interp/Interp.cpp

index 6fcd90e5f5849892f208adad3f6896da5f84a40d..0f9eedc3f38ea1270627cbca14566030b9f1324e 100644 (file)
@@ -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