Author: d0k Date: Tue Oct 10 00:21:51 2017 New Revision: 315277 URL: http://llvm.org/viewvc/llvm-project?rev=315277&view=rev Log: [clang-tidy] Use a more efficient map for the virtual near miss check.
DenseMap performs better here. No functionality change intended. Modified: clang-tools-extra/trunk/clang-tidy/misc/VirtualNearMissCheck.h Modified: clang-tools-extra/trunk/clang-tidy/misc/VirtualNearMissCheck.h URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/VirtualNearMissCheck.h?rev=315277&r1=315276&r2=315277&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/VirtualNearMissCheck.h (original) +++ clang-tools-extra/trunk/clang-tidy/misc/VirtualNearMissCheck.h Tue Oct 10 00:21:51 2017 @@ -11,7 +11,7 @@ #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_VIRTUAL_NEAR_MISS_H #include "../ClangTidy.h" -#include <map> +#include "llvm/ADT/DenseMap.h" namespace clang { namespace tidy { @@ -47,12 +47,12 @@ private: /// Key: the unique ID of a method. /// Value: whether the method is possible to be overridden. - std::map<const CXXMethodDecl *, bool> PossibleMap; + llvm::DenseMap<const CXXMethodDecl *, bool> PossibleMap; /// Key: <unique ID of base method, name of derived class> /// Value: whether the base method is overridden by some method in the derived /// class. - std::map<std::pair<const CXXMethodDecl *, const CXXRecordDecl *>, bool> + llvm::DenseMap<std::pair<const CXXMethodDecl *, const CXXRecordDecl *>, bool> OverriddenMap; const unsigned EditDistanceThreshold = 1; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits