KKazu Hirata[clang] Use value instead of getValue (NFC)
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[Tooling/DependencyScanning] Rename refactorings towards transitioning dependency scanning to use pre-lexed preprocessor directive tokens This is first of a series of patches for making the special lexing for dependency scanning a first-class feature of the Preprocessor and Lexer. This patch only includes NFC renaming changes to make reviewing of the functionality changing parts easier. Differential Revision: https://reviews.llvm.org/D125484 | 4 年前 | |
[Tooling/DependencyScanning & Preprocessor] Refactor dependency scanning to produce pre-lexed preprocessor directive tokens, instead of minimized sources This is a commit with the following changes: * Remove ExcludedPreprocessorDirectiveSkipMapping and related functionality Removes ExcludedPreprocessorDirectiveSkipMapping; its intended benefit for fast skipping of excluded directived blocks will be superseded by a follow-up patch in the series that will use dependency scanning lexing for the same purpose. * Refactor dependency scanning to produce pre-lexed preprocessor directive tokens, instead of minimized sources Replaces the "source minimization" mechanism with a mechanism that produces lexed dependency directives tokens. * Make the special lexing for dependency scanning a first-class feature of the Preprocessor and Lexer This is bringing the following benefits: * Full access to the preprocessor state during dependency scanning. E.g. a component can see what includes were taken and where they were located in the actual sources. * Improved performance for dependency scanning. Measurements with a release+thin-LTO build shows ~ -11% reduction in wall time. * Opportunity to use dependency scanning lexing to speed-up skipping of excluded conditional blocks during normal preprocessing (as follow-up, not part of this patch). For normal preprocessing measurements show differences are below the noise level. Since, after this change, we don't minimize sources and pass them in place of the real sources, DependencyScanningFilesystem is not technically necessary, but it has valuable performance benefits for caching file stats along with the results of scanning the sources. So the setup of using the DependencyScanningFilesystem during a dependency scan remains. Differential Revision: https://reviews.llvm.org/D125486 Differential Revision: https://reviews.llvm.org/D125487 Differential Revision: https://reviews.llvm.org/D125488 | 4 年前 | |
[clang] NFC: split HeaderMapTest to have re-usable header map implementation for testing NFC changes required for https://reviews.llvm.org/D103142 Test Plan: check-clang Differential Revision: https://reviews.llvm.org/D103229 | 5 年前 | |
[clang] NFC: split HeaderMapTest to have re-usable header map implementation for testing NFC changes required for https://reviews.llvm.org/D103142 Test Plan: check-clang Differential Revision: https://reviews.llvm.org/D103229 | 5 年前 | |
[clang] Use value instead of getValue (NFC) | 4 年前 | |
[clang, clang-tools-extra] Don't use Optional::{hasValue,getValue} (NFC) | 4 年前 | |
[clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() This patch changes type of the File parameter in PPCallbacks::InclusionDirective() from const FileEntry * to Optional<FileEntryRef>. With the API change in place, this patch then removes some uses of the deprecated FileEntry::getName() (e.g. in DependencyGraph.cpp and ModuleDependencyCollector.cpp). Reviewed By: dexonsmith, bnbarham Differential Revision: https://reviews.llvm.org/D123574 | 4 年前 | |
Modules: Rename MemoryBufferCache to InMemoryModuleCache Change MemoryBufferCache to InMemoryModuleCache, moving it from Basic to Serialization. Another patch will start using it to manage module build more explicitly, but this is split out because it's mostly mechanical. Because of the move to Serialization we can no longer abuse the Preprocessor to forward it to the ASTReader. Besides the rename and file move, that means Preprocessor::Preprocessor has one fewer parameter and ASTReader::ASTReader has one more. llvm-svn: 355777 | 7 年前 | |
[Preprocessor] Reduce the memory overhead of #define directives (Recommit) Recently we observed high memory pressure caused by clang during some parallel builds. We discovered that we have several projects that have a large number of #define directives in their TUs (on the order of millions), which caused huge memory consumption in clang due to a lot of allocations for MacroInfo. We would like to reduce the memory overhead of clang for a single #define to reduce the memory overhead for these files, to allow us to reduce the memory pressure on the system during highly parallel builds. This change achieves that by removing the SmallVector in MacroInfo and instead storing the tokens in an array allocated using the bump pointer allocator, after all tokens are lexed. The added unit test with 1000000 #define directives illustrates the problem. Prior to this change, on arm64 macOS, clang's PP bump pointer allocator allocated 272007616 bytes, and used roughly 272 bytes per #define. After this change, clang's PP bump pointer allocator allocates 120002016 bytes, and uses only roughly 120 bytes per #define. For an example test file that we have internally with 7.8 million #define directives, this change produces the following improvement on arm64 macOS: Persistent allocation footprint for this test case file as it's being compiled to LLVM IR went down 22% from 5.28 GB to 4.07 GB and the total allocations went down 14% from 8.26 GB to 7.05 GB. Furthermore, this change reduced the total number of allocations made by the system for this clang invocation from 1454853 to 133663, an order of magnitude improvement. The recommit fixes the LLDB build failure. Differential Revision: https://reviews.llvm.org/D117348 | 4 年前 |