[clang-tools-extra] r183918 - cpp11-migrate: const-correcting IncludeExcludeInfo

Edwin Vane edwin.vane at intel.com
Thu Jun 13 10:19:38 PDT 2013


Author: revane
Date: Thu Jun 13 12:19:37 2013
New Revision: 183918

URL: http://llvm.org/viewvc/llvm-project?rev=183918&view=rev
Log:
cpp11-migrate: const-correcting IncludeExcludeInfo

isFileIncluded() needed to be marked const.


Modified:
    clang-tools-extra/trunk/cpp11-migrate/Core/IncludeExcludeInfo.cpp
    clang-tools-extra/trunk/cpp11-migrate/Core/IncludeExcludeInfo.h

Modified: clang-tools-extra/trunk/cpp11-migrate/Core/IncludeExcludeInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/cpp11-migrate/Core/IncludeExcludeInfo.cpp?rev=183918&r1=183917&r2=183918&view=diff
==============================================================================
--- clang-tools-extra/trunk/cpp11-migrate/Core/IncludeExcludeInfo.cpp (original)
+++ clang-tools-extra/trunk/cpp11-migrate/Core/IncludeExcludeInfo.cpp Thu Jun 13 12:19:37 2013
@@ -103,11 +103,11 @@ error_code IncludeExcludeInfo::readListF
   return error_code::success();
 }
 
-bool IncludeExcludeInfo::isFileIncluded(StringRef FilePath) {
+bool IncludeExcludeInfo::isFileIncluded(StringRef FilePath) const {
   bool InIncludeList = false;
 
-  for (std::vector<std::string>::iterator I = IncludeList.begin(),
-                                          E = IncludeList.end();
+  for (std::vector<std::string>::const_iterator I = IncludeList.begin(),
+                                                E = IncludeList.end();
        I != E; ++I)
     if ((InIncludeList = fileHasPathPrefix(FilePath, *I)))
       break;
@@ -116,8 +116,8 @@ bool IncludeExcludeInfo::isFileIncluded(
   if (!InIncludeList)
     return false;
 
-  for (std::vector<std::string>::iterator I = ExcludeList.begin(),
-                                          E = ExcludeList.end();
+  for (std::vector<std::string>::const_iterator I = ExcludeList.begin(),
+                                                E = ExcludeList.end();
        I != E; ++I)
     if (fileHasPathPrefix(FilePath, *I))
       return false;

Modified: clang-tools-extra/trunk/cpp11-migrate/Core/IncludeExcludeInfo.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/cpp11-migrate/Core/IncludeExcludeInfo.h?rev=183918&r1=183917&r2=183918&view=diff
==============================================================================
--- clang-tools-extra/trunk/cpp11-migrate/Core/IncludeExcludeInfo.h (original)
+++ clang-tools-extra/trunk/cpp11-migrate/Core/IncludeExcludeInfo.h Thu Jun 13 12:19:37 2013
@@ -41,7 +41,7 @@ public:
 
   /// \brief Determine if the given path is in the list of include paths but
   /// not in the list of exclude paths.
-  bool isFileIncluded(llvm::StringRef FilePath);
+  bool isFileIncluded(llvm::StringRef FilePath) const;
 
 private:
   std::vector<std::string> IncludeList;





More information about the cfe-commits mailing list