]> granicus.if.org Git - clang/commitdiff
Make ModuleDependencyCollector's method virtual (NFC)
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 12 Feb 2019 21:45:14 +0000 (21:45 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 12 Feb 2019 21:45:14 +0000 (21:45 +0000)
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.

The alternative was to inherit from the DependencyCollector directly,
but that would mean re-implementing the ModuleDependencyListener and the
ModuleDependencyPPCallbacks and ModuleDependencyMMCallbacks.

Differential revision: https://reviews.llvm.org/D58072

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353882 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Frontend/Utils.h

index 58c5a39a88a0dd2595a3946fef01834f24b0ff8e..124d4a9933077ca91b0edfc901fcf4c568d26e26 100644 (file)
@@ -145,18 +145,18 @@ public:
   ~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;
 
-  void writeFileMap();
-  bool hasErrors() { return HasErrors; }
+  virtual void writeFileMap();
+  virtual bool hasErrors() { return HasErrors; }
 };
 
 /// AttachDependencyGraphGen - Create a dependency graph generator, and attach