[llvm-commits] [llvm] r74836 - in /llvm/trunk: include/llvm-c/Core.h lib/VMCore/Core.cpp

Chris Lattner sabre at nondot.org
Mon Jul 6 10:30:12 PDT 2009


Author: lattner
Date: Mon Jul  6 12:29:59 2009
New Revision: 74836

URL: http://llvm.org/viewvc/llvm-project?rev=74836&view=rev
Log:
Add two new accessors to the C bindings, patch by Wladimir van der Laan!

Modified:
    llvm/trunk/include/llvm-c/Core.h
    llvm/trunk/lib/VMCore/Core.cpp

Modified: llvm/trunk/include/llvm-c/Core.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=74836&r1=74835&r2=74836&view=diff

==============================================================================
--- llvm/trunk/include/llvm-c/Core.h (original)
+++ llvm/trunk/include/llvm-c/Core.h Mon Jul  6 12:29:59 2009
@@ -218,6 +218,7 @@
 /** See Module::addTypeName. */
 int LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty);
 void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name);
+LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name);
 
 /** See Module::dump. */
 void LLVMDumpModule(LLVMModuleRef M);
@@ -398,6 +399,7 @@
 int LLVMIsConstant(LLVMValueRef Val);
 int LLVMIsNull(LLVMValueRef Val);
 int LLVMIsUndef(LLVMValueRef Val);
+LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty);
 
 /* Operations on scalar constants */
 LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,

Modified: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=74836&r1=74835&r2=74836&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (original)
+++ llvm/trunk/lib/VMCore/Core.cpp Mon Jul  6 12:29:59 2009
@@ -101,6 +101,11 @@
       TST.remove(I);
 }
 
+LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name) {
+  std::string N(Name);
+  return wrap(unwrap(M)->getTypeByName(N));
+}
+
 void LLVMDumpModule(LLVMModuleRef M) {
   unwrap(M)->dump();
 }
@@ -313,6 +318,10 @@
   return isa<UndefValue>(unwrap(Val));
 }
 
+LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty) {
+  return wrap(ConstantPointerNull::get(unwrap<PointerType>(Ty)));
+}
+
 /*--.. Operations on scalar constants ......................................--*/
 
 LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,





More information about the llvm-commits mailing list