Skip to content

Commit a5e8e16

Browse files
committed
Fix build break.
1 parent f2d3d6a commit a5e8e16

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

clang/lib/Tooling/DependencyScanning/DependencyScannerImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ llvm::Error CompilerInstanceWithContext::initialize() {
717717
CommandLine, OverlayFS, DiagPrinterWithOS->DiagPrinter);
718718

719719
std::tie(Driver, Compilation) = buildCompilation(
720-
CommandLine, *DiagEngineWithCmdAndOpts->DiagEngine, OverlayFS);
720+
CommandLine, *DiagEngineWithCmdAndOpts->DiagEngine, OverlayFS, Alloc);
721721

722722
if (!Compilation) {
723723
return llvm::make_error<llvm::StringError>("Failed to build compilation",

clang/lib/Tooling/DependencyScanning/DependencyScannerImpl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ class CompilerInstanceWithContext {
168168
std::unique_ptr<DignosticsEngineWithDiagOpts> DiagEngineWithCmdAndOpts;
169169

170170
// Context - compiler invocation
171+
// Compilation's command's arguments may be owned by Alloc when expanded from
172+
// response files, so we need to keep Alloc alive in the context.
173+
llvm::BumpPtrAllocator Alloc;
171174
std::unique_ptr<clang::driver::Driver> Driver;
172175
std::unique_ptr<clang::driver::Compilation> Compilation;
173176
std::unique_ptr<CompilerInvocation> OriginalInvocation;

0 commit comments

Comments
 (0)