[llvm] [clang] Make clang report invalid target versions for all environment types. (PR #78655)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 18 16:54:25 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 8947469ec1ad6d35b2feec0acc43d0d191514f0b f440f44e7e270d4636ad39f4e4223c904e496d3a -- clang/lib/Driver/Driver.cpp clang/test/CodeGen/fp128_complex.c clang/test/Driver/mips-features.c clang/test/Frontend/fixed_point_bit_widths.c llvm/include/llvm/TargetParser/Triple.h llvm/lib/TargetParser/Triple.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 2d6986d145..d95feab220 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -1433,10 +1433,11 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
// Check if the environment version is valid.
llvm::Triple Triple = TC.getTriple();
StringRef TripleVersionName = Triple.getEnvironmentVersionString();
- StringRef TripleObjectFormat = Triple.getObjectFormatTypeName(Triple.getObjectFormat());
+ StringRef TripleObjectFormat =
+ Triple.getObjectFormatTypeName(Triple.getObjectFormat());
- if (Triple.getEnvironmentVersion().empty() && TripleVersionName != ""
- && TripleVersionName != TripleObjectFormat) {
+ if (Triple.getEnvironmentVersion().empty() && TripleVersionName != "" &&
+ TripleVersionName != TripleObjectFormat) {
Diags.Report(diag::err_drv_triple_version_invalid)
<< TripleVersionName << TC.getTripleString();
ContainsError = true;
diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h
index 525ea6df36..1263628402 100644
--- a/llvm/include/llvm/TargetParser/Triple.h
+++ b/llvm/include/llvm/TargetParser/Triple.h
@@ -252,7 +252,7 @@ public:
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
diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp
index 7bb2fb9d13..2bdf08c501 100644
--- a/llvm/lib/TargetParser/Triple.cpp
+++ b/llvm/lib/TargetParser/Triple.cpp
@@ -320,7 +320,8 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
case Callable: return "callable";
case Mesh: return "mesh";
case Amplification: return "amplification";
- case OpenCL: return "opencl";
+ case OpenCL:
+ return "opencl";
case OpenHOS: return "ohos";
}
@@ -1214,7 +1215,8 @@ VersionTuple Triple::getEnvironmentVersion() const {
StringRef Triple::getEnvironmentVersionString() const {
StringRef EnvironmentName = getEnvironmentName();
- // none is a valid environment type - it basically amounts to a freestanding environment.
+ // none is a valid environment type - it basically amounts to a freestanding
+ // environment.
if (EnvironmentName == "none")
return "";
``````````
</details>
https://github.com/llvm/llvm-project/pull/78655
More information about the cfe-commits
mailing list