Skip to content

Commit

Permalink
Make clang report invalid target versions for all environment.
Browse files Browse the repository at this point in the history
Followup for llvm#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.
  • Loading branch information
ZijunZhaoCCK committed Jan 26, 2024
1 parent 30be503 commit f32525a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,6 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> 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)
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/TargetParser/Triple.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f32525a

Please sign in to comment.