]> granicus.if.org Git - clang/commitdiff
Hide "#pragma optimize("", off)" from clang when it pretends to be MSVC 2017
authorReid Kleckner <rnk@google.com>
Fri, 13 Oct 2017 16:18:32 +0000 (16:18 +0000)
committerReid Kleckner <rnk@google.com>
Fri, 13 Oct 2017 16:18:32 +0000 (16:18 +0000)
These pragmas work around a bug in VC 1911 that isn't present in clang,
and clang warns about them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315699 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/StmtProfile.cpp

index 9ec92cebc1d30390be8f68c1f43378ecaaf6ba7c..9acd79bc2ca3bd2bea6dfcad69530d10c144f4c5 100644 (file)
@@ -1418,7 +1418,7 @@ static Stmt::StmtClass DecodeOperatorCall(const CXXOperatorCallExpr *S,
   llvm_unreachable("Invalid overloaded operator expression");
 }
 
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && !defined(__clang__)
 #if _MSC_VER == 1911
 // Work around https://developercommunity.visualstudio.com/content/problem/84002/clang-cl-when-built-with-vc-2017-crashes-cause-vc.html
 // MSVC 2017 update 3 miscompiles this function, and a clang built with it
@@ -1459,7 +1459,7 @@ void StmtProfiler::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *S) {
   ID.AddInteger(S->getOperator());
 }
 
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && !defined(__clang__)
 #if _MSC_VER == 1911
 #pragma optimize("", on)
 #endif