summaryrefslogtreecommitdiffstats
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
commit62bcd925c02dd743fc351f6f0e602c5c5431bd48 (patch)
tree540ff357a51fabb71008b6fa632b6ca87ff42b2c
parent4dab69815c9357b7c2b3fe91718e569cc5c0ac6a (diff)
downloadbcm5719-llvm-62bcd925c02dd743fc351f6f0e602c5c5431bd48.tar.gz
bcm5719-llvm-62bcd925c02dd743fc351f6f0e602c5c5431bd48.zip
Add more constness to module-related APIs
llvm-svn: 206595
-rw-r--r--clang/include/clang/Basic/Module.h2
-rw-r--r--clang/include/clang/Lex/ModuleMap.h2
-rw-r--r--clang/lib/Basic/Module.cpp2
-rw-r--r--clang/lib/Lex/ModuleMap.cpp5
4 files changed, 6 insertions, 5 deletions
diff --git a/clang/include/clang/Basic/Module.h b/clang/include/clang/Basic/Module.h
index ab58131f5c1..49be4ecb4d4 100644
--- a/clang/include/clang/Basic/Module.h
+++ b/clang/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/clang/include/clang/Lex/ModuleMap.h b/clang/include/clang/Lex/ModuleMap.h
index fde33ecadb4..dbd9fd1c0ca 100644
--- a/clang/include/clang/Lex/ModuleMap.h
+++ b/clang/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/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp
index 2612ee0dde4..d5c02d84058 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/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/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index 3381144192c..27ba7620ff5 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud