[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 26 00:32:00 PDT 2022


ChuanqiXu added inline comments.


================
Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:699
+    Guard = new llvm::GlobalVariable(getModule(), Int8Ty, /*isConstant=*/false,
+                                     llvm::GlobalVariable::InternalLinkage,
+                                     llvm::ConstantInt::get(Int8Ty, 0),
----------------
ChuanqiXu wrote:
> Should the Guard be internal linkage? I image that it is possible to be manipulated by different TUs. So I feel like it might be better to be linkonce or linkonce_odr?
Oh, I realized I'm wrong. Don't remind this one.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126189/new/

https://reviews.llvm.org/D126189



More information about the cfe-commits mailing list