OLD | NEW |
1 //===- subzero/src/IceTypes.cpp - Primitive type properties ---------------===// | 1 //===- subzero/src/IceTypes.cpp - Primitive type properties ---------------===// |
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 a few attributes of Subzero primitive types. | 10 // This file defines a few attributes of Subzero primitive types. |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 Type getCompareResultType(Type Ty) { | 223 Type getCompareResultType(Type Ty) { |
224 size_t Index = static_cast<size_t>(Ty); | 224 size_t Index = static_cast<size_t>(Ty); |
225 if (Index < IceType_NUM) | 225 if (Index < IceType_NUM) |
226 return TypePropertiesTable[Index].CompareResultType; | 226 return TypePropertiesTable[Index].CompareResultType; |
227 llvm_unreachable("Invalid type for getCompareResultType"); | 227 llvm_unreachable("Invalid type for getCompareResultType"); |
228 return IceType_void; | 228 return IceType_void; |
229 } | 229 } |
230 | 230 |
231 SizeT getScalarIntBitWidth(Type Ty) { | 231 SizeT getScalarIntBitWidth(Type Ty) { |
232 assert(isScalarIntegerType(Ty)); | 232 assert(isScalarIntegerType(Ty)); |
233 if (Ty == Ice::IceType_i1) | 233 if (Ty == IceType_i1) |
234 return 1; | 234 return 1; |
235 return typeWidthInBytes(Ty) * CHAR_BIT; | 235 return typeWidthInBytes(Ty) * CHAR_BIT; |
236 } | 236 } |
237 | 237 |
238 // ======================== Dump routines ======================== // | 238 // ======================== Dump routines ======================== // |
239 | 239 |
240 const char *typeString(Type Ty) { | 240 const char *typeString(Type Ty) { |
241 size_t Index = static_cast<size_t>(Ty); | 241 size_t Index = static_cast<size_t>(Ty); |
242 if (Index < IceType_NUM) | 242 if (Index < IceType_NUM) |
243 return TypeAttributes[Index].DisplayString; | 243 return TypeAttributes[Index].DisplayString; |
244 llvm_unreachable("Invalid type for typeString"); | 244 llvm_unreachable("Invalid type for typeString"); |
245 return "???"; | 245 return "???"; |
246 } | 246 } |
247 | 247 |
| 248 void FuncSigType::dump(Ostream &Stream) const { |
| 249 Stream << ReturnType << " ("; |
| 250 bool IsFirst = true; |
| 251 for (const Type ArgTy : ArgList) { |
| 252 if (IsFirst) { |
| 253 IsFirst = false; |
| 254 } else { |
| 255 Stream << ", "; |
| 256 } |
| 257 Stream << ArgTy; |
| 258 } |
| 259 Stream << ")"; |
| 260 } |
| 261 |
248 } // end of namespace Ice | 262 } // end of namespace Ice |
OLD | NEW |