Skip to content

Commit d998702

Browse files
committed
[AArch64][PAC][CodeGen] Fix incorrect emitting of DW_AT_LLVM_ptrauth_address_discriminated
The Dwarf attribute `DW_AT_LLVM_ptrauth_address_discriminated` was emitted for all ptrauth-qualified types, even if the address discrimination was disabled. This was related to incorrect usage of `std::optional<bool>` holding the value of the attribute.
1 parent 62ce88f commit d998702

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, const DIDerivedType *DTy) {
805805
if (auto Key = DTy->getPtrAuthKey())
806806
addUInt(Buffer, dwarf::DW_AT_LLVM_ptrauth_key, dwarf::DW_FORM_data1, *Key);
807807
if (auto AddrDisc = DTy->isPtrAuthAddressDiscriminated())
808-
if (AddrDisc)
808+
if (AddrDisc.value())
809809
addFlag(Buffer, dwarf::DW_AT_LLVM_ptrauth_address_discriminated);
810810
if (auto Disc = DTy->getPtrAuthExtraDiscriminator())
811811
addUInt(Buffer, dwarf::DW_AT_LLVM_ptrauth_extra_discriminator,

0 commit comments

Comments
 (0)