Go to the documentation of this file.
14 #ifndef LLVM_SUPPORT_CBINDINGWRAPPING_H
15 #define LLVM_SUPPORT_CBINDINGWRAPPING_H
20 #define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
21 inline ty *unwrap(ref P) { \
22 return reinterpret_cast<ty*>(P); \
25 inline ref wrap(const ty *P) { \
26 return reinterpret_cast<ref>(const_cast<ty*>(P)); \
29 #define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref) \
30 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
32 template<typename T> \
33 inline T *unwrap(ref P) { \
34 return cast<T>(unwrap(P)); \
37 #define DEFINE_STDCXX_CONVERSION_FUNCTIONS(ty, ref) \
38 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
40 template<typename T> \
41 inline T *unwrap(ref P) { \
42 T *Q = (T*)unwrap(P); \
43 assert(Q && "Invalid cast!"); \