mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Switch to BumpPtrAllocator for C-string storage (#6550)
This keeps the allocations cheap and simplifies the code. It was inspired by the need to expand param files, but no functionality changed yet.
This commit is contained in:
@@ -95,9 +95,9 @@ auto BuildClangInvocation(Diagnostics::Consumer& consumer,
|
||||
|
||||
// The clang driver inconveniently wants an array of `const char*`, so convert
|
||||
// the arguments.
|
||||
llvm::OwningArrayRef<char> cstr_arg_storage;
|
||||
llvm::BumpPtrAllocator alloc;
|
||||
llvm::SmallVector<const char*> cstr_args = BuildCStrArgs(
|
||||
install_paths.clang_path().native(), args, extra_args, cstr_arg_storage);
|
||||
install_paths.clang_path().native(), args, extra_args, alloc);
|
||||
|
||||
// Build a diagnostics engine. Note that we don't have any diagnostic options
|
||||
// yet; they're produced by running the driver.
|
||||
|
||||
Reference in New Issue
Block a user