diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-02-25 00:56:02 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-02-25 00:56:02 +0000 |
commit | 5638c1146ea2fb951932a55c9a4aa01d994f0d26 (patch) | |
tree | 9c8dfb64567d32c7b55049b71d9d5a2cbdd8b62f /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 8bc9ccc60a0ae3b38b37bf0916e27bc95e968be2 (diff) | |
download | llvm-5638c1146ea2fb951932a55c9a4aa01d994f0d26.zip llvm-5638c1146ea2fb951932a55c9a4aa01d994f0d26.tar.gz llvm-5638c1146ea2fb951932a55c9a4aa01d994f0d26.tar.bz2 |
[modules] Fix a bug that would result in a build with P paths through a module
graph with M modules to take O(P) time, not just O(M) time, when using explicit
module builds.
llvm-svn: 230412
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 832aee2..fc97981 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1288,6 +1288,9 @@ bool CompilerInstance::loadModuleFile(StringRef FileName) { bool needsImportVisitation() const override { return true; } void visitImport(StringRef FileName) override { + if (!CI.ExplicitlyLoadedModuleFiles.insert(FileName).second) + return; + ModuleFileStack.push_back(FileName); if (ASTReader::readASTFileControlBlock(FileName, CI.getFileManager(), *this)) { |