[Driver] Check the environment version except wasm case.#80783
Merged
ZijunZhaoCCK merged 5 commits intollvm:mainfrom Feb 6, 2024
Merged
[Driver] Check the environment version except wasm case.#80783ZijunZhaoCCK merged 5 commits intollvm:mainfrom
ZijunZhaoCCK merged 5 commits intollvm:mainfrom
Conversation
Member
|
@llvm/pr-subscribers-clang Author: None (ZijunZhaoCCK) ChangesAdd isWasm() check for here: #78655 (comment) Full diff: https://github.com/llvm/llvm-project/pull/80783.diff 1 Files Affected:
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 29db9543f3655..04d02ea500d19 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -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();
+ 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;
+ }
}
// Report warning when arm64EC option is overridden by specified target
|
Member
|
@llvm/pr-subscribers-clang-driver Author: None (ZijunZhaoCCK) ChangesAdd isWasm() check for here: #78655 (comment) Full diff: https://github.com/llvm/llvm-project/pull/80783.diff 1 Files Affected:
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 29db9543f36553..04d02ea500d19f 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -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();
+ 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;
+ }
}
// Report warning when arm64EC option is overridden by specified target
|
Member
|
Add a test? |
Contributor
Author
Done. Add several tests. |
Member
|
wasm tests in android-* seem weird. A wasm file should be used |
glandium
reviewed
Feb 6, 2024
MaskRay
approved these changes
Feb 6, 2024
Member
MaskRay
left a comment
There was a problem hiding this comment.
LGTM with glandium's suggestion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add isWasm() check for here: #78655 (comment)