================
@@ -2032,6 +2032,7 @@ class SourceManagerForFile {
   // as they are created in `createSourceManagerForFile` so that they can be
   // deleted in the reverse order as they are created.
   std::unique_ptr<FileManager> FileMgr;
+  std::unique_ptr<DiagnosticOptions> DiagOpts;
----------------
jansvoboda11 wrote:

I don't think I understand. Now that `DiagnosticOptions` are not intrusively 
reference-counted, raw pointers have clearer semantics than before (typically 
nullable non-owning borrow), no? I'd also argue that using values, references, 
raw pointers, `unique_ptr` and `shared_ptr` depending on the context is the 
clearest way to communicate lifetimes and ownership. Regardless, there's only 
one raw pointer to `DiagnosticOptions` remaining after my patch in 
`clang::tooling::ToolInvocation`, and that has exactly the semantics you'd 
expect: optional borrow where the owner is someone else and you expect them to 
keep the object alive long enough.

https://github.com/llvm/llvm-project/pull/139584
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to