Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: src/IceTypes.cpp

Issue 625243002: Convert Subzero's bitcode reader to generate ICE types. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceTypes.h ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/IceTypes.h ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698