[llvm-commits] [llvm] r44914 - /llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp

Zhou Sheng zhousheng00 at gmail.com
Tue Dec 11 22:16:47 PST 2007


Author: sheng
Date: Wed Dec 12 00:16:47 2007
New Revision: 44914

URL: http://llvm.org/viewvc/llvm-project?rev=44914&view=rev
Log:
Add a guard to cxxabi header as other platform may
not support it.

Modified:
    llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp

Modified: llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp?rev=44914&r1=44913&r2=44914&view=diff

==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Wed Dec 12 00:16:47 2007
@@ -29,7 +29,11 @@
 #include <csignal>
 #include <map>
 #include <cmath>
+
+#ifdef __linux__
 #include <cxxabi.h>
+#endif
+
 using std::vector;
 
 using namespace llvm;
@@ -727,8 +731,12 @@
                                        const vector<GenericValue> &Args) {
   assert(Args.size() == 1);
   GenericValue GV;
+#ifdef __linux__
   GV.IntVal = APInt(32, __cxxabiv1::__cxa_guard_acquire (
                           (__cxxabiv1::__guard*)GVTOP(Args[0])));
+#else
+  assert(0 && "Can't call __cxa_guard_acquire on this platform");
+#endif
   return GV;
 }
 
@@ -736,7 +744,11 @@
 GenericValue lle_X___cxa_guard_release(FunctionType *FT, 
                                        const vector<GenericValue> &Args) {
   assert(Args.size() == 1);
+#ifdef __linux__
   __cxxabiv1::__cxa_guard_release ((__cxxabiv1::__guard*)GVTOP(Args[0]));
+#else
+  assert(0 && "Can't call __cxa_guard_release on this platform");
+#endif
   return GenericValue();
 }
 





More information about the llvm-commits mailing list