[clang] [clang] Optimize castToDeclContext for 2% improvement in build times (PR #76825)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 4 00:01:10 PST 2024


================
@@ -95,8 +103,31 @@ std::pair<ASTNode, ASTNode> ClangASTNodesEmitter::EmitNode(raw_ostream &OS,
   if (!Base.isAbstract())
     First = Last = Base;
 
+  class Comp {
----------------
cor3ntin wrote:

Yes, this might as well be a lambda.
I also think some comment to explain what PriorizeIfSubclassOf is and why it is used would be useful;
We might very well forget why we put classes that are declcontext first in the future.

https://github.com/llvm/llvm-project/pull/76825


More information about the cfe-commits mailing list