diff options
author | Zhou Sheng <zhousheng00@gmail.com> | 2007-12-12 06:16:47 +0000 |
---|---|---|
committer | Zhou Sheng <zhousheng00@gmail.com> | 2007-12-12 06:16:47 +0000 |
commit | 3115ba39e85b24a8931efef2f48c53ad3b94eb89 (patch) | |
tree | 2bae35c46da331ef44ed4720a0007d366a059245 /llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | |
parent | 840e05ba1180ae1d8076ceb55ce1fec496752af9 (diff) | |
download | bcm5719-llvm-3115ba39e85b24a8931efef2f48c53ad3b94eb89.tar.gz bcm5719-llvm-3115ba39e85b24a8931efef2f48c53ad3b94eb89.zip |
Add a guard to cxxabi header as other platform may
not support it.
llvm-svn: 44914
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index 12bfb8e252c..f45875faa38 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -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 @@ GenericValue lle_X___cxa_guard_acquire(FunctionType *FT, 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_acquire(FunctionType *FT, 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(); } |