From: Dmitri Gribenko Date: Fri, 18 Apr 2014 14:36:51 +0000 (+0000) Subject: Add more constness to module-related APIs X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9fbf62e195c38296a7703d6c4d9189cb23166ac7;p=clang Add more constness to module-related APIs git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206595 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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::const_iterator