The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. This fork is used to manage Apple’s stable releases of Clang as well as support the Swift project.
The commit adds serialization and de-serialization implementations for the stored regions. Basically, the serialized representation of the regions of a PP is a (ordered) sequence of source location encodings. For de-serialization, regions from loaded files are stored by their ASTs. When later one queries if a loaded location L is in an opt-out region, PP looks up the regions of the loaded AST where L is at.
(Background if helps: a pair of #pragma clang unsafe_buffer_usage begin/end pragmas marks a warning-opt-out region. The begin and end locations (opt-out regions) are stored in preprocessor instances (PP) and will be queried by the -Wunsafe-buffer-usage analyzer.)
The commit adds serialization and de-serialization implementations for the stored regions. Basically, the serialized representation of the regions of a PP is a (ordered) sequence of source location encodings. For de-serialization, regions from loaded files are stored by their ASTs. When later one queries if a loaded location L is in an opt-out region, PP looks up the regions of the loaded AST where L is at.
(Background if helps: a pair of
#pragma clang unsafe_buffer_usage begin/end
pragmas marks a warning-opt-out region. The begin and end locations (opt-out regions) are stored in preprocessor instances (PP) and will be queried by the-Wunsafe-buffer-usage
analyzer.)The reported issue at upstream: https://github.com/llvm/llvm-project/issues/90501 rdar://124035402
(cherry picked from commit 2e7b95e4c080426e5085c38cec01176b56798534)