| 727 | } |
| 728 | |
| 729 | llvm::Value* CodegenAnyVal::Compare(CodegenAnyVal* other, const char* name) { |
| 730 | DCHECK_EQ(type_, other->type_); |
| 731 | llvm::Value* v1 = SlotDescriptor::CodegenStoreNonNullAnyValToNewAlloca(*this); |
| 732 | llvm::Value* void_v1 = builder_->CreateBitCast(v1, codegen_->ptr_type()); |
| 733 | llvm::Value* v2 = SlotDescriptor::CodegenStoreNonNullAnyValToNewAlloca(*other); |
| 734 | llvm::Value* void_v2 = builder_->CreateBitCast(v2, codegen_->ptr_type()); |
| 735 | // Create a global constant of the values' ColumnType. It needs to be a constant |
| 736 | // for constant propagation and dead code elimination in 'compare_fn'. |
| 737 | llvm::Type* col_type = codegen_->GetStructType<ColumnType>(); |
| 738 | llvm::Constant* type_ptr = |
| 739 | codegen_->ConstantToGVPtr(col_type, type_.ToIR(codegen_), "type"); |
| 740 | llvm::Function* compare_fn = |
| 741 | codegen_->GetFunction(IRFunction::RAW_VALUE_COMPARE, false); |
| 742 | llvm::Value* args[] = {void_v1, void_v2, type_ptr}; |
| 743 | return builder_->CreateCall(compare_fn, args, name); |
| 744 | } |
| 745 | |
| 746 | void CodegenAnyVal::CodegenBranchIfNull( |
| 747 | LlvmBuilder* builder, llvm::BasicBlock* null_block) { |
nothing calls this directly
no test coverage detected