================
@@ -2036,8 +2040,20 @@ DIE *DwarfUnit::getOrCreateStaticMemberDIE(const
DIDerivedType *DT) {
if (const ConstantInt *CI = dyn_cast_or_null<ConstantInt>(DT->getConstant()))
addConstantValue(StaticMemberDIE, CI, Ty);
- if (const ConstantFP *CFP = dyn_cast_or_null<ConstantFP>(DT->getConstant()))
+ else if (const ConstantFP *CFP =
+ dyn_cast_or_null<ConstantFP>(DT->getConstant()))
addConstantFPValue(StaticMemberDIE, CFP);
+ else if (auto *CDS =
+ dyn_cast_or_null<ConstantDataSequential>(DT->getConstant())) {
+ // Emit each array element in target byte order using addIntToBlock,
+ // which correctly handles endianness via getElementAsAPInt().
----------------
Michael137 wrote:
Can add an assert here that this is in fact a container of integers?
E.g.,
```
assert (CDS->getElementType()->isIntegerTy() && "Non-integer arrays not
supported.")
```
https://github.com/llvm/llvm-project/pull/184804
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits