Skip to content

Commit

Permalink
v0.0.0-0.nightly.2024.09.10
Browse files Browse the repository at this point in the history
  • Loading branch information
ogra committed Sep 10, 2024
2 parents 7f99f61 + 43c6259 commit df01c78
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
9 changes: 9 additions & 0 deletions .github/actions/build-setup-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ inputs:
runs:
using: composite
steps:
# Free up disk space as the macOS runners end up using most for Xcode
# versions we don't need and iOS simulators.
- name: Free up disk space
shell: bash
run: |
echo '*** Delete iOS simulators'
xcrun simctl delete all
sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
# Install and cache LLVM 16 from Homebrew.
# TODO: We can potentially remove this and simplify things when the
# Homebrew version of LLVM updates to 16 here:
Expand Down
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,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-08-09.
llvm_project_version = "4c5ef6690040383956461828457ac27f7f912edb"
# HEAD as of 2024-09-06.
llvm_project_version = "876b0e60feb6ee4eabb1c8b52881117ce93b3c4c"

# Load a repository for the raw llvm-project, pre-overlay.
http_archive(
Expand All @@ -147,7 +147,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 = "a30da7822f5307bc0aca8c497ffdd6369e3877186e87501e2ac1f3ec5ed1c0b7",
sha256 = "7d9e6a4d1e419657b84a4bdf71d07bbb44d7c290847f7d15a841040af0d58a7b",
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
10 changes: 7 additions & 3 deletions common/command_line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,9 +927,13 @@ auto Parser::ParseArg(const Arg& arg, bool short_spelling,
return ParseFlag(arg, value);
}

auto name =
llvm::formatv(short_spelling ? "'-{0}' (short for '--{1}')" : "'--{1}'",
arg.info.short_name, arg.info.name);
std::string name;
if (short_spelling) {
name = llvm::formatv("'-{0}' (short for '--{1}')", arg.info.short_name,
arg.info.name);
} else {
name = llvm::formatv("'--{0}'", arg.info.name);
}

if (!value) {
// We can't have a positional argument without a value, so we know this is
Expand Down
11 changes: 10 additions & 1 deletion common/command_line_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ TEST(ArgParserTest, ShortArgs) {
StrEq("ERROR: Option '-z' (short for '--option2') requires a "
"value to be provided and none was.\n"));

EXPECT_THAT(parse({"--option2"}, os), Eq(ParseResult::Error));
EXPECT_THAT(os.TakeStr(), StrEq("ERROR: Option '--option2' requires a value "
"to be provided and none was.\n"));

EXPECT_THAT(parse({"-xz=123"}, os), Eq(ParseResult::Error));
EXPECT_THAT(
os.TakeStr(),
Expand Down Expand Up @@ -461,10 +465,15 @@ TEST(ArgParserTest, OneOfOption) {
EXPECT_THAT(parse({"--option=z"}, llvm::errs()), Eq(ParseResult::Success));
EXPECT_THAT(value, Eq(3));

TestRawOstream os;

EXPECT_THAT(parse({"--option"}, os), Eq(ParseResult::Error));
EXPECT_THAT(os.TakeStr(), StrEq("ERROR: Option '--option' requires a value "
"to be provided and none was.\n"));

constexpr const char* ErrorStr =
"ERROR: Option '--option={0}' has an invalid value '{0}'; valid values "
"are: 'x', 'y', or 'z'\n";
TestRawOstream os;
EXPECT_THAT(parse({"--option=a"}, os), Eq(ParseResult::Error));
EXPECT_THAT(os.TakeStr(), StrEq(llvm::formatv(ErrorStr, "a")));

Expand Down
8 changes: 4 additions & 4 deletions toolchain/check/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,10 @@ static auto GetCorePackage(Context& context, SemIRLoc loc)
}
}

CARBON_DIAGNOSTIC(CoreNotFound, Error,
"Package `Core` implicitly referenced here, but not found.",
SemIR::NameId);
context.emitter().Emit(loc, CoreNotFound, core_name_id);
CARBON_DIAGNOSTIC(
CoreNotFound, Error,
"Package `Core` implicitly referenced here, but not found.");
context.emitter().Emit(loc, CoreNotFound);
return SemIR::NameScopeId::Invalid;
}

Expand Down

0 comments on commit df01c78

Please sign in to comment.