From 7f31824a44a2698367882d1ac76f887b09cd01cf Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 6 Jul 2009 17:29:59 +0000 Subject: Add two new accessors to the C bindings, patch by Wladimir van der Laan! llvm-svn: 74836 --- llvm/lib/VMCore/Core.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'llvm/lib/VMCore/Core.cpp') diff --git a/llvm/lib/VMCore/Core.cpp b/llvm/lib/VMCore/Core.cpp index 6eb188907f5..ac2dfcc647b 100644 --- a/llvm/lib/VMCore/Core.cpp +++ b/llvm/lib/VMCore/Core.cpp @@ -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(unwrap(Val)); } +LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty) { + return wrap(ConstantPointerNull::get(unwrap(Ty))); +} + /*--.. Operations on scalar constants ......................................--*/ LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, -- cgit v1.2.3