Add two new accessors to the C bindings, patch by Wladimir van der Laan!
[oota-llvm.git] / lib / VMCore / Core.cpp
index 6eb188907f560adf38fd98a85a312f8b312a2704..ac2dfcc647b602e6f01f1061cdd577a44c88730e 100644 (file)
@@ -101,6 +101,11 @@ void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name) {
       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 @@ int LLVMIsUndef(LLVMValueRef Val) {
   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,