struct CallInfo {
uint32_t Kind;
uint32_t AccessIndex;
- Align RecordAlignment;
+ MaybeAlign RecordAlignment;
MDNode *Metadata;
Value *Base;
};
uint32_t &StartBitOffset, uint32_t &EndBitOffset);
uint32_t GetFieldInfo(uint32_t InfoKind, DICompositeType *CTy,
uint32_t AccessIndex, uint32_t PatchImm,
- Align RecordAlignment);
+ MaybeAlign RecordAlignment);
Value *computeBaseAndAccessKey(CallInst *Call, CallInfo &CInfo,
std::string &AccessKey, MDNode *&BaseMeta);
report_fatal_error("Missing metadata for llvm.preserve.union.access.index intrinsic");
CInfo.AccessIndex = getConstant(Call->getArgOperand(1));
CInfo.Base = Call->getArgOperand(0);
- CInfo.RecordAlignment =
- DL->getABITypeAlign(CInfo.Base->getType()->getPointerElementType());
return true;
}
if (GV->getName().startswith("llvm.preserve.struct.access.index")) {
DICompositeType *CTy,
uint32_t AccessIndex,
uint32_t PatchImm,
- Align RecordAlignment) {
+ MaybeAlign RecordAlignment) {
if (InfoKind == BPFCoreSharedInfo::FIELD_EXISTENCE)
return 1;
PatchImm += MemberTy->getOffsetInBits() >> 3;
} else {
unsigned SBitOffset, NextSBitOffset;
- GetStorageBitRange(MemberTy, RecordAlignment, SBitOffset,
+ GetStorageBitRange(MemberTy, *RecordAlignment, SBitOffset,
NextSBitOffset);
PatchImm += SBitOffset >> 3;
}
return SizeInBits >> 3;
unsigned SBitOffset, NextSBitOffset;
- GetStorageBitRange(MemberTy, RecordAlignment, SBitOffset, NextSBitOffset);
+ GetStorageBitRange(MemberTy, *RecordAlignment, SBitOffset,
+ NextSBitOffset);
SizeInBits = NextSBitOffset - SBitOffset;
if (SizeInBits & (SizeInBits - 1))
report_fatal_error("Unsupported field expression for llvm.bpf.preserve.field.info");
}
unsigned SBitOffset, NextSBitOffset;
- GetStorageBitRange(MemberTy, RecordAlignment, SBitOffset, NextSBitOffset);
+ GetStorageBitRange(MemberTy, *RecordAlignment, SBitOffset, NextSBitOffset);
if (NextSBitOffset - SBitOffset > 64)
report_fatal_error("too big field size for llvm.bpf.preserve.field.info");
}
unsigned SBitOffset, NextSBitOffset;
- GetStorageBitRange(MemberTy, RecordAlignment, SBitOffset, NextSBitOffset);
+ GetStorageBitRange(MemberTy, *RecordAlignment, SBitOffset, NextSBitOffset);
if (NextSBitOffset - SBitOffset > 64)
report_fatal_error("too big field size for llvm.bpf.preserve.field.info");