[clang][PPC] Supporting -mcpu=405
authorQiongsi Wu <qiongsiwu@gmail.com>
Thu, 15 Dec 2022 15:03:05 +0000 (10:03 -0500)
committerQiongsi Wu <qiongsiwu@gmail.com>
Thu, 15 Dec 2022 15:55:26 +0000 (10:55 -0500)
commitde8deb5189c948db89c753ff2dff65b8e7840e8b
treeecc5b39a1911391e80b448733905bb74ffcc21d5
parenta33b40d61c64b95d736f1a0dd537e9087c330304
[clang][PPC] Supporting -mcpu=405

The  ClangBuiltLinux  project relies on `-mcpu=405`. Before https://reviews.llvm.org/D139720, `clang` treated `-mcpu=405` implicitly in the same way as `-mcpu=generic`, because `405` was an unknown value and `clang` did not validate unknown input values. https://reviews.llvm.org/D139720 added the validation of `-mcpu` input value, and `clang` now generates an error with `-mcpu=405`. For further details of the problem, see https://github.com/ClangBuiltLinux/linux/issues/1771.

This patch adds support of `-mcpu=405` explicitly, and treats it as an equivalent of `-mcpu=generic`.

Reviewed By: nemanjai

Differential Revision: https://reviews.llvm.org/D140080
clang/lib/Driver/ToolChains/Arch/PPC.cpp
clang/test/Driver/ppc-cpus.c