Skip to content

Commit

Permalink
Avoid conversion to std::function of cc1_main.
Browse files Browse the repository at this point in the history
  • Loading branch information
bricknerb committed Jan 3, 2025
1 parent 4a0b358 commit f1c5c22
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions toolchain/driver/clang_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ auto ClangRunner::Run(llvm::ArrayRef<llvm::StringRef> args) -> bool {
// Note the subprocessing will effectively call `clang -cc1`, which turns into
// `carbon-busybox clang -cc1`, which results in an equivalent `clang_main`
// call.
std::function<int(llvm::SmallVectorImpl<const char*> & cc1_args)> cc1_main =
[](llvm::SmallVectorImpl<const char*>& cc1_args) -> int {
auto cc1_main = [](llvm::SmallVectorImpl<const char*>& cc1_args) -> int {
// cc1_args[0] will be the `clang_path` so we don't need the prepend arg.
llvm::ToolContext tool_context = {
.Path = cc1_args[0], .PrependArg = "clang", .NeedsPrependArg = false};
Expand Down

0 comments on commit f1c5c22

Please sign in to comment.