aboutsummaryrefslogtreecommitdiff
path: root/clang/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
commit2999b77f1d1aec8b715b75d6724df6e905b73969 (patch)
tree9c7756e498f014f13a0b05bc0a5dfbc57bfd4eeb /clang/lib/Basic/SourceManager.cpp
parent23e8b6b8c918238d870248baa21f37c81ff3817a (diff)
downloadllvm-2999b77f1d1aec8b715b75d6724df6e905b73969.zip
llvm-2999b77f1d1aec8b715b75d6724df6e905b73969.tar.gz
llvm-2999b77f1d1aec8b715b75d6724df6e905b73969.tar.bz2
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. llvm-svn: 175906
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 901d3a6..c5d275a 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/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) {