mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
Mirror of https://github.com/RPCS3/llvm-mirror
86423aa8b7
This is needed to fix the reason 0a2be46cfdb698fe (Modules: Invalidate out-of-date PCMs as they're discovered) and 5b44a4b07fc1d ([modules] Do not cache invalid state for modules that we attempted to load.) were reverted. These patches changed Clang to use `isVolatile` when loading modules. This had the side effect of not using mmap when loading modules, and thus greatly increased memory usage. The reason it wasn't using mmap is because `MemoryBuffer` plays some games with file size when you request null termination, and it has to disable these when `isVolatile` is set as the size may change by the time it's mmapped. Clang by default passes `RequiresNullTerminator = true`, and `shouldUseMmap` ignored if `RequiresNullTerminator` was even requested. This patch adds `RequiresNullTerminator` to the `FileManager` interface so Clang can use it when loading modules, and changes `shouldUseMmap` to only take volatility into account if `RequiresNullTerminator` is true. This is fine as both `mmap` and a `read` loop are vulnerable to modifying the file while reading, but are immune to the rename Clang does when replacing a module file. Differential Revision: https://reviews.llvm.org/D77772 |
||
---|---|---|
benchmarks | ||
bindings | ||
cmake | ||
docs | ||
examples | ||
include | ||
lib | ||
projects | ||
resources | ||
runtimes | ||
test | ||
tools | ||
unittests | ||
utils | ||
.clang-format | ||
.clang-tidy | ||
.gitattributes | ||
.gitignore | ||
CMakeLists.txt | ||
CODE_OWNERS.TXT | ||
configure | ||
CREDITS.TXT | ||
LICENSE.TXT | ||
llvm.spec.in | ||
LLVMBuild.txt | ||
README.txt | ||
RELEASE_TESTERS.TXT |
The LLVM Compiler Infrastructure ================================ This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments. LLVM is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt. Please see the documentation provided in docs/ for further assistance with LLVM, and in particular docs/GettingStarted.rst for getting started with LLVM and docs/README.txt for an overview of LLVM's documentation setup. If you are writing a package for LLVM, see docs/Packaging.rst for our suggestions.