cjdb added inline comments.

================
Comment at: clang/include/clang/Frontend/SARIFDiagnosticPrinter.h:41
+  void setPrefix(llvm::StringRef Value) {
+    Prefix = std::move(Value);
+  }
----------------
We don't need to move a StringRef.


================
Comment at: clang/lib/Frontend/SARIFDiagnosticPrinter.cpp:43
+  assert(hasSarifWriter() && "Writer not set!");
+  SARIFDiag.reset(new SARIFDiagnostic(*OS, LO, &*DiagOpts, &*Writer));
+  // Initialize the SARIF object.
----------------
cjdb wrote:
> Please replace with `make_unique`.
This won't work because `.get()` only returns an observer, so the object will 
be deleted when this statement completes. We'll need to do
```
SARIFDiag = std::make_unique<SARIFDiagnostic>(*OS, LO, &*DiagOpts, &*Writer);
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131632/new/

https://reviews.llvm.org/D131632

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to