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