]> granicus.if.org Git - clang/commitdiff
Add more constness to module-related APIs
authorDmitri Gribenko <gribozavr@gmail.com>
Fri, 18 Apr 2014 14:36:51 +0000 (14:36 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Fri, 18 Apr 2014 14:36:51 +0000 (14:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206595 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Module.h
include/clang/Lex/ModuleMap.h
lib/Basic/Module.cpp
lib/Lex/ModuleMap.cpp

index ab58131f5c106815fc6bc0c56732497307e76ff1..49be4ecb4d484caf29d2bd1dca0cec1d5f18d955 100644 (file)
@@ -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
index fde33ecadb49ce03a720b4d9379a1085eb192b0c..dbd9fd1c0ca97a8d7b05770b8e53259902e4f870 100644 (file)
@@ -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.
   ///
index 2612ee0dde4bc43afd6aa777c797a8478089422f..d5c02d84058f546ee17e4691923b349e5c44e2da 100644 (file)
@@ -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)
index 3381144192c5fe6624329fa1758aedc613056bb4..27ba7620ff51c18a6427de2b61b5f9f1710e14b7 100644 (file)
@@ -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