================ @@ -281,5 +282,26 @@ const QueryKind SetQueryKind<bool>::value; const QueryKind SetQueryKind<OutputKind>::value; #endif +bool FileQuery::run(llvm::raw_ostream &OS, QuerySession &QS) const { + auto Buffer = llvm::MemoryBuffer::getFile(StringRef{File}.trim()); + if (!Buffer) { + if (Prefix.has_value()) + llvm::errs() << *Prefix << ": "; + llvm::errs() << "cannot open " << File << ": " + << Buffer.getError().message() << "\n"; ---------------- AaronBallman wrote:
Rather than printing directly to `errs()`, I think you should construct a `TextDiagnostic` object and use that to emit the diagnostic. https://github.com/llvm/llvm-project/pull/90603 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits