aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-02-22 18:29:39 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-02-22 18:29:39 +0000
commitf512acee01617c9da8079ed88ded3bb9f2418349 (patch)
treec30895769887135415c9f804566de2d96806b38b /lib/Basic/SourceManager.cpp
parent4c8cba87e49ec2fd39c1ff3b903924e791734a8a (diff)
Replace some typically large vectors with SmallVector.
This may seem counter-intuitive but the POD-like optimization helps when the vectors grow into multimegabyte buffers. SmallVector calls realloc which knows how to twiddle virtual memory bits and avoids large copies. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175906 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
-rw-r--r--lib/Basic/SourceManager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp
index 901d3a6e04..c5d275ab54 100644
--- a/lib/Basic/SourceManager.cpp
+++ b/lib/Basic/SourceManager.cpp
@@ -721,7 +721,7 @@ FileID SourceManager::getFileIDLocal(unsigned SLocOffset) const {
// See if this is near the file point - worst case we start scanning from the
// most newly created FileID.
- std::vector<SrcMgr::SLocEntry>::const_iterator I;
+ const SrcMgr::SLocEntry *I;
if (LastFileIDLookup.ID < 0 ||
LocalSLocEntryTable[LastFileIDLookup.ID].getOffset() < SLocOffset) {