[clang] Revise the modules document for clarity (PR #90237)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 27 20:05:17 PDT 2024


================
@@ -530,43 +527,43 @@ Now the linkage name of ``NS::foo()`` will be ``_ZN2NS3fooEv``.
 Module Initializers
 ~~~~~~~~~~~~~~~~~~~
 
-All the importable module units are required to emit an initializer function.
-The initializer function should contain calls to importing modules first and
-all the dynamic-initializers in the current module unit then.
-
-Translation units explicitly or implicitly importing named modules must call
-the initializer functions of the imported named modules within the sequence of
-the dynamic-initializers in the TU. Initializations of entities at namespace
-scope are appearance-ordered. This (recursively) extends into imported modules
-at the point of appearance of the import declaration.
+All importable module units are required to emit an initializer function. The
----------------
ChuanqiXu9 wrote:

They are required to handle the dynamic initializations of non-inline variables in the module unit. But the importable module units have to emit the initializer even if there is no dynamic initialization. Otherwise, the importer may calling a non-exist function.

https://github.com/llvm/llvm-project/pull/90237


More information about the cfe-commits mailing list