[PATCH] D15238: parseArch() supports more variations of arch names

Kelvin Li via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 4 11:08:33 PST 2015


kkwli0 created this revision.
kkwli0 added reviewers: hfinkel, wschmidt, kbarton, nemanjai, klimek.
kkwli0 added subscribers: llvm-commits, fraggamuffin.

It is a regression from r249391.  The following test failures are found if the build is configured as 'cmake -DLLVM_TARGETS_TO_BUILD="PowerPC" ...'.

Clang-Unit :: Tooling/Release/ToolingTests/addTargetAndModeForProgramName.AddsTargetAndMode
Clang-Unit :: Tooling/Release/ToolingTests/addTargetAndModeForProgramName.IgnoresExistingMode
Clang-Unit :: Tooling/Release/ToolingTests/addTargetAndModeForProgramName.IgnoresExistingTarget
Clang-Unit :: Tooling/Release/ToolingTests/addTargetAndModeForProgramName.PathIgnored

The problem is due to a mismatch between the entries in the target registry and what arch name parseArch() can recognize.  For example, with -DLLVM_TARGETS_TO_BUILD="PowerPC", the target registry will have ppc32, ppc64 and ppc64le.  When one of those is used in parseArch() to construct part of the triple, an unknown is returned.  Similar problem occurs with builds only targeting systemz.

http://reviews.llvm.org/D15238

Files:
  lib/Support/Triple.cpp

Index: lib/Support/Triple.cpp
===================================================================
--- lib/Support/Triple.cpp
+++ lib/Support/Triple.cpp
@@ -338,9 +338,9 @@
     // FIXME: Do we need to support these?
     .Cases("i786", "i886", "i986", Triple::x86)
     .Cases("amd64", "x86_64", "x86_64h", Triple::x86_64)
-    .Case("powerpc", Triple::ppc)
-    .Cases("powerpc64", "ppu", Triple::ppc64)
-    .Case("powerpc64le", Triple::ppc64le)
+    .Cases("powerpc", "ppc32", Triple::ppc)
+    .Cases("powerpc64", "ppu", "ppc64", Triple::ppc64)
+    .Cases("powerpc64le", "ppc64le", Triple::ppc64le)
     .Case("xscale", Triple::arm)
     .Case("xscaleeb", Triple::armeb)
     .Case("aarch64", Triple::aarch64)
@@ -359,7 +359,7 @@
     .Case("r600", Triple::r600)
     .Case("amdgcn", Triple::amdgcn)
     .Case("hexagon", Triple::hexagon)
-    .Case("s390x", Triple::systemz)
+    .Cases("s390x", "systemz", Triple::systemz)
     .Case("sparc", Triple::sparc)
     .Case("sparcel", Triple::sparcel)
     .Cases("sparcv9", "sparc64", Triple::sparcv9)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15238.41900.patch
Type: text/x-patch
Size: 1055 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151204/b497da4d/attachment.bin>


More information about the llvm-commits mailing list