LLVM API Documentation

Defines
CBindingWrapping.h File Reference
#include "llvm/Support/Casting.h"
Include dependency graph for CBindingWrapping.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
#define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref)
#define DEFINE_STDCXX_CONVERSION_FUNCTIONS(ty, ref)

Define Documentation

#define DEFINE_ISA_CONVERSION_FUNCTIONS (   ty,
  ref 
)
Value:
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)           \
                                                        \
  template<typename T>                                  \
  inline T *unwrap(ref P) {                             \
    return cast<T>(unwrap(P));                          \
  }

Definition at line 28 of file CBindingWrapping.h.

#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS (   ty,
  ref 
)
Value:
inline ty *unwrap(ref P) {                            \
    return reinterpret_cast<ty*>(P);                    \
  }                                                     \
                                                        \
  inline ref wrap(const ty *P) {                        \
    return reinterpret_cast<ref>(const_cast<ty*>(P));   \
  }

Definition at line 19 of file CBindingWrapping.h.

#define DEFINE_STDCXX_CONVERSION_FUNCTIONS (   ty,
  ref 
)
Value:
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)           \
                                                        \
  template<typename T>                                  \
  inline T *unwrap(ref P) {                             \
    T *Q = (T*)unwrap(P);                               \
    assert(Q && "Invalid cast!");                       \
    return Q;                                           \
  }

Definition at line 36 of file CBindingWrapping.h.