Fixing warning due to the new "UTD return type in extern 'C'".
authorAaron Ballman <aaron@aaronballman.com>
Tue, 14 Feb 2012 21:29:32 +0000 (21:29 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Tue, 14 Feb 2012 21:29:32 +0000 (21:29 +0000)
Patch by Matt Johnson

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

lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp

index 40e12cc98f749fe7bb970f0bb89332d24edd8fac..c5ed6d16b2223368f515e6d3f84303e579ca9aa3 100644 (file)
@@ -297,10 +297,14 @@ GenericValue Interpreter::callExternalFunction(Function *F,
 //  Functions "exported" to the running application...
 //
 
-// Visual Studio warns about returning GenericValue in extern "C" linkage
+// Visual Studio and Clang warn about returning GenericValue in extern "C" linkage
 #ifdef _MSC_VER
     #pragma warning(disable : 4190)
 #endif
+#ifdef __clang__
+    #pragma clang diagnostic push
+    #pragma clang diagnostic ignored "-Wreturn-type"
+#endif
 
 extern "C" {  // Don't add C++ manglings to llvm mangling :)
 
@@ -471,7 +475,10 @@ GenericValue lle_X_fprintf(FunctionType *FT,
 
 } // End extern "C"
 
-// Done with externals; turn the warning back on
+// Done with externals; turn the warning back on for Clang and Visual Studio
+#ifdef __clang__
+    #pragma clang diagnostic pop
+#endif
 #ifdef _MSC_VER
     #pragma warning(default: 4190)
 #endif