diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-06 17:29:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-06 17:29:59 +0000 |
commit | e4840bc611f8260065d3879a412ea3b501550995 (patch) | |
tree | da224efd618c4ea5a371c33cbd06afcc7e6da9f0 /lib | |
parent | c880815c40dc5d5e0e6a9dbfe961ca645e7222bd (diff) | |
download | external_llvm-e4840bc611f8260065d3879a412ea3b501550995.zip external_llvm-e4840bc611f8260065d3879a412ea3b501550995.tar.gz external_llvm-e4840bc611f8260065d3879a412ea3b501550995.tar.bz2 |
Add two new accessors to the C bindings, patch by Wladimir van der Laan!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74836 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Core.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index 6eb1889..ac2dfcc 100644 --- a/lib/VMCore/Core.cpp +++ b/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<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, |