aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2022-09-24 16:01:44 +0100
committerIain Sandoe <iain@sandoe.co.uk>2022-12-18 09:16:27 +0000
commitbd7f4c561f5e2385ebe5500a044efe0de30cccaa (patch)
tree6057783eb5b3010ccea2b3bd4015cd61d95e70c6 /clang/lib/Lex/ModuleMap.cpp
parent541ef3d61e9341cd38420c0dbca9250c4d0ea04c (diff)
downloadllvm-bd7f4c561f5e2385ebe5500a044efe0de30cccaa.zip
llvm-bd7f4c561f5e2385ebe5500a044efe0de30cccaa.tar.gz
llvm-bd7f4c561f5e2385ebe5500a044efe0de30cccaa.tar.bz2
[C++20][Modules] Elide unused guard variables in Itanium ABI module initializers.
For the Itanium ABI, we emit an initializer for each module. This is responsible for handling initialization of global vars. Relates to P1874R1. The initializer has a known mangling and is automatically called from any TU that imports a module. Since, at present, the importer has no way to determine that an imported module does not require an initializer, we generate the initializer for all cases (even when it is empty). Initializers must be run once, with the ordering guaranteed by the import graph and this is ensured in the current code by addition of a guard variable. In the case that a module has no requirement for global initializers, and also does not import any other modules, we can elide the guard variable. Differential Revision: https://reviews.llvm.org/D134589
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions