Add more constness to module-related APIs

llvm-svn: 206595
This commit is contained in:
Dmitri Gribenko 2014-04-18 14:36:51 +00:00
parent 4dab69815c
commit 62bcd925c0
4 changed files with 6 additions and 5 deletions

View File

@ -307,7 +307,7 @@ public:
/// \brief Determine whether this module is a submodule of the given other /// \brief Determine whether this module is a submodule of the given other
/// module. /// module.
bool isSubModuleOf(Module *Other) const; bool isSubModuleOf(const Module *Other) const;
/// \brief Determine whether this module is a part of a framework, /// \brief Determine whether this module is a part of a framework,
/// either because it is a framework module or because it is a submodule /// either because it is a framework module or because it is a submodule

View File

@ -258,7 +258,7 @@ public:
/// \brief Determine whether the given header is unavailable as part /// \brief Determine whether the given header is unavailable as part
/// of the specified module. /// of the specified module.
bool isHeaderUnavailableInModule(const FileEntry *Header, bool isHeaderUnavailableInModule(const FileEntry *Header,
Module *RequestingModule) const; const Module *RequestingModule) const;
/// \brief Retrieve a module with the given name. /// \brief Retrieve a module with the given name.
/// ///

View File

@ -91,7 +91,7 @@ Module::isAvailable(const LangOptions &LangOpts, const TargetInfo &Target,
llvm_unreachable("could not find a reason why module is unavailable"); 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; const Module *This = this;
do { do {
if (This == Other) if (This == Other)

View File

@ -411,8 +411,9 @@ bool ModuleMap::isHeaderInUnavailableModule(const FileEntry *Header) const {
return isHeaderUnavailableInModule(Header, 0); return isHeaderUnavailableInModule(Header, 0);
} }
bool ModuleMap::isHeaderUnavailableInModule(const FileEntry *Header, bool
Module *RequestingModule) const { ModuleMap::isHeaderUnavailableInModule(const FileEntry *Header,
const Module *RequestingModule) const {
HeadersMap::const_iterator Known = Headers.find(Header); HeadersMap::const_iterator Known = Headers.find(Header);
if (Known != Headers.end()) { if (Known != Headers.end()) {
for (SmallVectorImpl<KnownHeader>::const_iterator for (SmallVectorImpl<KnownHeader>::const_iterator