summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2014-04-18 14:36:51 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2014-04-18 14:36:51 +0000
commit9fbf62e195c38296a7703d6c4d9189cb23166ac7 (patch)
treeca27c29f4356ad2b38f1791516e83c6b96ff7fa7
parentaf2bcba81b87ffacfefada5be0afde2d20c365b1 (diff)
downloadclang-9fbf62e195c38296a7703d6c4d9189cb23166ac7.tar.gz
clang-9fbf62e195c38296a7703d6c4d9189cb23166ac7.tar.bz2
clang-9fbf62e195c38296a7703d6c4d9189cb23166ac7.tar.xz
Add more constness to module-related APIs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206595 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/Module.h2
-rw-r--r--include/clang/Lex/ModuleMap.h2
-rw-r--r--lib/Basic/Module.cpp2
-rw-r--r--lib/Lex/ModuleMap.cpp5
4 files changed, 6 insertions, 5 deletions
diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h
index ab58131f5c..49be4ecb4d 100644
--- a/include/clang/Basic/Module.h
+++ b/include/clang/Basic/Module.h
@@ -307,7 +307,7 @@ public:
/// \brief Determine whether this module is a submodule of the given other
/// module.
- bool isSubModuleOf(Module *Other) const;
+ bool isSubModuleOf(const Module *Other) const;
/// \brief Determine whether this module is a part of a framework,
/// either because it is a framework module or because it is a submodule
diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h
index fde33ecadb..dbd9fd1c0c 100644
--- a/include/clang/Lex/ModuleMap.h
+++ b/include/clang/Lex/ModuleMap.h
@@ -258,7 +258,7 @@ public:
/// \brief Determine whether the given header is unavailable as part
/// of the specified module.
bool isHeaderUnavailableInModule(const FileEntry *Header,
- Module *RequestingModule) const;
+ const Module *RequestingModule) const;
/// \brief Retrieve a module with the given name.
///
diff --git a/lib/Basic/Module.cpp b/lib/Basic/Module.cpp
index 2612ee0dde..d5c02d8405 100644
--- a/lib/Basic/Module.cpp
+++ b/lib/Basic/Module.cpp
@@ -91,7 +91,7 @@ Module::isAvailable(const LangOptions &LangOpts, const TargetInfo &Target,
llvm_unreachable("could not find a reason why module is unavailable");
}
-bool Module::isSubModuleOf(Module *Other) const {
+bool Module::isSubModuleOf(const Module *Other) const {
const Module *This = this;
do {
if (This == Other)
diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp
index 3381144192..27ba7620ff 100644
--- a/lib/Lex/ModuleMap.cpp
+++ b/lib/Lex/ModuleMap.cpp
@@ -411,8 +411,9 @@ bool ModuleMap::isHeaderInUnavailableModule(const FileEntry *Header) const {
return isHeaderUnavailableInModule(Header, 0);
}
-bool ModuleMap::isHeaderUnavailableInModule(const FileEntry *Header,
- Module *RequestingModule) const {
+bool
+ModuleMap::isHeaderUnavailableInModule(const FileEntry *Header,
+ const Module *RequestingModule) const {
HeadersMap::const_iterator Known = Headers.find(Header);
if (Known != Headers.end()) {
for (SmallVectorImpl<KnownHeader>::const_iterator