[PATCH] D38809: [LLVM-C] Publicly expose getters of MetadataType, TokenType

whitequark via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 27 04:52:19 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL316762: [LLVM-C] Publicly expose getters of MetadataType, TokenType (authored by whitequark).

Changed prior to commit:
  https://reviews.llvm.org/D38809?vs=119022&id=120574#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38809

Files:
  llvm/trunk/include/llvm-c/Core.h
  llvm/trunk/lib/IR/Core.cpp
  llvm/trunk/tools/llvm-c-test/echo.cpp


Index: llvm/trunk/tools/llvm-c-test/echo.cpp
===================================================================
--- llvm/trunk/tools/llvm-c-test/echo.cpp
+++ llvm/trunk/tools/llvm-c-test/echo.cpp
@@ -142,7 +142,7 @@
           LLVMGetVectorSize(Src)
         );
       case LLVMMetadataTypeKind:
-        break;
+        return LLVMMetadataTypeInContext(Ctx);
       case LLVMX86_MMXTypeKind:
         return LLVMX86MMXTypeInContext(Ctx);
       default:
Index: llvm/trunk/include/llvm-c/Core.h
===================================================================
--- llvm/trunk/include/llvm-c/Core.h
+++ llvm/trunk/include/llvm-c/Core.h
@@ -1137,6 +1137,16 @@
 LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C);
 
 /**
+ * Create a token type in a context.
+ */
+LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C);
+
+/**
+ * Create a metadata type in a context.
+ */
+LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C);
+
+/**
  * These are similar to the above functions except they operate on the
  * global context.
  */
Index: llvm/trunk/lib/IR/Core.cpp
===================================================================
--- llvm/trunk/lib/IR/Core.cpp
+++ llvm/trunk/lib/IR/Core.cpp
@@ -452,9 +452,6 @@
 LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C) {
   return (LLVMTypeRef) Type::getX86_MMXTy(*unwrap(C));
 }
-LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C) {
-  return (LLVMTypeRef) Type::getTokenTy(*unwrap(C));
-}
 
 LLVMTypeRef LLVMHalfType(void) {
   return LLVMHalfTypeInContext(LLVMGetGlobalContext());
@@ -620,6 +617,12 @@
 LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C) {
   return wrap(Type::getLabelTy(*unwrap(C)));
 }
+LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C) {
+  return wrap(Type::getTokenTy(*unwrap(C)));
+}
+LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C) {
+  return wrap(Type::getMetadataTy(*unwrap(C)));
+}
 
 LLVMTypeRef LLVMVoidType(void)  {
   return LLVMVoidTypeInContext(LLVMGetGlobalContext());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38809.120574.patch
Type: text/x-patch
Size: 1979 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171027/7808d2f9/attachment.bin>


More information about the llvm-commits mailing list