================ @@ -1342,19 +1343,47 @@ class ASTReader bool Complain = true); /// Buffer we use as temporary storage backing resolved paths. - SmallString<256> PathBuf; + std::optional<SmallString<256>> PathBuf{{}}; + + /// A RAII wrapper around \c StringRef that temporarily takes ownership of the + /// underlying buffer and gives it back on destruction. + class TemporarilyOwnedStringRef { + StringRef String; + llvm::SaveAndRestore<std::optional<SmallString<256>>> TemporaryLoan; ---------------- jansvoboda11 wrote:
Did you mean 250 specifically, or is that a typo? https://github.com/llvm/llvm-project/pull/113984 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits