1 | /** |
2 | * Copyright (c) Glow Contributors. See CONTRIBUTORS file. |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. |
6 | * You may obtain a copy of the License at |
7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | * |
10 | * Unless required by applicable law or agreed to in writing, software |
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. |
15 | */ |
16 | #include "MemberType.h" |
17 | |
18 | MemberTypeInfo kTypeRefTypeInfo{MemberType::TypeRef, "TypeRef" , "TypeRef" , |
19 | "TypeRef" }; |
20 | MemberTypeInfo kFloatTypeInfo{MemberType::Float, "float" , "float" , "float" }; |
21 | MemberTypeInfo kUnsignedTypeInfo{MemberType::Unsigned, "unsigned_t" , |
22 | "unsigned_t" , "unsigned_t" }; |
23 | MemberTypeInfo kBooleanTypeInfo{MemberType::Boolean, "bool" , "bool" , "bool" }; |
24 | MemberTypeInfo kInt64TypeInfo{MemberType::Int64, "int64_t" , "int64_t" , |
25 | "int64_t" }; |
26 | MemberTypeInfo kStringTypeInfo{MemberType::String, "std::string" , "std::string" , |
27 | "std::string" }; |
28 | MemberTypeInfo kVectorFloatTypeInfo{MemberType::VectorFloat, |
29 | "llvm::ArrayRef<float>" , |
30 | "std::vector<float>" , "std::vector<float>" }; |
31 | MemberTypeInfo kVectorUnsignedTypeInfo{ |
32 | MemberType::VectorUnsigned, "llvm::ArrayRef<unsigned_t>" , |
33 | "std::vector<unsigned_t>" , "std::vector<unsigned_t>" }; |
34 | MemberTypeInfo kVectorInt64TypeInfo{ |
35 | MemberType::VectorInt64, "llvm::ArrayRef<int64_t>" , "std::vector<int64_t>" , |
36 | "std::vector<int64_t>" }; |
37 | MemberTypeInfo kVectorSignedTypeInfo{MemberType::VectorSigned, |
38 | "llvm::ArrayRef<int>" , "std::vector<int>" , |
39 | "std::vector<int>" }; |
40 | MemberTypeInfo kVectorSizeTTypeInfo{ |
41 | MemberType::VectorSizeT, "llvm::ArrayRef<size_t>" , "std::vector<size_t>" , |
42 | "std::vector<size_t>" }; |
43 | MemberTypeInfo kVectorDimTTypeInfo{MemberType::VectorDimT, |
44 | "llvm::ArrayRef<dim_t>" , |
45 | "std::vector<dim_t>" , "std::vector<dim_t>" }; |
46 | MemberTypeInfo kVectorNodeValueTypeInfo{ |
47 | MemberType::VectorNodeValue, "NodeValueArrayRef" , "std::vector<NodeHandle>" , |
48 | "std::vector<NodeValue>" }; |
49 | // We currently use 'unsigned_t' to represent a enum in the generic API. It can |
50 | // carry fully the enum information even of the signess of enum is |
51 | // implementation defined. |
52 | // C++03: The underlying type of an enumeration is an integral type that can |
53 | // represent all the enumerator values defined in the enumeration. It is |
54 | // implementation-defined which integral type is used as the underlying type for |
55 | // an enumeration except that the underlying type shall not be larger than int |
56 | // unless the value of an enumerator cannot fit in an int or unsigned int. |
57 | MemberTypeInfo kEnumTypeInfo{MemberType::Unsigned, "unsigned_t" , "unsigned_t" , |
58 | "unsigned_t" }; |
59 | |