llvm.org GIT mirror llvm / 5b0a774
Add support for getting a null pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97380 91177308-0d34-0410-b5e6-96231b3b80d8 Erick Tryzelaar 10 years ago
3 changed file(s) with 12 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
245245 external is_constant : llvalue -> bool = "llvm_is_constant"
246246 external const_null : lltype -> llvalue = "LLVMConstNull"
247247 external const_all_ones : (*int|vec*)lltype -> llvalue = "LLVMConstAllOnes"
248 external const_pointer_null : lltype -> llvalue = "LLVMConstPointerNull"
248249 external undef : lltype -> llvalue = "LLVMGetUndef"
249250 external is_null : llvalue -> bool = "llvm_is_null"
250251 external is_undef : llvalue -> bool = "llvm_is_undef"
525525 (** [const_all_ones ty] returns the constant '-1' of the integer or vector type
526526 [ty]. See the method [llvm::Constant::getAllOnesValue]. *)
527527 external const_all_ones : (*int|vec*)lltype -> llvalue = "LLVMConstAllOnes"
528
529 (** [const_pointer_null ty] returns the constant null (zero) pointer of the type
530 [ty]. See the method [llvm::ConstantPointerNull::get]. *)
531 external const_pointer_null : lltype -> llvalue = "LLVMConstPointerNull"
528532
529533 (** [undef ty] returns the undefined value of the type [ty].
530534 See the method [llvm::UndefValue::get]. *)
314314 group "all ones";
315315 let c = const_all_ones i64_type in
316316 ignore (define_global "const_all_ones" c m);
317
318 group "pointer null"; begin
319 (* RUN: grep {const_pointer_null = global i64\\* null} < %t.ll
320 *)
321 let c = const_pointer_null (pointer_type i64_type) in
322 ignore (define_global "const_pointer_null" c m);
323 end;
317324
318325 (* RUN: grep {const_undef.*undef} < %t.ll
319326 *)