MCPcopy Create free account
hub / github.com/apache/impala / GetSlotType

Method GetSlotType

be/src/codegen/llvm-codegen.cc:573–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571}
572
573llvm::Type* LlvmCodeGen::GetSlotType(const ColumnType& type) {
574 switch (type.type) {
575 case TYPE_NULL:
576 return llvm::Type::getInt1Ty(context());
577 case TYPE_BOOLEAN:
578 return bool_type();
579 case TYPE_TINYINT:
580 return i8_type();
581 case TYPE_SMALLINT:
582 return i16_type();
583 case TYPE_INT:
584 return i32_type();
585 case TYPE_BIGINT:
586 return i64_type();
587 case TYPE_FLOAT:
588 return float_type();
589 case TYPE_DOUBLE:
590 return double_type();
591 case TYPE_STRING:
592 case TYPE_VARCHAR:
593 return string_value_type_;
594 case TYPE_CHAR:
595 case TYPE_FIXED_UDA_INTERMEDIATE:
596 // Represent this as an array of bytes.
597 return llvm::ArrayType::get(i8_type(), type.len);
598 case TYPE_TIMESTAMP:
599 return timestamp_value_type_;
600 case TYPE_DECIMAL:
601 return llvm::Type::getIntNTy(context(), type.GetByteSize() * 8);
602 case TYPE_DATE:
603 return i32_type();
604 case TYPE_ARRAY:
605 case TYPE_MAP:
606 return collection_value_type_;
607 default:
608 DCHECK(false) << "Invalid type: " << type;
609 return NULL;
610 }
611}
612
613llvm::PointerType* LlvmCodeGen::GetSlotPtrType(const ColumnType& type) {
614 return llvm::PointerType::get(GetSlotType(type), 0);

Callers 7

CodegenLoadAnyValMethod · 0.80
GetLlvmTypesAndOffsetMethod · 0.80
GetValMethod · 0.80

Calls 1

GetByteSizeMethod · 0.80

Tested by

no test coverage detected