llvm-project/clang/lib
Arthur Eubanks 19b07ec000 Reland [clang] Pass -clear-ast-before-backend in Clang::ConstructJob()
This clears the memory used for the Clang AST before we run LLVM passes.

https://llvm-compile-time-tracker.com/compare.php?from=d0a5f61c4f6fccec87fd5207e3fcd9502dd59854&to=b7437fee79e04464dd968e1a29185495f3590481&stat=max-rss
shows significant memory savings with no slowdown (in fact -O0 slightly speeds up).

For more background, see
https://lists.llvm.org/pipermail/cfe-dev/2021-September/068930.html.

Turn this off for the interpreter since it does codegen multiple times.

Relanding with fix for -print-stats: D111973

Relanding with fix for plugins: D112190

If you'd like to use this even with plugins, consider using the features
introduced in D112096.

This can be turned off with -Xclang -no-clear-ast-before-backend.

Differential Revision: https://reviews.llvm.org/D111270
2021-10-21 09:25:53 -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 [clang] Use StringRef::contains (NFC) 2021-10-21 08:58:19 -07:00
ASTMatchers [clang] Use StringRef::contains (NFC) 2021-10-21 08:58:19 -07:00
Analysis [clang] Use StringRef::contains (NFC) 2021-10-21 08:58:19 -07:00
Basic [clang] Support __float128 on DragonFlyBSD. 2021-10-21 11:18:52 +02:00
CodeGen [clang] Use StringRef::contains (NFC) 2021-10-21 08:58:19 -07: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 Reland [clang] Pass -clear-ast-before-backend in Clang::ConstructJob() 2021-10-21 09:25:53 -07:00
Edit [clang] Use llvm::is_contained (NFC) 2021-10-13 20:41:55 -07:00
Format [clang-format] [PR52015] clang-format should put __attribute__((foo)) on its own line before @interface / @implementation / @protocol 2021-10-20 09:09:31 +01:00
Frontend [clang] Don't clear AST if we have consumers running after the main action 2021-10-21 09:03:57 -07: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] Add __ibm128 type to represent ppc_fp128 2021-09-06 18:00:58 +08:00
IndexSerialization [index-while-building] Fix build with -DBUILD_SHARED_LIBS=True 2020-08-20 15:12:56 +01:00
Interpreter Reland [clang] Pass -clear-ast-before-backend in Clang::ConstructJob() 2021-10-21 09:25:53 -07:00
Lex [clang] Use StringRef::contains (NFC) 2021-10-21 08:58:19 -07:00
Parse consteval if does not form a discarded statement 2021-10-20 07:24:55 -04:00
Rewrite [clang] Use StringRef::contains (NFC) 2021-10-21 08:58:19 -07:00
Sema Relax assert in ExprConstant to a return None. 2021-10-21 13:09:56 +01:00
Serialization [modules] While merging ObjCInterfaceDecl definitions, merge them as decl contexts too. 2021-10-20 18:48:29 -07:00
StaticAnalyzer InvalidPtrChecker - don't dereference a dyn_cast<> - use cast<> instead. 2021-10-20 18:06:00 +01:00
Testing
Tooling [clang][deps] NFC: Rename building CompilerInvocation 2021-10-21 13:51:27 +02:00
CMakeLists.txt [clang-repl] Recommit "Land initial infrastructure for incremental parsing" 2021-05-13 06:30:29 +00:00