cpp11-migrate: const-correcting IncludeExcludeInfo

isFileIncluded() needed to be marked const.

llvm-svn: 183918
This commit is contained in:
Edwin Vane 2013-06-13 17:19:37 +00:00
parent 90706dd424
commit 230ecb2422
2 changed files with 6 additions and 6 deletions

View File

@ -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<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(StringRef FilePath) {
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;

View File

@ -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;