OLD | NEW |
1 //===- subzero/src/IceTypeConverter.h - Convert ICE/LLVM Types --*- C++ -*-===// | 1 //===- subzero/src/IceTypeConverter.h - Convert ICE/LLVM Types --*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines how to convert LLVM types to ICE types, and ICE types | 10 // This file defines how to convert LLVM types to ICE types, and ICE types |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 /// Returns LLVM integer type with specified number of bits. Returns | 55 /// Returns LLVM integer type with specified number of bits. Returns |
56 /// NULL if not a valid PNaCl integer type. | 56 /// NULL if not a valid PNaCl integer type. |
57 llvm::Type *getLLVMIntegerType(unsigned NumBits) const; | 57 llvm::Type *getLLVMIntegerType(unsigned NumBits) const; |
58 | 58 |
59 /// Returns the LLVM vector type for Size and Ty arguments. Returns | 59 /// Returns the LLVM vector type for Size and Ty arguments. Returns |
60 /// NULL if not a valid PNaCl vector type. | 60 /// NULL if not a valid PNaCl vector type. |
61 llvm::Type *getLLVMVectorType(unsigned Size, Type Ty) const; | 61 llvm::Type *getLLVMVectorType(unsigned Size, Type Ty) const; |
62 | 62 |
63 private: | 63 private: |
64 // The LLVM context to use to build LLVM types. | |
65 llvm::LLVMContext &Context; | |
66 // The list of allowable LLVM types. Indexed by ICE type. | 64 // The list of allowable LLVM types. Indexed by ICE type. |
67 std::vector<llvm::Type *> LLVMTypes; | 65 std::vector<llvm::Type *> LLVMTypes; |
68 // The inverse mapping of LLVMTypes. | 66 // The inverse mapping of LLVMTypes. |
69 std::map<llvm::Type *, Type> LLVM2IceMap; | 67 std::map<llvm::Type *, Type> LLVM2IceMap; |
70 | 68 |
71 // Add LLVM/ICE pair to internal tables. | 69 // Add LLVM/ICE pair to internal tables. |
72 void AddLLVMType(Type Ty, llvm::Type *LLVMTy); | 70 void AddLLVMType(Type Ty, llvm::Type *LLVMTy); |
73 | 71 |
74 // Converts types not in LLVM2IceMap. | 72 // Converts types not in LLVM2IceMap. |
75 Type convertToIceTypeOther(llvm::Type *LLVMTy) const; | 73 Type convertToIceTypeOther(llvm::Type *LLVMTy) const; |
76 }; | 74 }; |
77 | 75 |
78 } // end of Ice namespace. | 76 } // end of Ice namespace. |
79 | 77 |
80 #endif // SUBZERO_SRC_ICETYPECONVERTER_H | 78 #endif // SUBZERO_SRC_ICETYPECONVERTER_H |
OLD | NEW |