[PATCH] D125168: Add opaque ptr to the llvm-c

Christoffer Lerno via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 7 10:49:21 PDT 2022


lerno updated this revision to Diff 427880.
lerno added a comment.

Removed the default context method.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125168/new/

https://reviews.llvm.org/D125168

Files:
  llvm/include/llvm-c/Core.h
  llvm/lib/IR/Core.cpp


Index: llvm/lib/IR/Core.cpp
===================================================================
--- llvm/lib/IR/Core.cpp
+++ llvm/lib/IR/Core.cpp
@@ -824,6 +824,10 @@
 
 /*--.. Operations on other types ...........................................--*/
 
+LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace)  {
+  return wrap(PointerType::get(*unwrap(C), AddressSpace));
+}
+
 LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)  {
   return wrap(Type::getVoidTy(*unwrap(C)));
 }
Index: llvm/include/llvm-c/Core.h
===================================================================
--- llvm/include/llvm-c/Core.h
+++ llvm/include/llvm-c/Core.h
@@ -1442,6 +1442,13 @@
  */
 LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace);
 
+/**
+ * Create an opaque pointer type in a context
+ *
+ * @see llvm::PointerType::get()
+ */
+LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace);
+
 /**
  * Obtain the address space of a pointer type.
  *


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125168.427880.patch
Type: text/x-patch
Size: 1010 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220507/118392ac/attachment.bin>


More information about the llvm-commits mailing list