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

Side by Side Diff: src/IceTypes.cpp

Issue 576243002: Add switch instruction to Subzero bitcode reader. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix issues in patch set 2. Created 6 years, 3 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 221 }
222 222
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) {
232 assert(isScalarIntegerType(Ty));
233 if (Ty == Ice::IceType_i1)
234 return 1;
235 return typeWidthInBytes(Ty) * CHAR_BIT;
236 }
237
231 // ======================== Dump routines ======================== // 238 // ======================== Dump routines ======================== //
232 239
233 const char *typeString(Type Ty) { 240 const char *typeString(Type Ty) {
234 size_t Index = static_cast<size_t>(Ty); 241 size_t Index = static_cast<size_t>(Ty);
235 if (Index < IceType_NUM) 242 if (Index < IceType_NUM)
236 return TypeAttributes[Index].DisplayString; 243 return TypeAttributes[Index].DisplayString;
237 llvm_unreachable("Invalid type for typeString"); 244 llvm_unreachable("Invalid type for typeString");
238 return "???"; 245 return "???";
239 } 246 }
240 247
241 } // end of namespace Ice 248 } // 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