Re-instate the pragma optimize hack for MSVC, but not clang-cl
authorReid Kleckner <reid@kleckner.net>
Thu, 26 Feb 2015 21:34:11 +0000 (21:34 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 26 Feb 2015 21:34:11 +0000 (21:34 +0000)
Reverts commit r230686 with define modifications.

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

utils/TableGen/IntrinsicEmitter.cpp

index 2fb78b0334c2e006d541a73969d5fe3c6c785bfd..e71c695c25dbe8596a78ecd70184921d83c23db4 100644 (file)
@@ -292,6 +292,10 @@ static void EncodeFixedValueType(MVT::SimpleValueType VT,
   }
 }
 
+#if defined(_MSC_VER) && !defined(__clang__)
+#pragma optimize("",off) // MSVC 2010 optimizer can't deal with this function.
+#endif
+
 static void EncodeFixedType(Record *R, std::vector<unsigned char> &ArgCodes,
                             std::vector<unsigned char> &Sig) {
 
@@ -377,6 +381,10 @@ static void EncodeFixedType(Record *R, std::vector<unsigned char> &ArgCodes,
   EncodeFixedValueType(VT, Sig);
 }
 
+#if defined(_MSC_VER) && !defined(__clang__)
+#pragma optimize("",on)
+#endif
+
 /// ComputeFixedEncoding - If we can encode the type signature for this
 /// intrinsic into 32 bits, return it.  If not, return ~0U.
 static void ComputeFixedEncoding(const CodeGenIntrinsic &Int,