Skip to content

Commit 9195b30

Browse files
authored
Merge pull request #1060 from adrian-prantl/deconstify-master
Remove const qualifier from Modules returned by ExternalASTSource. (NFC)
2 parents 79045fb + b74718a commit 9195b30

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

clang/include/clang/AST/ExternalASTSource.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,21 +173,21 @@ class ExternalASTSource : public RefCountedBase<ExternalASTSource> {
173173
StringRef Path;
174174
StringRef ASTFile;
175175
ASTFileSignature Signature;
176-
const Module *ClangModule = nullptr;
176+
Module *ClangModule = nullptr;
177177

178178
public:
179179
ASTSourceDescriptor() = default;
180180
ASTSourceDescriptor(StringRef Name, StringRef Path, StringRef ASTFile,
181181
ASTFileSignature Signature)
182182
: PCHModuleName(std::move(Name)), Path(std::move(Path)),
183183
ASTFile(std::move(ASTFile)), Signature(Signature) {}
184-
ASTSourceDescriptor(const Module &M);
184+
ASTSourceDescriptor(Module &M);
185185

186186
std::string getModuleName() const;
187187
StringRef getPath() const { return Path; }
188188
StringRef getASTFile() const { return ASTFile; }
189189
ASTFileSignature getSignature() const { return Signature; }
190-
const Module *getModuleOrNull() const { return ClangModule; }
190+
Module *getModuleOrNull() const { return ClangModule; }
191191
};
192192

193193
/// Return a descriptor for the corresponding module, if one exists.

clang/lib/AST/ExternalASTSource.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ExternalASTSource::hasExternalDefinitions(const Decl *D) {
3838
return EK_ReplyHazy;
3939
}
4040

41-
ExternalASTSource::ASTSourceDescriptor::ASTSourceDescriptor(const Module &M)
41+
ExternalASTSource::ASTSourceDescriptor::ASTSourceDescriptor(Module &M)
4242
: Signature(M.Signature), ClangModule(&M) {
4343
if (M.Directory)
4444
Path = M.Directory->getName();

clang/lib/Serialization/ASTReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8488,7 +8488,7 @@ unsigned ASTReader::getModuleFileID(ModuleFile *F) {
84888488

84898489
llvm::Optional<ExternalASTSource::ASTSourceDescriptor>
84908490
ASTReader::getSourceDescriptor(unsigned ID) {
8491-
if (const Module *M = getSubmodule(ID))
8491+
if (Module *M = getSubmodule(ID))
84928492
return ExternalASTSource::ASTSourceDescriptor(*M);
84938493

84948494
// If there is only a single PCH, return it instead.

0 commit comments

Comments
 (0)