Skip to content

Commit

Permalink
Integrate LLVM at llvm/llvm-project@f58ce1152703
Browse files Browse the repository at this point in the history
Updates LLVM usage to match
[f58ce1152703](llvm/llvm-project@f58ce1152703)

PiperOrigin-RevId: 688990756
  • Loading branch information
krasimirgg authored and copybara-github committed Oct 23, 2024
1 parent 83a215c commit 0e3f52d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
43 changes: 43 additions & 0 deletions third_party/llvm/generated.patch
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
Auto generated patch. Do not edit or delete it, even if empty.
diff -ruN --strip-trailing-cr a/lldb/source/Utility/DiagnosticsRendering.cpp b/lldb/source/Utility/DiagnosticsRendering.cpp
--- a/lldb/source/Utility/DiagnosticsRendering.cpp
+++ b/lldb/source/Utility/DiagnosticsRendering.cpp
@@ -99,10 +99,10 @@

// Sort the diagnostics.
auto sort = [](auto &ds) {
- llvm::sort(ds.begin(), ds.end(), [](auto &d1, auto &d2) {
+ std::stable_sort(ds.begin(), ds.end(), [](auto &d1, auto &d2) {
auto l1 = d1.source_location.value_or(DiagnosticDetail::SourceLocation{});
auto l2 = d2.source_location.value_or(DiagnosticDetail::SourceLocation{});
- return std::pair(l1.line, l2.column) < std::pair(l1.line, l2.column);
+ return std::tie(l1.line, l1.column) < std::tie(l2.line, l2.column);
});
};
sort(remaining_details);
diff -ruN --strip-trailing-cr a/lldb/unittests/Utility/DiagnosticsRenderingTest.cpp b/lldb/unittests/Utility/DiagnosticsRenderingTest.cpp
--- a/lldb/unittests/Utility/DiagnosticsRenderingTest.cpp
+++ b/lldb/unittests/Utility/DiagnosticsRenderingTest.cpp
@@ -46,16 +46,20 @@
std::string result =
Render({DiagnosticDetail{loc2, eSeverityError, "X", "X"},
DiagnosticDetail{loc1, eSeverityError, "Y", "Y"}});
- ASSERT_LT(StringRef(result).find("Y"), StringRef(result).find("X"));
+ // Unintuitively the later diagnostic appears first in the string:
+ // ^ ^
+ // | second
+ // first
+ ASSERT_GT(StringRef(result).find("Y"), StringRef(result).find("X"));
}
{
// Test that diagnostics in reverse order are emitted correctly.
- SourceLocation loc1 = {FileSpec{"a.c"}, 2, 10, 0, false, true};
+ SourceLocation loc1 = {FileSpec{"a.c"}, 1, 10, 0, false, true};
SourceLocation loc2 = {FileSpec{"a.c"}, 1, 20, 0, false, true};
std::string result =
Render({DiagnosticDetail{loc2, eSeverityError, "X", "X"},
DiagnosticDetail{loc1, eSeverityError, "Y", "Y"}});
- ASSERT_LT(StringRef(result).find("Y"), StringRef(result).find("X"));
+ ASSERT_GT(StringRef(result).find("Y"), StringRef(result).find("X"));
}
{
// Test that range diagnostics are emitted correctly.
4 changes: 2 additions & 2 deletions third_party/llvm/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ load("//third_party:repo.bzl", "tf_http_archive")

def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "7dc2542ac24fcae89dfd179fa58c4ec4fb959e2b"
LLVM_SHA256 = "4e9663e0293673087dc4c0b355043a60d6805524a93efc5d8c17ec51c271369d"
LLVM_COMMIT = "f58ce1152703ca753794b8cef36da30bd2668d0f"
LLVM_SHA256 = "cfb4610ba8b15cfe0e1ec3b6b680416983a2a5cd6883147f0fe0043c61bbcb7c"

tf_http_archive(
name = name,
Expand Down

0 comments on commit 0e3f52d

Please sign in to comment.