Author: jdevlieghere Date: Tue Feb 12 13:45:14 2019 New Revision: 353882 URL: http://llvm.org/viewvc/llvm-project?rev=353882&view=rev Log: Make ModuleDependencyCollector's method virtual (NFC)
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 Modified: cfe/trunk/include/clang/Frontend/Utils.h Modified: cfe/trunk/include/clang/Frontend/Utils.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/Utils.h?rev=353882&r1=353881&r2=353882&view=diff ============================================================================== --- cfe/trunk/include/clang/Frontend/Utils.h (original) +++ cfe/trunk/include/clang/Frontend/Utils.h Tue Feb 12 13:45:14 2019 @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits