diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-02-22 18:29:39 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-02-22 18:29:39 +0000 |
commit | 2999b77f1d1aec8b715b75d6724df6e905b73969 (patch) | |
tree | 9c7756e498f014f13a0b05bc0a5dfbc57bfd4eeb /clang/lib/Basic/SourceManager.cpp | |
parent | 23e8b6b8c918238d870248baa21f37c81ff3817a (diff) | |
download | llvm-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.cpp | 2 |
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) { |