[cfe-commits] r62451 - /cfe/trunk/include/clang/Lex/PreprocessorLexer.h

Chris Lattner sabre at nondot.org
Sat Jan 17 18:52:26 PST 2009


Author: lattner
Date: Sat Jan 17 20:52:26 2009
New Revision: 62451

URL: http://llvm.org/viewvc/llvm-project?rev=62451&view=rev
Log:
Avoid malloc thrashing on the std::vector for ConditionalStack.  Because
there is one of these per header, this almost always gets alloc/free'd for
each #ifdef.

Modified:
    cfe/trunk/include/clang/Lex/PreprocessorLexer.h

Modified: cfe/trunk/include/clang/Lex/PreprocessorLexer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/PreprocessorLexer.h?rev=62451&r1=62450&r2=62451&view=diff

==============================================================================
--- cfe/trunk/include/clang/Lex/PreprocessorLexer.h (original)
+++ cfe/trunk/include/clang/Lex/PreprocessorLexer.h Sat Jan 17 20:52:26 2009
@@ -16,7 +16,7 @@
 
 #include "clang/Lex/MultipleIncludeOpt.h"
 #include "clang/Lex/Token.h"
-#include <vector>
+#include "llvm/ADT/SmallVector.h"
 #include <string>
 	
 namespace clang {
@@ -61,7 +61,7 @@
   
   /// ConditionalStack - Information about the set of #if/#ifdef/#ifndef blocks
   /// we are currently in.
-  std::vector<PPConditionalInfo> ConditionalStack;
+  llvm::SmallVector<PPConditionalInfo, 4> ConditionalStack;
   
   PreprocessorLexer(const PreprocessorLexer&);          // DO NOT IMPLEMENT
   void operator=(const PreprocessorLexer&); // DO NOT IMPLEMENT





More information about the cfe-commits mailing list