[ADT] Normalize empty triple components
authorPetr Hosek <phosek@chromium.org>
Wed, 8 Aug 2018 22:23:57 +0000 (22:23 +0000)
committerPetr Hosek <phosek@chromium.org>
Wed, 8 Aug 2018 22:23:57 +0000 (22:23 +0000)
commit7b2745447783faa5f94b6f31377fba9284b2e321
tree2c8132ec5bd8ff83b9bd368fa91331e3f20ec8fd
parentf8937c8406987341411b2399de91b718d546a230
[ADT] Normalize empty triple components

LLVM triple normalization is handling "unknown" and empty components
differently; for example given "x86_64-unknown-linux-gnu" and
"x86_64-linux-gnu" which should be equivalent, triple normalization
returns "x86_64-unknown-linux-gnu" and "x86_64--linux-gnu". autoconf's
config.sub returns "x86_64-unknown-linux-gnu" for both
"x86_64-linux-gnu" and "x86_64-unknown-linux-gnu". This changes the
triple normalization to behave the same way, replacing empty triple
components with "unknown".

This addresses PR37129.

Differential Revision: https://reviews.llvm.org/D50219

llvm-svn: 339294
34 files changed:
clang/lib/Frontend/CompilerInstance.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/coff-aarch64-type-sizes.c
clang/test/Driver/arm-ias-Wa.s
clang/test/Driver/arm-target-as-mthumb.s
clang/test/Driver/baremetal.cpp
clang/test/Driver/biarch.c
clang/test/Driver/clang-translation.c
clang/test/Driver/cuda-detect.cu
clang/test/Driver/cuda-no-pgo-or-coverage.cu
clang/test/Driver/cuda-no-sanitizers.cu
clang/test/Driver/cuda-no-stack-protector.cu
clang/test/Driver/cuda-options.cu
clang/test/Driver/cuda-output-asm.cu
clang/test/Driver/fsanitize.c
clang/test/Driver/hip-binding.hip
clang/test/Driver/hip-toolchain.hip
clang/test/Driver/miamcu-opt.c
clang/test/Driver/nacl-direct.c
clang/test/Driver/netbsd.c
clang/test/Driver/netbsd.cpp
clang/test/Driver/nios2-cpu.c
clang/test/Driver/offloading-interoperability.c
clang/test/Driver/openmp-offload.c
clang/test/Driver/parse-progname.c
clang/test/Driver/ropi-rwpi.c
clang/test/Driver/windows-arm-minimal-arch.c
clang/test/Frontend/windows-exceptions.cpp
llvm/lib/Support/Triple.cpp
llvm/test/CodeGen/ARM/invalid-target.ll
llvm/tools/llvm-mc/llvm-mc.cpp
llvm/tools/llvm-mca/llvm-mca.cpp
llvm/tools/llvm-objdump/llvm-objdump.cpp
llvm/unittests/ADT/TripleTest.cpp