[clang] [C++20] [Modules] Don't generate the defintition for non-const available external variables (PR #93530)
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Tue May 28 19:52:55 PDT 2024
ChuanqiXu9 wrote:
> I think if a variable is GVA_AvailableExternally, and we can't emit a constant, we should just completely skip emitting the definition: there isn't any point to emitting an available_externally definition that doesn't actually contain any information the optimizer can use.
>
> Not sure off the top of my head where that check belongs; might be okay to just stick it into EmitGlobalVarDefinition itself.
Neat suggestion! I've applied it and the generated code looks better.
https://github.com/llvm/llvm-project/pull/93530
More information about the cfe-commits
mailing list