aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Serialization/ModuleManager.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-01-25 22:25:23 +0000
committerDouglas Gregor <dgregor@apple.com>2013-01-25 22:25:23 +0000
commitd07865b42dcb32154c75134fded51b38cc55a0c4 (patch)
tree80b256b1e5115d5116ef9a7ad8737ad8bc25474b /include/clang/Serialization/ModuleManager.h
parent3d115cfd1b9c48155d478b1f2f14dba1b6ba9a91 (diff)
Optimize ModuleManager::visit() by precomputing the visitation order
and limiting ourselves to two memory allocations. 10% speedup in -fsyntax-only time for modules. With this change, we can actually see some performance different from the global module index, but it's still about 1%. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Serialization/ModuleManager.h')
-rw-r--r--include/clang/Serialization/ModuleManager.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/clang/Serialization/ModuleManager.h b/include/clang/Serialization/ModuleManager.h
index 512d7e9b66..465da76787 100644
--- a/include/clang/Serialization/ModuleManager.h
+++ b/include/clang/Serialization/ModuleManager.h
@@ -38,7 +38,10 @@ class ModuleManager {
/// \brief A lookup of in-memory (virtual file) buffers
llvm::DenseMap<const FileEntry *, llvm::MemoryBuffer *> InMemoryBuffers;
-
+
+ /// \brief The visitation order.
+ SmallVector<ModuleFile *, 4> VisitOrder;
+
public:
typedef SmallVector<ModuleFile*, 2>::iterator ModuleIterator;
typedef SmallVector<ModuleFile*, 2>::const_iterator ModuleConstIterator;