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:
Chandler Carruth
2026-01-07 02:53:31 +00:00
committed by GitHub
parent 505b1c86b9
commit eecbb7e508
7 changed files with 34 additions and 44 deletions
+2 -2
View File
@@ -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.