[PATCH] D23397: [clang-rename] cleanup `auto` usages

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 15 16:17:58 PDT 2016


alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

LG with a couple of nits.


================
Comment at: clang-rename/USRFinder.cpp:182
@@ -179,5 +181,3 @@
   // We only want to search the decls that exist in the same file as the point.
-  auto Decls = Context.getTranslationUnitDecl()->decls();
-  for (auto &CurrDecl : Decls) {
-    const auto FileLoc = CurrDecl->getLocStart();
-    const auto FileName = Context.getSourceManager().getFilename(FileLoc);
+  for (const auto &CurrDecl : Context.getTranslationUnitDecl()->decls()) {
+    const SourceLocation FileLoc = CurrDecl->getLocStart();
----------------
Should this be `const auto *` instead?

================
Comment at: clang-rename/USRLocFinder.cpp:132
@@ +131,3 @@
+    const SourceLocation EndLoc = Lexer::getLocForEndOfToken(
+                             BeginLoc, 0, Context.getSourceManager(),
+                             Context.getLangOpts());
----------------
I suspect, clang-format will join the arguments to one line. Can you try? (maybe just `git clang-format`)


https://reviews.llvm.org/D23397





More information about the cfe-commits mailing list