mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-02 19:24:25 +00:00
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
This commit is contained in:
@ -29,7 +29,11 @@
|
|||||||
#include <csignal>
|
#include <csignal>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
@ -727,8 +731,12 @@ GenericValue lle_X___cxa_guard_acquire(FunctionType *FT,
|
|||||||
const vector<GenericValue> &Args) {
|
const vector<GenericValue> &Args) {
|
||||||
assert(Args.size() == 1);
|
assert(Args.size() == 1);
|
||||||
GenericValue GV;
|
GenericValue GV;
|
||||||
|
#ifdef __linux__
|
||||||
GV.IntVal = APInt(32, __cxxabiv1::__cxa_guard_acquire (
|
GV.IntVal = APInt(32, __cxxabiv1::__cxa_guard_acquire (
|
||||||
(__cxxabiv1::__guard*)GVTOP(Args[0])));
|
(__cxxabiv1::__guard*)GVTOP(Args[0])));
|
||||||
|
#else
|
||||||
|
assert(0 && "Can't call __cxa_guard_acquire on this platform");
|
||||||
|
#endif
|
||||||
return GV;
|
return GV;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -736,7 +744,11 @@ GenericValue lle_X___cxa_guard_acquire(FunctionType *FT,
|
|||||||
GenericValue lle_X___cxa_guard_release(FunctionType *FT,
|
GenericValue lle_X___cxa_guard_release(FunctionType *FT,
|
||||||
const vector<GenericValue> &Args) {
|
const vector<GenericValue> &Args) {
|
||||||
assert(Args.size() == 1);
|
assert(Args.size() == 1);
|
||||||
|
#ifdef __linux__
|
||||||
__cxxabiv1::__cxa_guard_release ((__cxxabiv1::__guard*)GVTOP(Args[0]));
|
__cxxabiv1::__cxa_guard_release ((__cxxabiv1::__guard*)GVTOP(Args[0]));
|
||||||
|
#else
|
||||||
|
assert(0 && "Can't call __cxa_guard_release on this platform");
|
||||||
|
#endif
|
||||||
return GenericValue();
|
return GenericValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user