1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing,
12 // software distributed under the License is distributed on an
13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, either express or implied. See the License for the
15 // specific language governing permissions and limitations
18 #include "gandiva/llvm_types.h"
22 // LLVM doesn't distinguish between signed and unsigned types.
24 LLVMTypes::LLVMTypes(llvm::LLVMContext
& context
) : context_(context
) {
25 arrow_id_to_llvm_type_map_
= {{arrow::Type::type::BOOL
, i1_type()},
26 {arrow::Type::type::INT8
, i8_type()},
27 {arrow::Type::type::INT16
, i16_type()},
28 {arrow::Type::type::INT32
, i32_type()},
29 {arrow::Type::type::INT64
, i64_type()},
30 {arrow::Type::type::UINT8
, i8_type()},
31 {arrow::Type::type::UINT16
, i16_type()},
32 {arrow::Type::type::UINT32
, i32_type()},
33 {arrow::Type::type::UINT64
, i64_type()},
34 {arrow::Type::type::FLOAT
, float_type()},
35 {arrow::Type::type::DOUBLE
, double_type()},
36 {arrow::Type::type::DATE32
, i32_type()},
37 {arrow::Type::type::DATE64
, i64_type()},
38 {arrow::Type::type::TIME32
, i32_type()},
39 {arrow::Type::type::TIME64
, i64_type()},
40 {arrow::Type::type::TIMESTAMP
, i64_type()},
41 {arrow::Type::type::STRING
, i8_ptr_type()},
42 {arrow::Type::type::BINARY
, i8_ptr_type()},
43 {arrow::Type::type::DECIMAL
, i128_type()},
44 {arrow::Type::type::INTERVAL_MONTHS
, i32_type()},
45 {arrow::Type::type::INTERVAL_DAY_TIME
, i64_type()}};
48 } // namespace gandiva