[clang] [Driver] Check the environment version except wasm case. (PR #80783)
Mike Hommey via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 6 12:08:44 PST 2024
================
@@ -1443,16 +1443,18 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
const ToolChain &TC = getToolChain(
*UArgs, computeTargetTriple(*this, TargetTriple, *UArgs));
- // Check if the environment version is valid.
- llvm::Triple Triple = TC.getTriple();
- 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)
- << TripleVersionName << TC.getTripleString();
- ContainsError = true;
+ // Check if the environment version is valid except wasm case.
+ if (!TC.getTriple().isWasm()) {
+ llvm::Triple Triple = TC.getTriple();
----------------
glandium wrote:
You could do
```
llvm::Triple Triple = TC.getTriple();
if (!Triple.isWasm()) {
```
https://github.com/llvm/llvm-project/pull/80783
More information about the cfe-commits
mailing list