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 origin/main HEAD --extensions h,cpp --
clang/include/clang/Basic/Sarif.h
clang/include/clang/Frontend/SARIFDiagnostic.h clang/lib/Basic/Sarif.cpp
clang/lib/Frontend/SARIFDiagnostic.cpp
clang/lib/Frontend/SARIFDiagnosticPrinter.cpp
clang/unittests/Basic/SarifTest.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Basic/Sarif.cpp b/clang/lib/Basic/Sarif.cpp
index 5e7b0ab69..d56a31a2a 100644
--- a/clang/lib/Basic/Sarif.cpp
+++ b/clang/lib/Basic/Sarif.cpp
@@ -407,21 +407,24 @@ void SarifDocumentWriter::appendResult(const SarifResult
&Result) {
if (!Result.RelatedLocations.empty()) {
json::Array ReLocs;
for (auto &RelatedLocation : Result.RelatedLocations) {
- const SarifChildResult* ChildResultPtr =
std::get_if<SarifChildResult>(&RelatedLocation);
- const CharSourceRange* CharSourceRangePtr =
std::get_if<CharSourceRange>(&RelatedLocation);
+ const SarifChildResult *ChildResultPtr =
+ std::get_if<SarifChildResult>(&RelatedLocation);
+ const CharSourceRange *CharSourceRangePtr =
+ std::get_if<CharSourceRange>(&RelatedLocation);
if (ChildResultPtr) {
json::Object Object;
Object.insert(
{"message", createMessage(ChildResultPtr->DiagnosticMessage)});
if (ChildResultPtr->Locations.size() >= 1)
- for (auto &kv :
-
createLocation(createPhysicalLocation(ChildResultPtr->Locations[0])))
+ for (auto &kv : createLocation(
+ createPhysicalLocation(ChildResultPtr->Locations[0])))
Object.insert({kv.getFirst(), kv.getSecond()});
- Object.insert({"properties",
- json::Object{{"nestingLevel",
ChildResultPtr->Nesting}}});
+ Object.insert({"properties", json::Object{{"nestingLevel",
+ ChildResultPtr->Nesting}}});
ReLocs.emplace_back(std::move(Object));
} else if (CharSourceRangePtr) {
-
ReLocs.emplace_back(createLocation(createPhysicalLocation(*CharSourceRangePtr)));
+ ReLocs.emplace_back(
+ createLocation(createPhysicalLocation(*CharSourceRangePtr)));
}
}
Ret["relatedLocations"] = std::move(ReLocs);
``````````
</details>
https://github.com/llvm/llvm-project/pull/174106
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits