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

Unified Diff: src/IceTypes.cpp

Issue 1614273002: Subzero: Make -reg-use and -reg-exclude specific to register class. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add error log Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceTypes.h ('k') | src/IceTypes.def » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTypes.cpp
diff --git a/src/IceTypes.cpp b/src/IceTypes.cpp
index 2614d74152b17d286123988765e7a6dd394c907b..39eff2dfedaa2ea65ae80fbead1e579f648dbca3 100644
--- a/src/IceTypes.cpp
+++ b/src/IceTypes.cpp
@@ -30,7 +30,7 @@ const char *TargetArchName[] = {
// Define a temporary set of enum values based on ICETYPE_TABLE
enum {
-#define X(tag, sizeLog2, align, elts, elty, str) _table_tag_##tag,
+#define X(tag, sizeLog2, align, elts, elty, str, rcstr) _table_tag_##tag,
ICETYPE_TABLE
#undef X
_enum_table_tag_Names
@@ -45,7 +45,7 @@ enum {
_enum_props_table_tag_Names
};
// Assert that tags in ICETYPE_TABLE are also in ICETYPE_PROPS_TABLE.
-#define X(tag, sizeLog2, align, elts, elty, str) \
+#define X(tag, sizeLog2, align, elts, elty, str, rcstr) \
static_assert( \
(unsigned)_table_tag_##tag == (unsigned)_props_table_tag_##tag, \
"Inconsistency between ICETYPE_PROPS_TABLE and ICETYPE_TABLE");
@@ -64,7 +64,8 @@ ICETYPE_PROPS_TABLE
// Define constants for each element size in ICETYPE_TABLE.
enum {
-#define X(tag, sizeLog2, align, elts, elty, str) _table_elts_##tag = elts,
+#define X(tag, sizeLog2, align, elts, elty, str, rcstr) \
+ _table_elts_##tag = elts,
ICETYPE_TABLE
#undef X
_enum_table_elts_Elements = 0
@@ -91,11 +92,12 @@ struct TypeAttributeFields {
size_t TypeNumElements;
Type TypeElementType;
const char *DisplayString;
+ const char *RegClassString;
};
const struct TypeAttributeFields TypeAttributes[] = {
-#define X(tag, sizeLog2, align, elts, elty, str) \
- { sizeLog2, align, elts, IceType_##elty, str } \
+#define X(tag, sizeLog2, align, elts, elty, str, rcstr) \
+ { sizeLog2, align, elts, IceType_##elty, str, rcstr } \
,
ICETYPE_TABLE
#undef X
@@ -280,6 +282,13 @@ const char *typeString(Type Ty) {
return "???";
}
+const char *regClassString(RegClass C) {
+ if (static_cast<size_t>(C) < IceType_NUM)
+ return TypeAttributes[C].RegClassString;
+ llvm_unreachable("Invalid type for regClassString");
+ return "???";
+}
+
void FuncSigType::dump(Ostream &Stream) const {
if (!BuildDefs::dump())
return;
« no previous file with comments | « src/IceTypes.h ('k') | src/IceTypes.def » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698