r268819 - [CrashReproducer] Change module map callback signature. NFC

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Fri May 6 16:21:50 PDT 2016


Author: bruno
Date: Fri May  6 18:21:50 2016
New Revision: 268819

URL: http://llvm.org/viewvc/llvm-project?rev=268819&view=rev
Log:
[CrashReproducer] Change module map callback signature. NFC

Use a StringRef instead of a FileEntry in the moduleMapAddHeader
callback to allow more flexibility on what to collect on further
patches. This changes the interface I introduced in r264971.

Modified:
    cfe/trunk/include/clang/Lex/ModuleMap.h
    cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp
    cfe/trunk/lib/Lex/ModuleMap.cpp

Modified: cfe/trunk/include/clang/Lex/ModuleMap.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/ModuleMap.h?rev=268819&r1=268818&r2=268819&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/ModuleMap.h (original)
+++ cfe/trunk/include/clang/Lex/ModuleMap.h Fri May  6 18:21:50 2016
@@ -54,7 +54,7 @@ public:
   /// \brief Called when a header is added during module map parsing.
   ///
   /// \param File The header file itself.
-  virtual void moduleMapAddHeader(const FileEntry &File) {}
+  virtual void moduleMapAddHeader(StringRef Filename) {}
 };
   
 class ModuleMap {

Modified: cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp?rev=268819&r1=268818&r2=268819&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp (original)
+++ cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp Fri May  6 18:21:50 2016
@@ -44,8 +44,7 @@ struct ModuleDependencyMMCallbacks : pub
   ModuleDependencyMMCallbacks(ModuleDependencyCollector &Collector)
       : Collector(Collector) {}
 
-  void moduleMapAddHeader(const FileEntry &File) override {
-    StringRef HeaderPath = File.getName();
+  void moduleMapAddHeader(StringRef HeaderPath) override {
     if (llvm::sys::path::is_absolute(HeaderPath))
       Collector.addFile(HeaderPath);
   }

Modified: cfe/trunk/lib/Lex/ModuleMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/ModuleMap.cpp?rev=268819&r1=268818&r2=268819&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/ModuleMap.cpp (original)
+++ cfe/trunk/lib/Lex/ModuleMap.cpp Fri May  6 18:21:50 2016
@@ -809,7 +809,7 @@ void ModuleMap::addHeader(Module *Mod, M
 
   // Notify callbacks that we just added a new header.
   for (const auto &Cb : Callbacks)
-    Cb->moduleMapAddHeader(*Header.Entry);
+    Cb->moduleMapAddHeader(Header.Entry->getName());
 }
 
 void ModuleMap::excludeHeader(Module *Mod, Module::Header Header) {




More information about the cfe-commits mailing list