[llvm] [clang] [clang, SystemZ] Pass HasDef flag to getMinGlobalAlign(). (PR #73511)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 09:57:51 PST 2023


================
@@ -1687,7 +1687,8 @@ CharUnits ASTContext::getDeclAlign(const Decl *D, bool ForAlignof) const {
       if (VD->hasGlobalStorage() && !ForAlignof) {
         uint64_t TypeSize =
             !BaseT->isIncompleteType() ? getTypeSize(T.getTypePtr()) : 0;
-        Align = std::max(Align, getTargetInfo().getMinGlobalAlign(TypeSize));
+        Align = std::max(Align, getTargetInfo().getMinGlobalAlign(
+                                    TypeSize, VD->hasDefinition()));
----------------
efriedma-quic wrote:

Not sure hasDefinition() is quite the right thing here; what if the symbol is weak?

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


More information about the llvm-commits mailing list