aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-08-09 02:28:42 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-08-09 02:28:42 +0000
commit03f7e611c625de0b5509ee975ca01ff95525a7b6 (patch)
tree1361f19a71d801315b085794693461bdc20867d6 /clang/lib/Frontend/CompilerInstance.cpp
parentd9a0e64f66760ef146f97a4c2208e7a187d9a00e (diff)
downloadllvm-03f7e611c625de0b5509ee975ca01ff95525a7b6.zip
llvm-03f7e611c625de0b5509ee975ca01ff95525a7b6.tar.gz
llvm-03f7e611c625de0b5509ee975ca01ff95525a7b6.tar.bz2
[modules] Attach dependency listeners to the module manager once when it's
created, rather than creating and attaching a new listener each time we load a module file (yes, the old ones were kept around too!). No functionality change intended, but a bit more sanity. llvm-svn: 244411
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 9da69d4..4e7b08a 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -1261,6 +1261,13 @@ void CompilerInstance::createModuleManager() {
ModuleManager->InitializeSema(getSema());
if (hasASTConsumer())
ModuleManager->StartTranslationUnit(&getASTConsumer());
+
+ if (TheDependencyFileGenerator)
+ TheDependencyFileGenerator->AttachToASTReader(*ModuleManager);
+ if (ModuleDepCollector)
+ ModuleDepCollector->attachToASTReader(*ModuleManager);
+ for (auto &Listener : DependencyCollectors)
+ Listener->attachToASTReader(*ModuleManager);
}
}
@@ -1420,15 +1427,6 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
if (!ModuleManager)
createModuleManager();
- if (TheDependencyFileGenerator)
- TheDependencyFileGenerator->AttachToASTReader(*ModuleManager);
-
- if (ModuleDepCollector)
- ModuleDepCollector->attachToASTReader(*ModuleManager);
-
- for (auto &Listener : DependencyCollectors)
- Listener->attachToASTReader(*ModuleManager);
-
llvm::Timer Timer;
if (FrontendTimerGroup)
Timer.init("Loading " + ModuleFileName, *FrontendTimerGroup);