@@ -370,7 +370,7 @@ static Expected<llvm::cas::CASID> scanAndUpdateCC1InlineWithTool(
370
370
static llvm::Expected<llvm::cas::CASID> scanAndUpdateCC1UsingDaemon (
371
371
const char *Exec, ArrayRef<const char *> OldArgs,
372
372
StringRef WorkingDirectory, SmallVectorImpl<const char *> &NewArgs,
373
- StringRef &DiagnosticOutput, StringRef Path,
373
+ std::string &DiagnosticOutput, StringRef Path,
374
374
const DepscanSharing &Sharing,
375
375
llvm::function_ref<const char *(const Twine &)> SaveArg,
376
376
llvm::cas::ObjectStore &CAS) {
@@ -397,9 +397,13 @@ static llvm::Expected<llvm::cas::CASID> scanAndUpdateCC1UsingDaemon(
397
397
CC1DepScanDProtocol::ResultKind Result;
398
398
StringRef FailedReason;
399
399
StringRef RootID;
400
+ StringRef DiagOut;
400
401
if (auto E = Comms.getScanResult (Saver, Result, FailedReason, RootID,
401
- RawNewArgs, DiagnosticOutput))
402
+ RawNewArgs, DiagOut)) {
403
+ DiagnosticOutput = DiagOut;
402
404
return std::move (E);
405
+ }
406
+ DiagnosticOutput = DiagOut;
403
407
404
408
if (Result != CC1DepScanDProtocol::SuccessResult)
405
409
return llvm::createStringError (llvm::inconvertibleErrorCode (),
@@ -504,7 +508,7 @@ static int scanAndUpdateCC1(const char *Exec, ArrayRef<const char *> OldArgs,
504
508
if (ProduceIncludeTree)
505
509
Sharing.CASArgs .push_back (" -fdepscan-include-tree" );
506
510
507
- StringRef DiagnosticOutput;
511
+ std::string DiagnosticOutput;
508
512
bool DiagnosticErrorOccurred = false ;
509
513
auto ScanAndUpdate = [&]() {
510
514
if (std::optional<std::string> DaemonPath =
0 commit comments