From: Zhou Sheng Date: Wed, 12 Dec 2007 06:16:47 +0000 (+0000) Subject: Add a guard to cxxabi header as other platform may X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=621deadee8967ab3a56c5478bb810b7200c48edb;p=oota-llvm.git Add a guard to cxxabi header as other platform may not support it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44914 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index 12bfb8e252c..f45875faa38 100644 --- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -29,7 +29,11 @@ #include #include #include + +#ifdef __linux__ #include +#endif + using std::vector; using namespace llvm; @@ -727,8 +731,12 @@ GenericValue lle_X___cxa_guard_acquire(FunctionType *FT, const vector &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_acquire(FunctionType *FT, GenericValue lle_X___cxa_guard_release(FunctionType *FT, const vector &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(); }