r260822 - Don't copy a DenseMap just to do lookup in it.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 13 07:49:17 PST 2016


Author: d0k
Date: Sat Feb 13 09:49:17 2016
New Revision: 260822

URL: http://llvm.org/viewvc/llvm-project?rev=260822&view=rev
Log:
Don't copy a DenseMap just to do lookup in it.

Also remove the now unused isPodLike specialization. DenseMap only uses
it for copies.

Modified:
    cfe/trunk/lib/Sema/SemaStmt.cpp

Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=260822&r1=260821&r2=260822&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Sat Feb 13 09:49:17 2016
@@ -3531,11 +3531,6 @@ template <> struct DenseMapInfo<CatchHan
     return LHS == RHS;
   }
 };
-
-// It's OK to treat CatchHandlerType as a POD type.
-template <> struct isPodLike<CatchHandlerType> {
-  static const bool value = true;
-};
 }
 
 namespace {
@@ -3560,7 +3555,7 @@ public:
   bool operator()(const CXXBaseSpecifier *S, CXXBasePath &) {
     if (S->getAccessSpecifier() == AccessSpecifier::AS_public) {
       CatchHandlerType Check(S->getType(), CheckAgainstPointer);
-      auto M = TypesToCheck;
+      const auto &M = TypesToCheck;
       auto I = M.find(Check);
       if (I != M.end()) {
         FoundHandler = I->second;




More information about the cfe-commits mailing list