llvm-project/clang/lib
Volodymyr Sapsai 0a35cc40b8 [clang][objc] Speed up populating the global method pool from modules.
For each selector encountered in the source code, we need to load
selectors from the imported modules and check that we are calling a
selector with compatible types.

At the moment, for each module we are storing methods declared in the
headers belonging to this module and methods from the transitive closure
of imported modules. When a module is imported by a few other modules,
methods from the shared module are duplicated in each importer. As the
result, we can end up with lots of identical methods that we try to add
to the global method pool. Doing this duplicate work is useless and
relatively expensive.

Avoid processing duplicate methods by storing in each module only its
own methods and not storing methods from dependencies. Collect methods
from dependencies by walking the graph of module dependencies.

The issue was discovered and reported by Richard Howell. He has done the
hard work for this fix as he has investigated and provided a detailed
explanation of the performance problem.

Differential Revision: https://reviews.llvm.org/D110123
2021-11-03 17:11:14 -07:00
..
APINotes [clang][APINotes] Fix -Wunused-function warning (NFC) 2021-04-01 09:52:43 +08:00
ARCMigrate [clang] Use StringRef::contains (NFC) 2021-10-21 08:58:19 -07:00
AST [AST] injected-class-name is not a redecl, even in template specializations 2021-11-02 14:37:45 +01:00
ASTMatchers [clang] Use StringRef::contains (NFC) 2021-10-21 08:58:19 -07:00
Analysis [clang] Add range accessor for ObjCAtTryStmt catch_stmts and use it 2021-10-27 08:57:05 -04:00
Basic [X86][clang] Disable long double type for -mno-x87 option 2021-11-03 12:08:39 +03:00
CodeGen [ASan] Process functions in Asan module pass 2021-11-03 20:27:53 +00:00
CrossTU PR51018: Remove explicit conversions from SmallString to StringRef to future-proof against C++23 2021-07-08 13:37:57 -07:00
DirectoryWatcher Revert "Re-Revert "DirectoryWatcher: add an implementation for Windows"" 2021-06-19 09:19:52 -07:00
Driver [VE] Change to omitting the frame pointer on leaf functions 2021-11-03 17:45:18 +09:00
Edit [clang] Use llvm::is_contained (NFC) 2021-10-13 20:41:55 -07:00
Format [clang] Use llvm::{count,count_if,find_if,all_of,none_of} (NFC) 2021-10-25 09:14:45 -07:00
Frontend [clang] Add range accessor for ObjCAtTryStmt catch_stmts and use it 2021-10-27 08:57:05 -04:00
FrontendTool [clang] Add plugin ActionType to run command line plugin before main action 2021-10-20 08:58:20 -07:00
Headers [cuda] Add address space predicate funuctions. 2021-10-19 16:20:14 -04:00
Index [clang] Visit enum base specifiers in libIndex 2021-10-25 13:16:14 +02:00
IndexSerialization [index-while-building] Fix build with -DBUILD_SHARED_LIBS=True 2020-08-20 15:12:56 +01:00
Interpreter Reinstate "[clang-repl] Re-implement clang-interpreter as a test case." 2021-10-26 19:29:56 +00:00
Lex [clang][deps] Keep #pragma push_macro, pop_macro and include_alias when minimizing source code. 2021-11-01 16:04:52 -04:00
Parse [OpenMP] Initial parsing/sema for the 'omp loop' construct 2021-10-28 08:26:43 -07:00
Rewrite [clang] Use StringRef::contains (NFC) 2021-10-21 08:58:19 -07:00
Sema [PowerPC] Implement longdouble pack/unpack builtins 2021-11-03 17:57:25 +08:00
Serialization [clang][objc] Speed up populating the global method pool from modules. 2021-11-03 17:11:14 -07:00
StaticAnalyzer [analyzer] Dump checker name if multiple checkers evaluate the same call 2021-11-02 14:42:14 +01:00
Testing
Tooling [clang] Use llvm::{count,count_if,find_if,all_of,none_of} (NFC) 2021-10-25 09:14:45 -07:00
CMakeLists.txt [clang-repl] Recommit "Land initial infrastructure for incremental parsing" 2021-05-13 06:30:29 +00:00