Tests of the ocaml (and thus C) bindings for constants.
[oota-llvm.git] / lib / VMCore / Core.cpp
index 297027fd3148667a5505a34f89c4a89446746831..b809db2ec722647fc7287e393787040ea9c26095 100644 (file)
@@ -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,