summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorEli Friedman <efriedma@quicinc.com>2022-04-14 13:50:03 -0700
committerEli Friedman <efriedma@quicinc.com>2022-04-14 13:58:17 -0700
commit6cf0b1b3da3e8662baf030a2d741e3becaaab2b0 (patch)
treea627e89caa919bdba292b83ade47cd7334e0d88d /clang/lib/CodeGen/CodeGenModule.cpp
parenteb14135e35bf2463a5c52394f311d47c18d72dee (diff)
Comment out assertions about initializer size added in D123649.
They're causing failures in LLVM test-suite. Added some regression tests that explain the issue.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index dbbbf7fd554b..5184a363f18f 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -4631,6 +4631,10 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D,
if (getLangOpts().CPlusPlus && !NeedsGlobalDtor)
DelayedCXXInitPosition.erase(D);
+#if 0
+ // FIXME: The following check doesn't handle flexible array members
+ // inside tail padding (which don't actually increase the size of
+ // the struct).
#ifndef NDEBUG
CharUnits VarSize = getContext().getTypeSizeInChars(ASTTy) +
InitDecl->getFlexibleArrayInitChars(getContext());
@@ -4638,6 +4642,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D,
getDataLayout().getTypeAllocSize(Init->getType()));
assert(VarSize == CstSize && "Emitted constant has unexpected size");
#endif
+#endif
}
}