summaryrefslogtreecommitdiff
path: root/include/llvm/IR/Type.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/IR/Type.h')
-rw-r--r--include/llvm/IR/Type.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/IR/Type.h b/include/llvm/IR/Type.h
index d89ae243f5..1bf8789d30 100644
--- a/include/llvm/IR/Type.h
+++ b/include/llvm/IR/Type.h
@@ -17,8 +17,10 @@
#include "llvm/ADT/APFloat.h"
#include "llvm/Support/Casting.h"
+#include "llvm/Support/CBindingWrapping.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/ErrorHandling.h"
+#include "llvm-c/Core.h"
namespace llvm {
@@ -467,6 +469,19 @@ template <> struct GraphTraits<const Type*> {
}
};
+// Create wrappers for C Binding types (see CBindingWrapping.h).
+DEFINE_ISA_CONVERSION_FUNCTIONS(Type, LLVMTypeRef)
+
+/* Specialized opaque type conversions.
+ */
+inline Type **unwrap(LLVMTypeRef* Tys) {
+ return reinterpret_cast<Type**>(Tys);
+}
+
+inline LLVMTypeRef *wrap(Type **Tys) {
+ return reinterpret_cast<LLVMTypeRef*>(const_cast<Type**>(Tys));
+}
+
} // End llvm namespace
#endif