MSVC warning fixes; patch by Stein Roger!
authorDaniel Dunbar <daniel@zuster.org>
Fri, 7 Aug 2009 20:50:09 +0000 (20:50 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 7 Aug 2009 20:50:09 +0000 (20:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78405 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
tools/bugpoint/bugpoint.cpp

index 79948704ef12dd78627c25cb33fc4bc1c9673c7d..68097fd12196901d42c65446d12956ea590480b3 100644 (file)
@@ -291,6 +291,12 @@ GenericValue Interpreter::callExternalFunction(Function *F,
 //===----------------------------------------------------------------------===//
 //  Functions "exported" to the running application...
 //
+
+// Visual Studio warns about returning GenericValue in extern "C" linkage
+#ifdef _MSC_VER
+    #pragma warning(disable : 4190)
+#endif
+
 extern "C" {  // Don't add C++ manglings to llvm mangling :)
 
 // void atexit(Function*)
@@ -539,6 +545,11 @@ GenericValue lle_X_fprintf(const FunctionType *FT,
 
 } // End extern "C"
 
+// Done with externals; turn the warning back on
+#ifdef _MSC_VER
+    #pragma warning(default: 4190)
+#endif
+
 
 void Interpreter::initializeExternalFunctions() {
   sys::ScopedLock Writer(*FunctionsLock);
index 573a406a117f615025a17c1d4a743a8d48f464c9..d00036acd80c26006107cbbb5a5da87515212578 100644 (file)
@@ -129,7 +129,7 @@ int main(int argc, char **argv) {
     errs() << "Tool execution error: " << TEE.what() << '\n';
   } catch (const std::string& msg) {
     errs() << argv[0] << ": " << msg << "\n";
-  } catch (const std::bad_alloc &e) {
+  } catch (const std::bad_alloc&) {
     errs() << "Oh no, a bugpoint process ran out of memory!\n"
               "To increase the allocation limits for bugpoint child\n"
               "processes, use the -mlimit option.\n";