Index: include/llvm/ADT/Triple.h =================================================================== --- include/llvm/ADT/Triple.h +++ include/llvm/ADT/Triple.h @@ -83,6 +83,8 @@ spir64, // SPIR: standard portable IR for OpenCL 64-bit version kalimba // Kalimba: generic kalimba }; + // Keep this in sync with the preceding list. + static const ArchType ArchTypeMax = kalimba; enum SubArchType { NoSubArch, @@ -119,6 +121,8 @@ NVIDIA, CSR }; + // Keep this in sync with the preceding list. + static const VendorType VendorTypeMax = CSR; enum OSType { UnknownOS, @@ -147,6 +151,8 @@ AMDHSA, // AMD HSA Runtime PS4 }; + // Keep this in sync with the preceding list. + static const OSType OSTypeMax = PS4; enum EnvironmentType { UnknownEnvironment, @@ -163,6 +169,8 @@ Itanium, Cygnus, }; + // Keep this in sync with the preceding list. + static const EnvironmentType EnvironmentTypeMax = Cygnus; enum ObjectFormatType { UnknownObjectFormat, Index: unittests/ADT/TripleTest.cpp =================================================================== --- unittests/ADT/TripleTest.cpp +++ unittests/ADT/TripleTest.cpp @@ -220,12 +220,12 @@ // Check that normalizing a permutated set of valid components returns a // triple with the unpermuted components. StringRef C[4]; - for (int Arch = 1+Triple::UnknownArch; Arch <= Triple::amdil; ++Arch) { + for (int Arch = 1+Triple::UnknownArch; Arch <= Triple::ArchTypeMax; ++Arch) { C[0] = Triple::getArchTypeName(Triple::ArchType(Arch)); - for (int Vendor = 1+Triple::UnknownVendor; Vendor <= Triple::PC; + for (int Vendor = 1+Triple::UnknownVendor; Vendor <= Triple::VendorTypeMax; ++Vendor) { C[1] = Triple::getVendorTypeName(Triple::VendorType(Vendor)); - for (int OS = 1+Triple::UnknownOS; OS <= Triple::Minix; ++OS) { + for (int OS = 1+Triple::UnknownOS; OS <= Triple::OSTypeMax; ++OS) { if (OS == Triple::Win32) continue; @@ -240,7 +240,7 @@ EXPECT_EQ(E, Triple::normalize(Join(C[2], C[0], C[1]))); EXPECT_EQ(E, Triple::normalize(Join(C[2], C[1], C[0]))); - for (int Env = 1 + Triple::UnknownEnvironment; Env <= Triple::Android; + for (int Env = 1 + Triple::UnknownEnvironment; Env <= Triple::EnvironmentTypeMax; ++Env) { C[3] = Triple::getEnvironmentTypeName(Triple::EnvironmentType(Env));