From f32525a09f59943cb91a5468b2aa89f8d14f450f Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Fri, 19 Jan 2024 00:47:05 +0000 Subject: [PATCH] Make clang report invalid target versions for all environment. Followup for https://github.com/llvm/llvm-project/pull/75373 1. Make this feature not just available for android, but everyone. 2. Correct some target triples. 3. Add opencl to the environment type list. --- clang/lib/Driver/Driver.cpp | 1 - llvm/include/llvm/TargetParser/Triple.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index dc769386b4cae..29db9543f3655 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -1448,7 +1448,6 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { StringRef TripleVersionName = Triple.getEnvironmentVersionString(); StringRef TripleObjectFormat = Triple.getObjectFormatTypeName(Triple.getObjectFormat()); - if (Triple.getEnvironmentVersion().empty() && TripleVersionName != "" && TripleVersionName != TripleObjectFormat) { Diags.Report(diag::err_drv_triple_version_invalid) diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h index 26b9d30eaa3d5..aeb9c386823e8 100644 --- a/llvm/include/llvm/TargetParser/Triple.h +++ b/llvm/include/llvm/TargetParser/Triple.h @@ -255,7 +255,7 @@ class Triple { Cygnus, CoreCLR, Simulator, // Simulator variants of other systems, e.g., Apple's iOS - MacABI, // Mac Catalyst variant of Apple's iOS deployment target. + MacABI, // Mac Catalyst variant of Apple's iOS deployment target. // Shader Stages // The order of these values matters, and must be kept in sync with the