Chromium Code Reviews

Unified 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 formatting Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/IceTypes.cpp
diff --git a/src/IceTypes.cpp b/src/IceTypes.cpp
index a3e19ae07c001c3685c65da1700b21faa9c59782..29ff4de0799375d870be2385b40c53862dd641cd 100644
--- a/src/IceTypes.cpp
+++ b/src/IceTypes.cpp
@@ -228,6 +228,13 @@ Type getCompareResultType(Type Ty) {
return IceType_void;
}
+SizeT getScalarIntBitWidth(Type Ty) {
+ assert(isScalarIntegerType(Ty));
+ if (Ty == Ice::IceType_i1)
+ return 1;
+ return typeWidthInBytes(Ty) * CHAR_BIT;
+}
+
// ======================== Dump routines ======================== //
const char *typeString(Type Ty) {
« no previous file with comments | « src/IceTypes.h ('k') | src/PNaClTranslator.cpp » ('j') | src/PNaClTranslator.cpp » ('J')

Powered by Google App Engine