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

Unified Diff: src/IceTypes.cpp

Issue 659513005: Allow conditional lit tests in Subzero, based on build flags. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add -Wno-error=unused-parameter 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 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 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)
« 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