================ @@ -4753,15 +4755,12 @@ void ASTWriter::AddString(StringRef Str, RecordDataImpl &Record) { } bool ASTWriter::PreparePathForOutput(SmallVectorImpl<char> &Path) { - assert(Context && "should have context when outputting path"); - // Leave special file names as they are. StringRef PathStr(Path.data(), Path.size()); if (PathStr == "<built-in>" || PathStr == "<command line>") return false; - bool Changed = - cleanPathForOutput(Context->getSourceManager().getFileManager(), Path); + bool Changed = cleanPathForOutput(PP->getFileManager(), Path); ---------------- benlangmuir wrote:
Okay, makes sense. I suggest we add an `assert` here just to help catch this; either assert on PP not being null, or maybe follow the example in `getLangOpts` and assert on `WritingAST`. https://github.com/llvm/llvm-project/pull/115235 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits