]> granicus.if.org Git - clang/commitdiff
[CrashReproducer] Change module map callback signature. NFC
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 6 May 2016 23:21:50 +0000 (23:21 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 6 May 2016 23:21:50 +0000 (23:21 +0000)
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.

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

include/clang/Lex/ModuleMap.h
lib/Frontend/ModuleDependencyCollector.cpp
lib/Lex/ModuleMap.cpp

index b8cfb8faa8dab923021f060d1203c02432e70b79..313cfbe76686029e100b55c2f18acafbf4aeba5c 100644 (file)
@@ -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 {
index 02d3c515ef0561f3497c86bc01f601d8fe48801d..4ef3b1ee2e9ac28369273595a9540e804184df82 100644 (file)
@@ -44,8 +44,7 @@ struct ModuleDependencyMMCallbacks : public ModuleMapCallbacks {
   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);
   }
index 467ae7ec5181214f3451d6165c35d04c79f933ec..39ded6f61343e2baace2dc79c6f48a60bfebf166 100644 (file)
@@ -809,7 +809,7 @@ void ModuleMap::addHeader(Module *Mod, Module::Header Header,
 
   // 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) {