r293518 - [ASTMatchers] Sprinkle some constexpr on the global matcher constructors.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 30 10:20:00 PST 2017


Author: d0k
Date: Mon Jan 30 12:20:00 2017
New Revision: 293518

URL: http://llvm.org/viewvc/llvm-project?rev=293518&view=rev
Log:
[ASTMatchers] Sprinkle some constexpr on the global matcher constructors.

This dramatically reduces the size of the global constructors we emit
for those variables in debug mode.

Modified:
    cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h

Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h?rev=293518&r1=293517&r2=293518&view=diff
==============================================================================
--- cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h (original)
+++ cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h Mon Jan 30 12:20:00 2017
@@ -1459,7 +1459,7 @@ class VariadicDynCastAllOfMatcher
     : public VariadicFunction<BindableMatcher<SourceT>, Matcher<TargetT>,
                               makeDynCastAllOfComposite<SourceT, TargetT>> {
 public:
-  VariadicDynCastAllOfMatcher() {}
+  constexpr VariadicDynCastAllOfMatcher() {}
 };
 
 /// \brief A \c VariadicAllOfMatcher<T> object is a variadic functor that takes
@@ -1477,7 +1477,7 @@ class VariadicAllOfMatcher
     : public VariadicFunction<BindableMatcher<T>, Matcher<T>,
                               makeAllOfComposite<T>> {
 public:
-  VariadicAllOfMatcher() {}
+  constexpr VariadicAllOfMatcher() {}
 };
 
 /// \brief Matches nodes of type \c TLoc for which the inner
@@ -1598,7 +1598,7 @@ public:
 
   struct Func
       : public VariadicFunction<Self, Matcher<InnerTBase>, &Self::create> {
-    Func() {}
+    constexpr Func() {}
   };
 
 private:




More information about the cfe-commits mailing list