[PATCH] D24439: [Clang] Fix some Clang-tidy modernize-use-bool-literals and Include What You Use warnings; other minor fixes

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 10 13:10:52 PDT 2016


compnerd added inline comments.

================
Comment at: lib/Basic/SourceManager.cpp:395
@@ -383,2 +394,3 @@
+  for (llvm::DenseMap<const FileEntry*, ContentCache*>::iterator
        I = FileInfos.begin(), E = FileInfos.end(); I != E; ++I) {
     if (I->second) {
----------------
Cant this be rewritten as:

    for (const auto &I : FileInfos)

================
Comment at: lib/Basic/SourceManager.cpp:1039
@@ -1029,3 +1038,3 @@
   bool Invalid = false;
-  const SrcMgr::ExpansionInfo &ExpInfo =
+  const ExpansionInfo &ExpInfo =
       getSLocEntry(DecompLoc.first, &Invalid).getExpansion();
----------------
Hmm, might be nice to change this to `Expansion` as the other ones are named that.

================
Comment at: lib/Basic/SourceManager.cpp:1075
@@ -1065,4 +1074,3 @@
   bool Invalid = false;
-  const SrcMgr::ExpansionInfo &ExpInfo =
-      getSLocEntry(FID, &Invalid).getExpansion();
+  const ExpansionInfo &ExpInfo = getSLocEntry(FID, &Invalid).getExpansion();
   if (Invalid)
----------------
Similar.


Repository:
  rL LLVM

https://reviews.llvm.org/D24439





More information about the cfe-commits mailing list