Skip to content

Commit 6d3f6c2

Browse files
authored
[RecursiveASTVisitor] Do not inline TraverseStmt (NFC) (#107601)
As things are now, this reduces size of clang bootstrapped with ThinLTO by 0.3% and reduces thin link time by 0.3%. More importantly, it avoids a large regression once #107114 is merged. Without this change, there would be a 0.4% regression in code size and 4% (!) regression in thin link time. There is no impact on run-time performance.
1 parent dfa5429 commit 6d3f6c2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/include/clang/AST/RecursiveASTVisitor.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,11 @@ bool RecursiveASTVisitor<Derived>::PostVisitStmt(Stmt *S) {
652652

653653
#undef DISPATCH_STMT
654654

655+
// Inlining this method can lead to large code size and compile-time increases
656+
// without any benefit to runtime performance.
655657
template <typename Derived>
656-
bool RecursiveASTVisitor<Derived>::TraverseStmt(Stmt *S,
657-
DataRecursionQueue *Queue) {
658+
LLVM_ATTRIBUTE_NOINLINE bool
659+
RecursiveASTVisitor<Derived>::TraverseStmt(Stmt *S, DataRecursionQueue *Queue) {
658660
if (!S)
659661
return true;
660662

0 commit comments

Comments
 (0)