From 230ecb24222a13f8801867da857c8e925cbb3d31 Mon Sep 17 00:00:00 2001 From: Edwin Vane Date: Thu, 13 Jun 2013 17:19:37 +0000 Subject: [PATCH] cpp11-migrate: const-correcting IncludeExcludeInfo isFileIncluded() needed to be marked const. llvm-svn: 183918 --- .../cpp11-migrate/Core/IncludeExcludeInfo.cpp | 10 +++++----- .../cpp11-migrate/Core/IncludeExcludeInfo.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/clang-tools-extra/cpp11-migrate/Core/IncludeExcludeInfo.cpp b/clang-tools-extra/cpp11-migrate/Core/IncludeExcludeInfo.cpp index b6c7259f13f8..65cd8eb89d02 100644 --- a/clang-tools-extra/cpp11-migrate/Core/IncludeExcludeInfo.cpp +++ b/clang-tools-extra/cpp11-migrate/Core/IncludeExcludeInfo.cpp @@ -103,11 +103,11 @@ error_code IncludeExcludeInfo::readListFromFile(StringRef IncludeListFile, return error_code::success(); } -bool IncludeExcludeInfo::isFileIncluded(StringRef FilePath) { +bool IncludeExcludeInfo::isFileIncluded(StringRef FilePath) const { bool InIncludeList = false; - for (std::vector::iterator I = IncludeList.begin(), - E = IncludeList.end(); + for (std::vector::const_iterator I = IncludeList.begin(), + E = IncludeList.end(); I != E; ++I) if ((InIncludeList = fileHasPathPrefix(FilePath, *I))) break; @@ -116,8 +116,8 @@ bool IncludeExcludeInfo::isFileIncluded(StringRef FilePath) { if (!InIncludeList) return false; - for (std::vector::iterator I = ExcludeList.begin(), - E = ExcludeList.end(); + for (std::vector::const_iterator I = ExcludeList.begin(), + E = ExcludeList.end(); I != E; ++I) if (fileHasPathPrefix(FilePath, *I)) return false; diff --git a/clang-tools-extra/cpp11-migrate/Core/IncludeExcludeInfo.h b/clang-tools-extra/cpp11-migrate/Core/IncludeExcludeInfo.h index 9d364e417a2a..0d902623fb00 100644 --- a/clang-tools-extra/cpp11-migrate/Core/IncludeExcludeInfo.h +++ b/clang-tools-extra/cpp11-migrate/Core/IncludeExcludeInfo.h @@ -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 IncludeList;