mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 00:20:31 +00: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:
1 parent
505b1c86b9
commit
eecbb7e508
7 files changed
+34
-44
No files matched your search
@@ -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