Index: src/IceTypes.cpp |
diff --git a/src/IceTypes.cpp b/src/IceTypes.cpp |
index 6b81d8ac9e8765aef9dee0736bbcee4972373e8a..7155baa48dce3d517f867d1876c4589b645af9d8 100644 |
--- a/src/IceTypes.cpp |
+++ b/src/IceTypes.cpp |
@@ -18,6 +18,12 @@ namespace Ice { |
namespace { |
+const char *TargetArchName[] = { |
+#define X(tag, str) str , |
+ TARGETARCH_TABLE |
+#undef X |
+}; |
+ |
// Show tags match between ICETYPE_TABLE and ICETYPE_PROPS_TABLE. |
// Define a temporary set of enum values based on ICETYPE_TABLE |
@@ -116,6 +122,14 @@ const TypePropertyFields TypePropertiesTable[] = { |
} // end anonymous namespace |
+const char *targetArchString(const TargetArch Arch) { |
+ size_t Index = static_cast<size_t>(Arch); |
+ if (Index < TargetArch_NUM) |
+ return TargetArchName[Index]; |
+ llvm_unreachable("Invalid target arch for targetArchString"); |
+ return "???"; |
+} |
+ |
size_t typeWidthInBytes(Type Ty) { |
size_t Index = static_cast<size_t>(Ty); |
if (Index < IceType_NUM) |