diff options
author | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-09-18 18:07:51 +0000 |
---|---|---|
committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-09-18 18:07:51 +0000 |
commit | 4a8b7f9bece4b7f71e4a8b73dfd83f36194cb658 (patch) | |
tree | be1d6313447d5e51529a9e2409b02a2303799e46 /lib | |
parent | 64b349c825bddaaaaaeb556d5ea00925e26b9244 (diff) | |
download | external_llvm-4a8b7f9bece4b7f71e4a8b73dfd83f36194cb658.zip external_llvm-4a8b7f9bece4b7f71e4a8b73dfd83f36194cb658.tar.gz external_llvm-4a8b7f9bece4b7f71e4a8b73dfd83f36194cb658.tar.bz2 |
Tests of the ocaml (and thus C) bindings for constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42101 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Core.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index 297027f..b809db2 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -201,12 +201,20 @@ LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty) { return wrap(UndefValue::get(unwrap(Ty))); } +int LLVMIsConstant(LLVMValueRef Ty) { + return isa<Constant>(unwrap(Ty)); +} + int LLVMIsNull(LLVMValueRef Val) { if (Constant *C = dyn_cast<Constant>(unwrap(Val))) return C->isNullValue(); return false; } +int LLVMIsUndef(LLVMValueRef Val) { + return isa<UndefValue>(unwrap(Val)); +} + /*--.. Operations on scalar constants ......................................--*/ LLVMValueRef LLVMGetIntConstant(LLVMTypeRef IntTy, unsigned long long N, |