[PATCH] D58072: Make ModuleDependencyCollector's method virtual (NFC)

Jonas Devlieghere via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 11 13:22:14 PST 2019


JDevlieghere created this revision.
JDevlieghere added reviewers: bruno, vsapsai.
Herald added a project: clang.

For reproducers in LLDB we want to hook up into the existing clang infrastructure. To make that happen we need to be able to override the ModuleDependencyCollector's methods.


Repository:
  rC Clang

https://reviews.llvm.org/D58072

Files:
  clang/include/clang/Frontend/Utils.h


Index: clang/include/clang/Frontend/Utils.h
===================================================================
--- clang/include/clang/Frontend/Utils.h
+++ clang/include/clang/Frontend/Utils.h
@@ -145,18 +145,18 @@
   ~ModuleDependencyCollector() override { writeFileMap(); }
 
   StringRef getDest() { return DestDir; }
-  bool insertSeen(StringRef Filename) { return Seen.insert(Filename).second; }
-  void addFile(StringRef Filename, StringRef FileDst = {});
+  virtual bool insertSeen(StringRef Filename) { return Seen.insert(Filename).second; }
+  virtual void addFile(StringRef Filename, StringRef FileDst = {});
 
-  void addFileMapping(StringRef VPath, StringRef RPath) {
+  virtual void addFileMapping(StringRef VPath, StringRef RPath) {
     VFSWriter.addFileMapping(VPath, RPath);
   }
 
-  void attachToPreprocessor(Preprocessor &PP) override;
-  void attachToASTReader(ASTReader &R) override;
+  virtual void attachToPreprocessor(Preprocessor &PP) override;
+  virtual void attachToASTReader(ASTReader &R) override;
 
-  void writeFileMap();
-  bool hasErrors() { return HasErrors; }
+  virtual void writeFileMap();
+  virtual bool hasErrors() { return HasErrors; }
 };
 
 /// AttachDependencyGraphGen - Create a dependency graph generator, and attach


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58072.186320.patch
Type: text/x-patch
Size: 1266 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190211/907c0833/attachment.bin>


More information about the cfe-commits mailing list