Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ bazel_dep(name = "zstd", version = "1.5.6", repo_name = "llvm_zstd")

# We pin to specific upstream commits and try to track top-of-tree reasonably
# closely rather than pinning to a specific release.
# HEAD as of 2024-09-25.
llvm_project_version = "29b92d07746fac26cd64c914bc9c5c3833974f6d"
# HEAD as of 2024-10-17.
llvm_project_version = "5033ea73bb01061feb09b3216c74619e1fbefdeb"

# Load a repository for the raw llvm-project, pre-overlay.
http_archive(
Expand All @@ -151,7 +151,7 @@ http_archive(
"@carbon//bazel/llvm_project:0001_Patch_for_mallinfo2_when_using_Bazel_build_system.patch",
"@carbon//bazel/llvm_project:0002_Added_Bazel_build_for_compiler_rt_fuzzer.patch",
],
sha256 = "3e8e93e3749454af4b64f7f34b792a4748b62fc533bca1703d33b2b04e34eb70",
sha256 = "9964d7643f3cb1cfabde913b747a2fa2524c469adc847fceee4dd883dbc0482a",
strip_prefix = "llvm-project-{0}".format(llvm_project_version),
urls = ["https://github.com/llvm/llvm-project/archive/{0}.tar.gz".format(llvm_project_version)],
)
Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ static auto CheckRedeclParams(Context& context, SemIRLoc new_decl_loc,
}
CARBON_DIAGNOSTIC(RedeclParamListDiffers, Error,
"redeclaration differs because of "
"{1:'|missing '}{0:implicit |}parameter list",
"{1:|missing }{0:implicit |}parameter list",
BoolAsSelect, BoolAsSelect);
CARBON_DIAGNOSTIC(RedeclParamListPrevious, Note,
"previously declared "
Expand Down
10 changes: 0 additions & 10 deletions toolchain/diagnostics/format_providers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ auto llvm::format_provider<Carbon::BoolAsSelect>::format(
return;
}

// Remove wrapping quotes if present.
if (style.starts_with('\'') && style.ends_with('\'')) {
style = style.drop_front().drop_back();
}

auto sep = style.find('|');
CARBON_CHECK(
sep != llvm::StringRef::npos,
Expand Down Expand Up @@ -48,11 +43,6 @@ auto llvm::format_provider<Carbon::IntAsSelect>::format(
return;
}

// Remove wrapping quotes if present.
if (style.starts_with('\'') && style.ends_with('\'')) {
style = style.drop_front().drop_back();
}

auto cursor = style;
while (!cursor.empty()) {
auto case_sep = cursor.find("|");
Expand Down
10 changes: 0 additions & 10 deletions toolchain/diagnostics/format_providers.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ namespace Carbon {
// - Selector, as in `{0:true|false}`. The output string used is separated by a
// `|`, with the true case first. the example would yield standard bool
// formatting.
//
// If needed, the _full_ style string can be wrapped with `'` in order to
// preserve prefix or suffix whitespace (which is stripped by formatv). For
// example, `{0:' true | false '}` retains whitespace which would be dropped
// before `true` and after `false`.
struct BoolAsSelect {
// NOLINTNEXTLINE(google-explicit-constructor)
BoolAsSelect(bool value) : value(value) {}
Expand Down Expand Up @@ -51,11 +46,6 @@ struct BoolAsSelect {
// - default -> `other`
//
// As another example, `{0:=1:is|:are}` is a way to handle plural-based output.
//
// If needed, the _full_ style string can be wrapped with `'` in order to
// preserve prefix or suffix whitespace (which is stripped by formatv). For
// example, `{0:'=0: zero |=1: one '}` retains whitespace which would be dropped
// after `one`.
struct IntAsSelect {
// NOLINTNEXTLINE(google-explicit-constructor)
IntAsSelect(int value) : value(value) {}
Expand Down
13 changes: 0 additions & 13 deletions toolchain/diagnostics/format_providers_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ TEST(BoolAsSelect, CasesWithNormalFormat) {

TEST(BoolAsSelect, Spaces) {
constexpr char Format[] = "{0: a | b }";
EXPECT_THAT(llvm::formatv(Format, BoolAsSelect(true)).str(), Eq("a "));
EXPECT_THAT(llvm::formatv(Format, BoolAsSelect(false)).str(), Eq(" b"));
}

TEST(BoolAsSelect, QuotedSpaces) {
constexpr char Format[] = "{0:' a | b '}";
EXPECT_THAT(llvm::formatv(Format, BoolAsSelect(true)).str(), Eq(" a "));
EXPECT_THAT(llvm::formatv(Format, BoolAsSelect(false)).str(), Eq(" b "));
}
Expand Down Expand Up @@ -65,13 +59,6 @@ TEST(IntAsSelect, Spaces) {
constexpr char Format[] = "{0:=0: zero |=1: one |: default }";
EXPECT_THAT(llvm::formatv(Format, IntAsSelect(0)).str(), Eq(" zero "));
EXPECT_THAT(llvm::formatv(Format, IntAsSelect(1)).str(), Eq(" one "));
EXPECT_THAT(llvm::formatv(Format, IntAsSelect(2)).str(), Eq(" default"));
}

TEST(IntAsSelect, QuotedSpaces) {
constexpr char Format[] = "{0:'=0: zero |=1: one |: default '}";
EXPECT_THAT(llvm::formatv(Format, IntAsSelect(0)).str(), Eq(" zero "));
EXPECT_THAT(llvm::formatv(Format, IntAsSelect(1)).str(), Eq(" one "));
EXPECT_THAT(llvm::formatv(Format, IntAsSelect(2)).str(), Eq(" default "));
}

Expand Down
Loading