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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
244 | 244 |
245 SizeT getScalarIntBitWidth(Type Ty) { | 245 SizeT getScalarIntBitWidth(Type Ty) { |
246 assert(isScalarIntegerType(Ty)); | 246 assert(isScalarIntegerType(Ty)); |
247 if (Ty == IceType_i1) | 247 if (Ty == IceType_i1) |
248 return 1; | 248 return 1; |
249 return typeWidthInBytes(Ty) * CHAR_BIT; | 249 return typeWidthInBytes(Ty) * CHAR_BIT; |
250 } | 250 } |
251 | 251 |
252 // ======================== Dump routines ======================== // | 252 // ======================== Dump routines ======================== // |
253 | 253 |
254 const char *typeString(Type Ty) { | 254 const char *typeString(Type Ty) { |
Jim Stichnoth
2014/11/12 14:34:15
Can you "get rid of" this as well?
Karl
2014/11/17 18:59:46
At the moment, these names are used to generate la
| |
255 size_t Index = static_cast<size_t>(Ty); | 255 size_t Index = static_cast<size_t>(Ty); |
256 if (Index < IceType_NUM) | 256 if (Index < IceType_NUM) |
257 return TypeAttributes[Index].DisplayString; | 257 return TypeAttributes[Index].DisplayString; |
258 llvm_unreachable("Invalid type for typeString"); | 258 llvm_unreachable("Invalid type for typeString"); |
259 return "???"; | 259 return "???"; |
260 } | 260 } |
261 | 261 |
262 void FuncSigType::dump(Ostream &Stream) const { | 262 void FuncSigType::dump(Ostream &Stream) const { |
263 if (!ALLOW_DUMP) | |
264 return; | |
263 Stream << ReturnType << " ("; | 265 Stream << ReturnType << " ("; |
264 bool IsFirst = true; | 266 bool IsFirst = true; |
265 for (const Type ArgTy : ArgList) { | 267 for (const Type ArgTy : ArgList) { |
266 if (IsFirst) { | 268 if (IsFirst) { |
267 IsFirst = false; | 269 IsFirst = false; |
268 } else { | 270 } else { |
269 Stream << ", "; | 271 Stream << ", "; |
270 } | 272 } |
271 Stream << ArgTy; | 273 Stream << ArgTy; |
272 } | 274 } |
273 Stream << ")"; | 275 Stream << ")"; |
274 } | 276 } |
275 | 277 |
276 } // end of namespace Ice | 278 } // end of namespace Ice |
OLD | NEW |