[clang] [llvm] Adjust MSVC disabled optimization pragmas to be _MSC_VER only (PR #116704)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 21 03:15:35 PST 2024
https://github.com/RKSimon updated https://github.com/llvm/llvm-project/pull/116704
>From 5eed16e1a10b3d078252791c6eb95c9c74585acf Mon Sep 17 00:00:00 2001
From: Simon Pilgrim <llvm-dev at redking.me.uk>
Date: Mon, 18 Nov 2024 22:30:53 +0000
Subject: [PATCH] Adjust MSVC disabled optimization pragmas to be _MSC_VER only
Alter the #ifdef values from #110986 and #115292 to use _MSC_VER instead of _WIN32 to stop the pragmas being used on gcc/mingw builds
Noticed by @mstorsjo
---
clang/lib/AST/ByteCode/Interp.cpp | 4 ++--
llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index 339af0c873a8e4..1d2b5301ecd73b 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -1588,7 +1588,7 @@ bool CheckBitCast(InterpState &S, CodePtr OpPC, bool HasIndeterminateBits,
}
// https://github.com/llvm/llvm-project/issues/102513
-#if defined(_WIN32) && !defined(__clang__) && !defined(NDEBUG)
+#if defined(_MSC_VER) && !defined(__clang__) && !defined(NDEBUG)
#pragma optimize("", off)
#endif
bool Interpret(InterpState &S, APValue &Result) {
@@ -1616,7 +1616,7 @@ bool Interpret(InterpState &S, APValue &Result) {
}
}
// https://github.com/llvm/llvm-project/issues/102513
-#if defined(_WIN32) && !defined(__clang__) && !defined(NDEBUG)
+#if defined(_MSC_VER) && !defined(__clang__) && !defined(NDEBUG)
#pragma optimize("", on)
#endif
diff --git a/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp b/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
index 10dad7675f4eaf..8512fd9ae40172 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
@@ -32,7 +32,7 @@ using namespace llvm;
#define PASS_NAME "AArch64 Instruction Selection"
// https://github.com/llvm/llvm-project/issues/114425
-#if defined(_WIN32) && !defined(__clang__) && !defined(NDEBUG)
+#if defined(_MSC_VER) && !defined(__clang__) && !defined(NDEBUG)
#pragma inline_depth(0)
#endif
More information about the llvm-commits
mailing list