diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-21 16:33:15 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-21 16:33:15 +0000 |
commit | 998039e2f606cb90841acee47f828b7163309ece (patch) | |
tree | f9929ae24c495fc19e7eb19d7cf0a97a542c097e /clang/unittests/ASTMatchers/Dynamic | |
parent | f88d22970d5f7d859b86a17058675564b2b442af (diff) | |
download | bcm5719-llvm-998039e2f606cb90841acee47f828b7163309ece.tar.gz bcm5719-llvm-998039e2f606cb90841acee47f828b7163309ece.zip |
Shrink DynTypedNode by one pointer from 40 to 32 bytes (on x86_64).
The MemoizationData cache was introduced to avoid a series of enum
compares at the cost of making DynTypedNode bigger. This change reverts
to using an enum compare but instead of building a chain of comparison
the enum values are reordered so the check can be performed with a
simple greater than. The alternative would be to steal a bit from the
enum but I think that's a more complex solution and not really needed
here.
I tried this on several large .cpp files with clang-tidy and didn't
notice any performance difference. The test change is due to matchers
being sorted by their node kind.
Differential Revision: http://reviews.llvm.org/D13946
llvm-svn: 250905
Diffstat (limited to 'clang/unittests/ASTMatchers/Dynamic')
-rw-r--r-- | clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp b/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp index ca1dfefd538..66960a0bb2f 100644 --- a/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp +++ b/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp @@ -455,8 +455,8 @@ TEST_F(RegistryTest, Completion) { // Polymorphic. EXPECT_TRUE(hasCompletion( Comps, "hasDescendant(", - "Matcher<NestedNameSpecifier|NestedNameSpecifierLoc|QualType|...> " - "hasDescendant(Matcher<CXXCtorInitializer|NestedNameSpecifier|" + "Matcher<TemplateArgument|NestedNameSpecifier|NestedNameSpecifierLoc|...>" + " hasDescendant(Matcher<TemplateArgument|NestedNameSpecifier|" "NestedNameSpecifierLoc|...>)")); CompVector WhileComps = getCompletions("whileStmt", 0); |