benlangmuir accepted this revision.
benlangmuir added a comment.

Gotta love `return AST.release()` being passed directly back into 
`std::unique_ptr<ASTUnit>(...)`.  Thanks for fixing!



================
Comment at: clang/tools/libclang/CIndex.cpp:3965
       unsaved_files);
-  std::unique_ptr<ASTUnit> Unit(ASTUnit::LoadFromCommandLine(
+  auto Unit = ASTUnit::LoadFromCommandLine(
       Args->data(), Args->data() + Args->size(),
----------------
Nit: the style guidance for `auto` in llvm is "type is already obvious from the 
context".  Since I don't think that's obvious here (in particular, this code 
would have compiled with the raw pointer return type), and the type name will 
not be verbose, I think we should keep `std::unique_ptr<ASTUnit>`.  Same for 
the other calls below.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154257

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

Reply via email to