Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lex] Bring back the magic number 50 in updateConsecutiveMacroArgTokens.
This patch is a reland of 74e4f77 and f83347b with the removed 50 trick back. The magic number 50 was removed in D134942, as a behavior change for performance reason. While it reduces the number of SLocEntry, it increases the usage of SourceLocation address space usage, which is critical for compiling large TU. This fixes a regression caused in D134942 -- clang failed to compile one of our internal files, complaining the file is too large to process because clang runs out of source location space (we spend 40% more address space!) Differential Revision: https://reviews.llvm.org/D136539
- Loading branch information
Showing
2 changed files
with
93 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// RUN: %clang -cc1 -print-stats %s 2>&1 | FileCheck %s | ||
// CHECK: 6 local SLocEntry's allocated | ||
// | ||
// Verify that the macro arg expansion is split to two file ids, we have 6 file | ||
// ids rather than 5: | ||
// 0: invalid file id | ||
// 1: main file | ||
// 2: builtin file | ||
// 3: macro expansion for X | ||
// 4: macro arg expansions for 1 | ||
// 5: macro arg expansions for == 2 | ||
#define X(x) (int)(x); | ||
void func() { | ||
X(1 | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
/*************************************************************************************************/ | ||
== 2); | ||
} |