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

Andreas Krebbel via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 18 10:56:09 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()));
----------------
Andreas-Krebbel wrote:

Hi. I've just committed a fix for GCC to handle weak symbols correctly with -munaligned-symbols:
https://gcc.gnu.org/pipermail/gcc-patches/2023-December/640893.html

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


More information about the cfe-commits mailing list