[PATCH] D75561: Remove const qualifier from Modules returned by ExternalASTSource. (NFC)
Adrian Prantl via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 17 12:57:21 PDT 2020
aprantl updated this revision to Diff 250873.
aprantl added a comment.
Rebase.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75561/new/
https://reviews.llvm.org/D75561
Files:
clang/include/clang/Basic/Module.h
clang/lib/Basic/Module.cpp
clang/lib/Serialization/ASTReader.cpp
Index: clang/lib/Serialization/ASTReader.cpp
===================================================================
--- clang/lib/Serialization/ASTReader.cpp
+++ clang/lib/Serialization/ASTReader.cpp
@@ -8493,7 +8493,7 @@
llvm::Optional<ASTSourceDescriptor>
ASTReader::getSourceDescriptor(unsigned ID) {
- if (const Module *M = getSubmodule(ID))
+ if (Module *M = getSubmodule(ID))
return ASTSourceDescriptor(*M);
// If there is only a single PCH, return it instead.
Index: clang/lib/Basic/Module.cpp
===================================================================
--- clang/lib/Basic/Module.cpp
+++ clang/lib/Basic/Module.cpp
@@ -659,7 +659,7 @@
VisitModule({M, nullptr});
}
-ASTSourceDescriptor::ASTSourceDescriptor(const Module &M)
+ASTSourceDescriptor::ASTSourceDescriptor(Module &M)
: Signature(M.Signature), ClangModule(&M) {
if (M.Directory)
Path = M.Directory->getName();
Index: clang/include/clang/Basic/Module.h
===================================================================
--- clang/include/clang/Basic/Module.h
+++ clang/include/clang/Basic/Module.h
@@ -662,7 +662,7 @@
StringRef Path;
StringRef ASTFile;
ASTFileSignature Signature;
- const Module *ClangModule = nullptr;
+ Module *ClangModule = nullptr;
public:
ASTSourceDescriptor() = default;
@@ -670,13 +670,13 @@
ASTFileSignature Signature)
: PCHModuleName(std::move(Name)), Path(std::move(Path)),
ASTFile(std::move(ASTFile)), Signature(Signature) {}
- ASTSourceDescriptor(const Module &M);
+ ASTSourceDescriptor(Module &M);
std::string getModuleName() const;
StringRef getPath() const { return Path; }
StringRef getASTFile() const { return ASTFile; }
ASTFileSignature getSignature() const { return Signature; }
- const Module *getModuleOrNull() const { return ClangModule; }
+ Module *getModuleOrNull() const { return ClangModule; }
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75561.250873.patch
Type: text/x-patch
Size: 1925 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200317/1d1b21ae/attachment.bin>
More information about the cfe-commits
mailing list