]> granicus.if.org Git - clang/commitdiff
SmallVectorize a critical vector.
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 6 Jul 2011 16:43:46 +0000 (16:43 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 6 Jul 2011 16:43:46 +0000 (16:43 +0000)
The small number of elements was determined by taking the median
file length in clang+llvm and /usr/include on OS X with xcode installed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134496 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/SourceManager.cpp

index 92557a421f113c8384825084ee6b07c2d74279e9..de709de9a22ee890999dd2bf350ee83f4473814c 100644 (file)
@@ -917,7 +917,7 @@ static void ComputeLineNumbers(Diagnostic &Diag, ContentCache *FI,
 
   // Find the file offsets of all of the *physical* source lines.  This does
   // not look at trigraphs, escaped newlines, or anything else tricky.
-  std::vector<unsigned> LineOffsets;
+  llvm::SmallVector<unsigned, 256> LineOffsets;
 
   // Line #1 starts at char 0.
   LineOffsets.push_back(0);