[clang] f4754ea - Remove const qualifier from Modules returned by ExternalASTSource. (NFC)
Adrian Prantl via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 1 17:46:31 PDT 2020
Author: Adrian Prantl
Date: 2020-04-01T17:46:02-07:00
New Revision: f4754ea0ed7ddc35042bacbc47d661bfe660f132
URL: https://github.com/llvm/llvm-project/commit/f4754ea0ed7ddc35042bacbc47d661bfe660f132
DIFF: https://github.com/llvm/llvm-project/commit/f4754ea0ed7ddc35042bacbc47d661bfe660f132.diff
LOG: Remove const qualifier from Modules returned by ExternalASTSource. (NFC)
This API is used by LLDB to attach owning module information to
Declarations deserialized from DWARF.
Differential Revision: https://reviews.llvm.org/D75561
Added:
Modified:
clang/include/clang/Basic/Module.h
clang/lib/Basic/Module.cpp
clang/lib/Serialization/ASTReader.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/Module.h b/clang/include/clang/Basic/Module.h
index 9c2bc155cd4f..c47eb4587a57 100644
--- a/clang/include/clang/Basic/Module.h
+++ b/clang/include/clang/Basic/Module.h
@@ -662,7 +662,7 @@ class ASTSourceDescriptor {
StringRef Path;
StringRef ASTFile;
ASTFileSignature Signature;
- const Module *ClangModule = nullptr;
+ Module *ClangModule = nullptr;
public:
ASTSourceDescriptor() = default;
@@ -670,13 +670,13 @@ class ASTSourceDescriptor {
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; }
};
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp
index dd8f11101107..5fd7d304f8f4 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/lib/Basic/Module.cpp
@@ -659,7 +659,7 @@ void VisibleModuleSet::setVisible(Module *M, SourceLocation Loc,
VisitModule({M, nullptr});
}
-ASTSourceDescriptor::ASTSourceDescriptor(const Module &M)
+ASTSourceDescriptor::ASTSourceDescriptor(Module &M)
: Signature(M.Signature), ClangModule(&M) {
if (M.Directory)
Path = M.Directory->getName();
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 7437f649a090..bea9bdd22bab 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -8514,7 +8514,7 @@ unsigned ASTReader::getModuleFileID(ModuleFile *F) {
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.
More information about the cfe-commits
mailing list