diff options
author | Orlando Cazalet-Hyams <orlando.hyams@sony.com> | 2024-04-18 12:08:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-18 12:08:31 +0100 |
commit | 8d6a9c05f6d676c93c84ebf06cf6263657e74c00 (patch) | |
tree | 5c05aaba0b42913a5d8e12479236948593ccb2c4 /llvm/lib/IR/DIBuilder.cpp | |
parent | 3da065896b1b59fd8291958e8d13f4a942d51214 (diff) | |
download | llvm-8d6a9c05f6d676c93c84ebf06cf6263657e74c00.zip llvm-8d6a9c05f6d676c93c84ebf06cf6263657e74c00.tar.gz llvm-8d6a9c05f6d676c93c84ebf06cf6263657e74c00.tar.bz2 |
[DWARF] Add support for DW_TAG_template_alias for template aliases (#88943)
Part 1 of fix for issue
https://github.com/llvm/llvm-project/issues/54624
Split from PR #87623. Clang front end changes to follow.
Use DICompositeType to represent the template alias, using its extraData
field as a tuple of DITemplateParameter to describe the template
parameters.
Added template-alias.ll - Check DWARF emission.
Modified frame-types.s - Check llvm-symbolizer understands the DIE.
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r-- | llvm/lib/IR/DIBuilder.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index f86e557..f39149a 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -356,6 +356,17 @@ DIDerivedType *DIBuilder::createTypedef(DIType *Ty, StringRef Name, nullptr, Annotations); } +DIDerivedType * +DIBuilder::createTemplateAlias(DIType *Ty, StringRef Name, DIFile *File, + unsigned LineNo, DIScope *Context, + DINodeArray TParams, uint32_t AlignInBits, + DINode::DIFlags Flags, DINodeArray Annotations) { + return DIDerivedType::get(VMContext, dwarf::DW_TAG_template_alias, Name, File, + LineNo, getNonCompileUnitScope(Context), Ty, 0, + AlignInBits, 0, std::nullopt, std::nullopt, Flags, + TParams.get(), Annotations); +} + DIDerivedType *DIBuilder::createFriend(DIType *Ty, DIType *FriendTy) { assert(Ty && "Invalid type!"); assert(FriendTy && "Invalid friend type!"); |