[Mlir-commits] [llvm] [mlir] [Dwarf] Support `__ptrauth` qualifier in metadata nodes (PR #83862)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Mar 4 08:31:29 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-llvm
Author: Daniil Kovalev (kovdan01)
<details>
<summary>Changes</summary>
Reland #<!-- -->82363 after fixing build failure https://lab.llvm.org/buildbot/#/builders/5/builds/41428.
Memory sanitizer detects usage of `RawData` union member which is not
filled directly. Instead, the code relies on filling `Data` union
member, which is a struct consisting of signing schema parameters.
According to https://en.cppreference.com/w/cpp/language/union, this is UB:
"It is undefined behavior to read from the member of the union that
wasn't most recently written".
Instead of relying on compiler allowing us to do dirty things, do not
use union and only store `RawData`. Particular ptrauth parameters are
obtained on demand via bit operations.
Original PR description below.
Emit `__ptrauth`-qualified types as `DIDerivedType` metadata nodes in IR with tag `DW_TAG_LLVM_ptrauth_type`, baseType referring to the type which has the qualifier applied, and the following parameters representing the signing schema:
- `ptrAuthKey` (integer)
- `ptrAuthIsAddressDiscriminated` (boolean)
- `ptrAuthExtraDiscriminator` (integer)
- `ptrAuthIsaPointer` (boolean)
- `ptrAuthAuthenticatesNullValues` (boolean)
Co-authored-by: Ahmed Bougacha <ahmed@<!-- -->bougacha.org>
---
Patch is 50.44 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/83862.diff
16 Files Affected:
- (modified) llvm/include/llvm/IR/DIBuilder.h (+7)
- (modified) llvm/include/llvm/IR/DebugInfoMetadata.h (+96-23)
- (modified) llvm/lib/AsmParser/LLParser.cpp (+19-4)
- (modified) llvm/lib/Bitcode/Reader/MetadataLoader.cpp (+14-4)
- (modified) llvm/lib/Bitcode/Writer/BitcodeWriter.cpp (+5)
- (modified) llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (+14)
- (modified) llvm/lib/IR/AsmWriter.cpp (+11)
- (modified) llvm/lib/IR/DIBuilder.cpp (+37-21)
- (modified) llvm/lib/IR/DebugInfo.cpp (+3-3)
- (modified) llvm/lib/IR/DebugInfoMetadata.cpp (+21-11)
- (modified) llvm/lib/IR/LLVMContextImpl.h (+10-5)
- (modified) llvm/lib/IR/Verifier.cpp (+1)
- (modified) llvm/test/Assembler/debug-info.ll (+14-2)
- (added) llvm/test/DebugInfo/AArch64/ptrauth.ll (+70)
- (modified) llvm/unittests/IR/MetadataTest.cpp (+59-26)
- (modified) mlir/lib/Target/LLVMIR/DebugTranslation.cpp (+2-1)
``````````diff
diff --git a/llvm/include/llvm/IR/DIBuilder.h b/llvm/include/llvm/IR/DIBuilder.h
index edec161b397155..010dcbfdadcac2 100644
--- a/llvm/include/llvm/IR/DIBuilder.h
+++ b/llvm/include/llvm/IR/DIBuilder.h
@@ -262,6 +262,13 @@ namespace llvm {
std::optional<unsigned> DWARFAddressSpace = std::nullopt,
StringRef Name = "", DINodeArray Annotations = nullptr);
+ /// Create a __ptrauth qualifier.
+ DIDerivedType *createPtrAuthQualifiedType(DIType *FromTy, unsigned Key,
+ bool IsAddressDiscriminated,
+ unsigned ExtraDiscriminator,
+ bool IsaPointer,
+ bool authenticatesNullValues);
+
/// Create debugging information entry for a pointer to member.
/// \param PointeeTy Type pointed to by this pointer.
/// \param SizeInBits Size.
diff --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h
index 156f6eb49253de..00c39693ed9fbf 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -745,7 +745,7 @@ class DIType : public DIScope {
unsigned getLine() const { return Line; }
uint64_t getSizeInBits() const { return SizeInBits; }
- uint32_t getAlignInBits() const { return SubclassData32; }
+ uint32_t getAlignInBits() const;
uint32_t getAlignInBytes() const { return getAlignInBits() / CHAR_BIT; }
uint64_t getOffsetInBits() const { return OffsetInBits; }
DIFlags getFlags() const { return Flags; }
@@ -972,6 +972,35 @@ class DIStringType : public DIType {
///
/// TODO: Split out members (inheritance, fields, methods, etc.).
class DIDerivedType : public DIType {
+public:
+ /// Pointer authentication (__ptrauth) metadata.
+ struct PtrAuthData {
+ unsigned RawData;
+
+ PtrAuthData(unsigned FromRawData) : RawData(FromRawData) {}
+ PtrAuthData(unsigned Key, bool IsDiscr, unsigned Discriminator,
+ bool IsaPointer, bool AuthenticatesNullValues) {
+ assert(Key < 16);
+ assert(Discriminator <= 0xffff);
+ RawData = (Key << 0) | (IsDiscr ? (1 << 4) : 0) | (Discriminator << 5) |
+ (IsaPointer ? (1 << 21) : 0) |
+ (AuthenticatesNullValues ? (1 << 22) : 0);
+ }
+ bool operator==(struct PtrAuthData Other) const {
+ return RawData == Other.RawData;
+ }
+ bool operator!=(struct PtrAuthData Other) const {
+ return !(*this == Other);
+ }
+
+ unsigned Key() { return (RawData >> 0) & 0b1111; }
+ bool IsAddressDiscriminated() { return (RawData >> 4) & 1; }
+ unsigned ExtraDiscriminator() { return (RawData >> 5) & 0xffff; }
+ bool IsaPointer() { return (RawData >> 21) & 1; }
+ bool AuthenticatesNullValues() { return (RawData >> 22) & 1; }
+ };
+
+private:
friend class LLVMContextImpl;
friend class MDNode;
@@ -982,59 +1011,70 @@ class DIDerivedType : public DIType {
DIDerivedType(LLVMContext &C, StorageType Storage, unsigned Tag,
unsigned Line, uint64_t SizeInBits, uint32_t AlignInBits,
uint64_t OffsetInBits,
- std::optional<unsigned> DWARFAddressSpace, DIFlags Flags,
+ std::optional<unsigned> DWARFAddressSpace,
+ std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
ArrayRef<Metadata *> Ops)
: DIType(C, DIDerivedTypeKind, Storage, Tag, Line, SizeInBits,
AlignInBits, OffsetInBits, Flags, Ops),
- DWARFAddressSpace(DWARFAddressSpace) {}
+ DWARFAddressSpace(DWARFAddressSpace) {
+ if (PtrAuthData)
+ SubclassData32 = PtrAuthData->RawData;
+ }
~DIDerivedType() = default;
static DIDerivedType *
getImpl(LLVMContext &Context, unsigned Tag, StringRef Name, DIFile *File,
unsigned Line, DIScope *Scope, DIType *BaseType, uint64_t SizeInBits,
uint32_t AlignInBits, uint64_t OffsetInBits,
- std::optional<unsigned> DWARFAddressSpace, DIFlags Flags,
+ std::optional<unsigned> DWARFAddressSpace,
+ std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
Metadata *ExtraData, DINodeArray Annotations, StorageType Storage,
bool ShouldCreate = true) {
return getImpl(Context, Tag, getCanonicalMDString(Context, Name), File,
Line, Scope, BaseType, SizeInBits, AlignInBits, OffsetInBits,
- DWARFAddressSpace, Flags, ExtraData, Annotations.get(),
- Storage, ShouldCreate);
+ DWARFAddressSpace, PtrAuthData, Flags, ExtraData,
+ Annotations.get(), Storage, ShouldCreate);
}
static DIDerivedType *
getImpl(LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
unsigned Line, Metadata *Scope, Metadata *BaseType,
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
- std::optional<unsigned> DWARFAddressSpace, DIFlags Flags,
+ std::optional<unsigned> DWARFAddressSpace,
+ std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
Metadata *ExtraData, Metadata *Annotations, StorageType Storage,
bool ShouldCreate = true);
TempDIDerivedType cloneImpl() const {
- return getTemporary(
- getContext(), getTag(), getName(), getFile(), getLine(), getScope(),
- getBaseType(), getSizeInBits(), getAlignInBits(), getOffsetInBits(),
- getDWARFAddressSpace(), getFlags(), getExtraData(), getAnnotations());
+ return getTemporary(getContext(), getTag(), getName(), getFile(), getLine(),
+ getScope(), getBaseType(), getSizeInBits(),
+ getAlignInBits(), getOffsetInBits(),
+ getDWARFAddressSpace(), getPtrAuthData(), getFlags(),
+ getExtraData(), getAnnotations());
}
public:
- DEFINE_MDNODE_GET(
- DIDerivedType,
- (unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
- Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
- uint32_t AlignInBits, uint64_t OffsetInBits,
- std::optional<unsigned> DWARFAddressSpace, DIFlags Flags,
- Metadata *ExtraData = nullptr, Metadata *Annotations = nullptr),
- (Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
- OffsetInBits, DWARFAddressSpace, Flags, ExtraData, Annotations))
+ DEFINE_MDNODE_GET(DIDerivedType,
+ (unsigned Tag, MDString *Name, Metadata *File,
+ unsigned Line, Metadata *Scope, Metadata *BaseType,
+ uint64_t SizeInBits, uint32_t AlignInBits,
+ uint64_t OffsetInBits,
+ std::optional<unsigned> DWARFAddressSpace,
+ std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
+ Metadata *ExtraData = nullptr,
+ Metadata *Annotations = nullptr),
+ (Tag, Name, File, Line, Scope, BaseType, SizeInBits,
+ AlignInBits, OffsetInBits, DWARFAddressSpace, PtrAuthData,
+ Flags, ExtraData, Annotations))
DEFINE_MDNODE_GET(DIDerivedType,
(unsigned Tag, StringRef Name, DIFile *File, unsigned Line,
DIScope *Scope, DIType *BaseType, uint64_t SizeInBits,
uint32_t AlignInBits, uint64_t OffsetInBits,
- std::optional<unsigned> DWARFAddressSpace, DIFlags Flags,
+ std::optional<unsigned> DWARFAddressSpace,
+ std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
Metadata *ExtraData = nullptr,
DINodeArray Annotations = nullptr),
(Tag, Name, File, Line, Scope, BaseType, SizeInBits,
- AlignInBits, OffsetInBits, DWARFAddressSpace, Flags,
- ExtraData, Annotations))
+ AlignInBits, OffsetInBits, DWARFAddressSpace, PtrAuthData,
+ Flags, ExtraData, Annotations))
TempDIDerivedType clone() const { return cloneImpl(); }
@@ -1048,6 +1088,39 @@ class DIDerivedType : public DIType {
return DWARFAddressSpace;
}
+ std::optional<PtrAuthData> getPtrAuthData() const;
+
+ /// \returns The PointerAuth key.
+ std::optional<unsigned> getPtrAuthKey() const {
+ if (auto PtrAuthData = getPtrAuthData())
+ return PtrAuthData->Key();
+ return std::nullopt;
+ }
+ /// \returns The PointerAuth address discrimination bit.
+ std::optional<bool> isPtrAuthAddressDiscriminated() const {
+ if (auto PtrAuthData = getPtrAuthData())
+ return PtrAuthData->IsAddressDiscriminated();
+ return std::nullopt;
+ }
+ /// \returns The PointerAuth extra discriminator.
+ std::optional<unsigned> getPtrAuthExtraDiscriminator() const {
+ if (auto PtrAuthData = getPtrAuthData())
+ return PtrAuthData->ExtraDiscriminator();
+ return std::nullopt;
+ }
+ /// \returns The PointerAuth IsaPointer bit.
+ std::optional<bool> isPtrAuthIsaPointer() const {
+ if (auto PtrAuthData = getPtrAuthData())
+ return PtrAuthData->IsaPointer();
+ return std::nullopt;
+ }
+ /// \returns The PointerAuth authenticates null values bit.
+ std::optional<bool> getPtrAuthAuthenticatesNullValues() const {
+ if (auto PtrAuthData = getPtrAuthData())
+ return PtrAuthData->AuthenticatesNullValues();
+ return std::nullopt;
+ }
+
/// Get extra data associated with this derived type.
///
/// Class type for pointer-to-members, objective-c property node for ivars,
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index a91e2f690999e0..e91abaf0780a3d 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -5130,7 +5130,11 @@ bool LLParser::parseDIStringType(MDNode *&Result, bool IsDistinct) {
/// ::= !DIDerivedType(tag: DW_TAG_pointer_type, name: "int", file: !0,
/// line: 7, scope: !1, baseType: !2, size: 32,
/// align: 32, offset: 0, flags: 0, extraData: !3,
-/// dwarfAddressSpace: 3)
+/// dwarfAddressSpace: 3, ptrAuthKey: 1,
+/// ptrAuthIsAddressDiscriminated: true,
+/// ptrAuthExtraDiscriminator: 0x1234,
+/// ptrAuthIsaPointer: 1, ptrAuthAuthenticatesNullValues:1
+/// )
bool LLParser::parseDIDerivedType(MDNode *&Result, bool IsDistinct) {
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
REQUIRED(tag, DwarfTagField, ); \
@@ -5145,19 +5149,30 @@ bool LLParser::parseDIDerivedType(MDNode *&Result, bool IsDistinct) {
OPTIONAL(flags, DIFlagField, ); \
OPTIONAL(extraData, MDField, ); \
OPTIONAL(dwarfAddressSpace, MDUnsignedField, (UINT32_MAX, UINT32_MAX)); \
- OPTIONAL(annotations, MDField, );
+ OPTIONAL(annotations, MDField, ); \
+ OPTIONAL(ptrAuthKey, MDUnsignedField, (0, 7)); \
+ OPTIONAL(ptrAuthIsAddressDiscriminated, MDBoolField, ); \
+ OPTIONAL(ptrAuthExtraDiscriminator, MDUnsignedField, (0, 0xffff)); \
+ OPTIONAL(ptrAuthIsaPointer, MDBoolField, ); \
+ OPTIONAL(ptrAuthAuthenticatesNullValues, MDBoolField, );
PARSE_MD_FIELDS();
#undef VISIT_MD_FIELDS
std::optional<unsigned> DWARFAddressSpace;
if (dwarfAddressSpace.Val != UINT32_MAX)
DWARFAddressSpace = dwarfAddressSpace.Val;
+ std::optional<DIDerivedType::PtrAuthData> PtrAuthData;
+ if (ptrAuthKey.Val)
+ PtrAuthData = DIDerivedType::PtrAuthData(
+ (unsigned)ptrAuthKey.Val, ptrAuthIsAddressDiscriminated.Val,
+ (unsigned)ptrAuthExtraDiscriminator.Val, ptrAuthIsaPointer.Val,
+ ptrAuthAuthenticatesNullValues.Val);
Result = GET_OR_DISTINCT(DIDerivedType,
(Context, tag.Val, name.Val, file.Val, line.Val,
scope.Val, baseType.Val, size.Val, align.Val,
- offset.Val, DWARFAddressSpace, flags.Val,
- extraData.Val, annotations.Val));
+ offset.Val, DWARFAddressSpace, PtrAuthData,
+ flags.Val, extraData.Val, annotations.Val));
return false;
}
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
index 770eb83af17f9b..bdc2db82dfbe0e 100644
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -1556,7 +1556,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
break;
}
case bitc::METADATA_DERIVED_TYPE: {
- if (Record.size() < 12 || Record.size() > 14)
+ if (Record.size() < 12 || Record.size() > 15)
return error("Invalid record");
// DWARF address space is encoded as N->getDWARFAddressSpace() + 1. 0 means
@@ -1566,8 +1566,18 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
DWARFAddressSpace = Record[12] - 1;
Metadata *Annotations = nullptr;
- if (Record.size() > 13 && Record[13])
- Annotations = getMDOrNull(Record[13]);
+ std::optional<DIDerivedType::PtrAuthData> PtrAuthData;
+
+ // Only look for annotations/ptrauth if both are allocated.
+ // If not, we can't tell which was intended to be embedded, as both ptrauth
+ // and annotations have been expected at Record[13] at various times.
+ if (Record.size() > 14) {
+ if (Record[13])
+ Annotations = getMDOrNull(Record[13]);
+
+ if (Record[14])
+ PtrAuthData = DIDerivedType::PtrAuthData(Record[14]);
+ }
IsDistinct = Record[0];
DINode::DIFlags Flags = static_cast<DINode::DIFlags>(Record[10]);
@@ -1577,7 +1587,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
getMDOrNull(Record[3]), Record[4],
getDITypeRefOrNull(Record[5]),
getDITypeRefOrNull(Record[6]), Record[7], Record[8],
- Record[9], DWARFAddressSpace, Flags,
+ Record[9], DWARFAddressSpace, PtrAuthData, Flags,
getDITypeRefOrNull(Record[11]), Annotations)),
NextMetadataNo);
NextMetadataNo++;
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 13be0b0c3307fb..b21424b854b3e9 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1804,6 +1804,11 @@ void ModuleBitcodeWriter::writeDIDerivedType(const DIDerivedType *N,
Record.push_back(VE.getMetadataOrNullID(N->getAnnotations().get()));
+ if (auto PtrAuthData = N->getPtrAuthData())
+ Record.push_back(PtrAuthData->RawData);
+ else
+ Record.push_back(0);
+
Stream.EmitRecord(bitc::METADATA_DERIVED_TYPE, Record, Abbrev);
Record.clear();
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index d462859e489465..ae0226934804f7 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -803,6 +803,20 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, const DIDerivedType *DTy) {
if (DTy->getDWARFAddressSpace())
addUInt(Buffer, dwarf::DW_AT_address_class, dwarf::DW_FORM_data4,
*DTy->getDWARFAddressSpace());
+ if (auto Key = DTy->getPtrAuthKey())
+ addUInt(Buffer, dwarf::DW_AT_LLVM_ptrauth_key, dwarf::DW_FORM_data1, *Key);
+ if (auto AddrDisc = DTy->isPtrAuthAddressDiscriminated())
+ if (AddrDisc.value())
+ addFlag(Buffer, dwarf::DW_AT_LLVM_ptrauth_address_discriminated);
+ if (auto Disc = DTy->getPtrAuthExtraDiscriminator())
+ addUInt(Buffer, dwarf::DW_AT_LLVM_ptrauth_extra_discriminator,
+ dwarf::DW_FORM_data2, *Disc);
+ if (auto IsaPointer = DTy->isPtrAuthIsaPointer())
+ if (*IsaPointer)
+ addFlag(Buffer, dwarf::DW_AT_LLVM_ptrauth_isa_pointer);
+ if (auto AuthenticatesNullValues = DTy->getPtrAuthAuthenticatesNullValues())
+ if (*AuthenticatesNullValues)
+ addFlag(Buffer, dwarf::DW_AT_LLVM_ptrauth_authenticates_null_values);
}
void DwarfUnit::constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args) {
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 251485a403fee6..3949aadaf564b7 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -2107,6 +2107,17 @@ static void writeDIDerivedType(raw_ostream &Out, const DIDerivedType *N,
Printer.printInt("dwarfAddressSpace", *DWARFAddressSpace,
/* ShouldSkipZero */ false);
Printer.printMetadata("annotations", N->getRawAnnotations());
+ if (auto Key = N->getPtrAuthKey())
+ Printer.printInt("ptrAuthKey", *Key);
+ if (auto AddrDisc = N->isPtrAuthAddressDiscriminated())
+ Printer.printBool("ptrAuthIsAddressDiscriminated", *AddrDisc);
+ if (auto Disc = N->getPtrAuthExtraDiscriminator())
+ Printer.printInt("ptrAuthExtraDiscriminator", *Disc);
+ if (auto IsaPointer = N->isPtrAuthIsaPointer())
+ Printer.printBool("ptrAuthIsaPointer", *IsaPointer);
+ if (auto AuthenticatesNullValues = N->getPtrAuthAuthenticatesNullValues())
+ Printer.printBool("ptrAuthAuthenticatesNullValues",
+ *AuthenticatesNullValues);
Out << ")";
}
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index 62efaba025344b..2842cb15e78fb3 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -296,7 +296,20 @@ DIStringType *DIBuilder::createStringType(StringRef Name,
DIDerivedType *DIBuilder::createQualifiedType(unsigned Tag, DIType *FromTy) {
return DIDerivedType::get(VMContext, Tag, "", nullptr, 0, nullptr, FromTy, 0,
- 0, 0, std::nullopt, DINode::FlagZero);
+ 0, 0, std::nullopt, std::nullopt, DINode::FlagZero);
+}
+
+DIDerivedType *DIBuilder::createPtrAuthQualifiedType(
+ DIType *FromTy, unsigned Key, bool IsAddressDiscriminated,
+ unsigned ExtraDiscriminator, bool IsaPointer,
+ bool AuthenticatesNullValues) {
+ return DIDerivedType::get(
+ VMContext, dwarf::DW_TAG_LLVM_ptrauth_type, "", nullptr, 0, nullptr,
+ FromTy, 0, 0, 0, std::nullopt,
+ std::optional<DIDerivedType::PtrAuthData>({Key, IsAddressDiscriminated,
+ ExtraDiscriminator, IsaPointer,
+ AuthenticatesNullValues}),
+ DINode::FlagZero);
}
DIDerivedType *
@@ -307,8 +320,8 @@ DIBuilder::createPointerType(DIType *PointeeTy, uint64_t SizeInBits,
// FIXME: Why is there a name here?
return DIDerivedType::get(VMContext, dwarf::DW_TAG_pointer_type, Name,
nullptr, 0, nullptr, PointeeTy, SizeInBits,
- AlignInBits, 0, DWARFAddressSpace, DINode::FlagZero,
- nullptr, Annotations);
+ AlignInBits, 0, DWARFAddressSpace, std::nullopt,
+ DINode::FlagZero, nullptr, Annotations);
}
DIDerivedType *DIBuilder::createMemberPointerType(DIType *PointeeTy,
@@ -318,7 +331,8 @@ DIDerivedType *DIBuilder::createMemberPointerType(DIType *PointeeTy,
DINode::DIFlags Flags) {
return DIDerivedType::get(VMContext, dwarf::DW_TAG_ptr_to_member_type, "",
nullptr, 0, nullptr, PointeeTy, SizeInBits,
- AlignInBits, 0, std::nullopt, Flags, Base);
+ AlignInBits, 0, std::nullopt, std::nullopt, Flags,
+ Base);
}
DIDerivedType *
@@ -327,7 +341,7 @@ DIBuilder::createReferenceType(unsigned Tag, DIType *RTy, uint64_t SizeInBits,
std::optional<unsigned> DWARFAddressSpace) {
assert(RTy && "Unable to create reference type");
return DIDerivedType::get(VMContext, Tag, "", nullptr, 0, nullptr, RTy,
- SizeInBits, AlignInBits, 0, DWARFAddressSpace,
+ SizeInBi...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/83862
More information about the Mlir-commits
mailing list