[PATCH] D75561: Remove const qualifier from Modules returned by ExternalASTSource. (NFC)

2020-04-01 Thread Adrian Prantl via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf4754ea0ed7d: Remove const qualifier from Modules returned 
by ExternalASTSource. (NFC) (authored by aprantl).
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

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
@@ -8514,7 +8514,7 @@
 
 llvm::Optional
 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 )
+ASTSourceDescriptor::ASTSourceDescriptor(Module )
 : Signature(M.Signature), ClangModule() {
   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 );
+  ASTSourceDescriptor(Module );
 
   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; }
 };
 
 


Index: clang/lib/Serialization/ASTReader.cpp
===
--- clang/lib/Serialization/ASTReader.cpp
+++ clang/lib/Serialization/ASTReader.cpp
@@ -8514,7 +8514,7 @@
 
 llvm::Optional
 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 )
+ASTSourceDescriptor::ASTSourceDescriptor(Module )
 : Signature(M.Signature), ClangModule() {
   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 );
+  ASTSourceDescriptor(Module );
 
   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; }
 };
 
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D75561: Remove const qualifier from Modules returned by ExternalASTSource. (NFC)

2020-04-01 Thread Raphael Isemann via Phabricator via cfe-commits
teemperor accepted this revision.
teemperor added a comment.
This revision is now accepted and ready to land.

I seems quite a lot of APIs in Clang are already requiring non-const Modules so 
I think this is fine to make D75488  possible. 
Let's ship it


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75561/new/

https://reviews.llvm.org/D75561



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D75561: Remove const qualifier from Modules returned by ExternalASTSource. (NFC)

2020-03-31 Thread Raphael Isemann via Phabricator via cfe-commits
teemperor added a comment.

I am fine with this if we *really* need it for D75488 
. So far the only direct place where we do 
need the module to be non-const was some redundant assignment for Name (I added 
a comment in D75488 ), but if that is removed 
I believe the rest of the code should work with a const Module.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75561/new/

https://reviews.llvm.org/D75561



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D75561: Remove const qualifier from Modules returned by ExternalASTSource. (NFC)

2020-03-27 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added a comment.

Pinging @teemperor


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75561/new/

https://reviews.llvm.org/D75561



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D75561: Remove const qualifier from Modules returned by ExternalASTSource. (NFC)

2020-03-25 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added a comment.

I added a comment to D75488 . It's in 
getOrCreateModule().


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75561/new/

https://reviews.llvm.org/D75561



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D75561: Remove const qualifier from Modules returned by ExternalASTSource. (NFC)

2020-03-25 Thread Raphael Isemann via Phabricator via cfe-commits
teemperor added a comment.

Can you link what code is actually requiring this change? I just went over the 
patch series and it's not obvious to me what exactly this is used for.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75561/new/

https://reviews.llvm.org/D75561



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D75561: Remove const qualifier from Modules returned by ExternalASTSource. (NFC)

2020-03-17 Thread Adrian Prantl via Phabricator via cfe-commits
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
 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 )
+ASTSourceDescriptor::ASTSourceDescriptor(Module )
 : Signature(M.Signature), ClangModule() {
   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 );
+  ASTSourceDescriptor(Module );
 
   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; }
 };
 
 


Index: clang/lib/Serialization/ASTReader.cpp
===
--- clang/lib/Serialization/ASTReader.cpp
+++ clang/lib/Serialization/ASTReader.cpp
@@ -8493,7 +8493,7 @@
 
 llvm::Optional
 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 )
+ASTSourceDescriptor::ASTSourceDescriptor(Module )
 : Signature(M.Signature), ClangModule() {
   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 );
+  ASTSourceDescriptor(Module );
 
   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; }
 };
 
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D75561: Remove const qualifier from Modules returned by ExternalASTSource. (NFC)

2020-03-03 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl created this revision.
aprantl added reviewers: teemperor, rsmith, shafik.

This API is used by LLDB to attach owning module information to Declarations 
deserialized from DWARF.


https://reviews.llvm.org/D75561

Files:
  clang/include/clang/AST/ExternalASTSource.h
  clang/lib/AST/ExternalASTSource.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
 ASTReader::getSourceDescriptor(unsigned ID) {
-  if (const Module *M = getSubmodule(ID))
+  if (Module *M = getSubmodule(ID))
 return ExternalASTSource::ASTSourceDescriptor(*M);
 
   // If there is only a single PCH, return it instead.
Index: clang/lib/AST/ExternalASTSource.cpp
===
--- clang/lib/AST/ExternalASTSource.cpp
+++ clang/lib/AST/ExternalASTSource.cpp
@@ -39,7 +39,7 @@
   return EK_ReplyHazy;
 }
 
-ExternalASTSource::ASTSourceDescriptor::ASTSourceDescriptor(const Module )
+ExternalASTSource::ASTSourceDescriptor::ASTSourceDescriptor(Module )
   : Signature(M.Signature), ClangModule() {
   if (M.Directory)
 Path = M.Directory->getName();
Index: clang/include/clang/AST/ExternalASTSource.h
===
--- clang/include/clang/AST/ExternalASTSource.h
+++ clang/include/clang/AST/ExternalASTSource.h
@@ -173,7 +173,7 @@
 StringRef Path;
 StringRef ASTFile;
 ASTFileSignature Signature;
-const Module *ClangModule = nullptr;
+Module *ClangModule = nullptr;
 
   public:
 ASTSourceDescriptor() = default;
@@ -181,13 +181,13 @@
 ASTFileSignature Signature)
 : PCHModuleName(std::move(Name)), Path(std::move(Path)),
   ASTFile(std::move(ASTFile)), Signature(Signature) {}
-ASTSourceDescriptor(const Module );
+ASTSourceDescriptor(Module );
 
 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; }
   };
 
   /// Return a descriptor for the corresponding module, if one exists.


Index: clang/lib/Serialization/ASTReader.cpp
===
--- clang/lib/Serialization/ASTReader.cpp
+++ clang/lib/Serialization/ASTReader.cpp
@@ -8493,7 +8493,7 @@
 
 llvm::Optional
 ASTReader::getSourceDescriptor(unsigned ID) {
-  if (const Module *M = getSubmodule(ID))
+  if (Module *M = getSubmodule(ID))
 return ExternalASTSource::ASTSourceDescriptor(*M);
 
   // If there is only a single PCH, return it instead.
Index: clang/lib/AST/ExternalASTSource.cpp
===
--- clang/lib/AST/ExternalASTSource.cpp
+++ clang/lib/AST/ExternalASTSource.cpp
@@ -39,7 +39,7 @@
   return EK_ReplyHazy;
 }
 
-ExternalASTSource::ASTSourceDescriptor::ASTSourceDescriptor(const Module )
+ExternalASTSource::ASTSourceDescriptor::ASTSourceDescriptor(Module )
   : Signature(M.Signature), ClangModule() {
   if (M.Directory)
 Path = M.Directory->getName();
Index: clang/include/clang/AST/ExternalASTSource.h
===
--- clang/include/clang/AST/ExternalASTSource.h
+++ clang/include/clang/AST/ExternalASTSource.h
@@ -173,7 +173,7 @@
 StringRef Path;
 StringRef ASTFile;
 ASTFileSignature Signature;
-const Module *ClangModule = nullptr;
+Module *ClangModule = nullptr;
 
   public:
 ASTSourceDescriptor() = default;
@@ -181,13 +181,13 @@
 ASTFileSignature Signature)
 : PCHModuleName(std::move(Name)), Path(std::move(Path)),
   ASTFile(std::move(ASTFile)), Signature(Signature) {}
-ASTSourceDescriptor(const Module );
+ASTSourceDescriptor(Module );
 
 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; }
   };
 
   /// Return a descriptor for the corresponding module, if one exists.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits