Index: llvm/trunk/include/llvm/ADT/Triple.h =================================================================== --- llvm/trunk/include/llvm/ADT/Triple.h +++ llvm/trunk/include/llvm/ADT/Triple.h @@ -64,6 +64,7 @@ amdgcn, // AMDGCN: AMD GCN GPUs sparc, // Sparc: sparc sparcv9, // Sparcv9: Sparcv9 + sparcel, // Sparc: (endianness = little). NB: 'Sparcle' is a CPU variant systemz, // SystemZ: s390x tce, // TCE (http://tce.cs.tut.fi/): tce thumb, // Thumb (little endian): thumb, thumbv.* Index: llvm/trunk/lib/Support/Triple.cpp =================================================================== --- llvm/trunk/lib/Support/Triple.cpp +++ llvm/trunk/lib/Support/Triple.cpp @@ -37,6 +37,7 @@ case amdgcn: return "amdgcn"; case sparc: return "sparc"; case sparcv9: return "sparcv9"; + case sparcel: return "sparcel"; case systemz: return "s390x"; case tce: return "tce"; case thumb: return "thumb"; @@ -90,6 +91,7 @@ case bpf: return "bpf"; case sparcv9: + case sparcel: case sparc: return "sparc"; case systemz: return "s390"; @@ -312,6 +314,7 @@ .Case("hexagon", Triple::hexagon) .Case("s390x", Triple::systemz) .Case("sparc", Triple::sparc) + .Case("sparcel", Triple::sparcel) .Cases("sparcv9", "sparc64", Triple::sparcv9) .Case("tce", Triple::tce) .Case("xcore", Triple::xcore) @@ -918,6 +921,7 @@ case llvm::Triple::ppc: case llvm::Triple::r600: case llvm::Triple::sparc: + case llvm::Triple::sparcel: case llvm::Triple::tce: case llvm::Triple::thumb: case llvm::Triple::thumbeb: @@ -990,6 +994,7 @@ case Triple::ppc: case Triple::r600: case Triple::sparc: + case Triple::sparcel: case Triple::tce: case Triple::thumb: case Triple::thumbeb: @@ -1026,6 +1031,7 @@ case Triple::thumb: case Triple::thumbeb: case Triple::xcore: + case Triple::sparcel: T.setArch(UnknownArch); break; Index: llvm/trunk/unittests/ADT/TripleTest.cpp =================================================================== --- llvm/trunk/unittests/ADT/TripleTest.cpp +++ llvm/trunk/unittests/ADT/TripleTest.cpp @@ -149,6 +149,11 @@ EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); EXPECT_EQ(Triple::UnknownOS, T.getOS()); + T = Triple("sparcel-unknown-unknown"); + EXPECT_EQ(Triple::sparcel, T.getArch()); + EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); + EXPECT_EQ(Triple::UnknownOS, T.getOS()); + T = Triple("spir-unknown-unknown"); EXPECT_EQ(Triple::spir, T.getArch()); EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); @@ -407,6 +412,21 @@ EXPECT_FALSE(T.isArch16Bit()); EXPECT_FALSE(T.isArch32Bit()); EXPECT_TRUE(T.isArch64Bit()); + + T.setArch(Triple::sparc); + EXPECT_FALSE(T.isArch16Bit()); + EXPECT_TRUE(T.isArch32Bit()); + EXPECT_FALSE(T.isArch64Bit()); + + T.setArch(Triple::sparcel); + EXPECT_FALSE(T.isArch16Bit()); + EXPECT_TRUE(T.isArch32Bit()); + EXPECT_FALSE(T.isArch64Bit()); + + T.setArch(Triple::sparcv9); + EXPECT_FALSE(T.isArch16Bit()); + EXPECT_FALSE(T.isArch32Bit()); + EXPECT_TRUE(T.isArch64Bit()); } TEST(TripleTest, BitWidthArchVariants) {