Shrink SmallPtrSet. It gets swapped a lot which copies the whole small part.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 23 Feb 2013 16:56:22 +0000 (16:56 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 23 Feb 2013 16:56:22 +0000 (16:56 +0000)
Testing shows that it's empty in >99% of the cases and I couldn't find a case
where it contained more than 2 elements.

llvm-svn: 175967

clang/include/clang/Sema/Sema.h

index 669cf9e..12a787e 100644 (file)
@@ -256,7 +256,7 @@ public:
   /// element type here is ExprWithCleanups::Object.
   SmallVector<BlockDecl*, 8> ExprCleanupObjects;
 
-  llvm::SmallPtrSet<Expr*, 8> MaybeODRUseExprs;
+  llvm::SmallPtrSet<Expr*, 2> MaybeODRUseExprs;
 
   /// \brief Stack containing information about each of the nested
   /// function, block, and method scopes that are currently active.
@@ -629,7 +629,7 @@ public:
     /// this expression evaluation context.
     unsigned NumCleanupObjects;
 
-    llvm::SmallPtrSet<Expr*, 8> SavedMaybeODRUseExprs;
+    llvm::SmallPtrSet<Expr*, 2> SavedMaybeODRUseExprs;
 
     /// \brief The lambdas that are present within this context, if it
     /// is indeed an unevaluated context.