diff options
author | joaosaffran <126493771+joaosaffran@users.noreply.github.com> | 2024-12-17 11:10:05 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-17 11:10:05 -0800 |
commit | 56cb55429199435a78f6e836f52cf41577406e90 (patch) | |
tree | 333664a0017b4d534006ef74e7d8d722d166a6ef /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | ad32576cffc88bf7c359a528afbed7c2ae7ddb2d (diff) | |
download | llvm-56cb55429199435a78f6e836f52cf41577406e90.zip llvm-56cb55429199435a78f6e836f52cf41577406e90.tar.gz llvm-56cb55429199435a78f6e836f52cf41577406e90.tar.bz2 |
[NFC] Updating Debug Info generation for 'this' (#119445)
This is PR is updating the debug info generation for `this`. This is
required to fix the generation of debug information for HLSL RWBuffer
type. This was required from another PR:
https://github.com/llvm/llvm-project/pull/119041/files
Co-authored-by: Joao Saffran <jderezende@microsoft.com>
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index ff27690..f29ddec 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -2021,28 +2021,10 @@ llvm::DISubroutineType *CGDebugInfo::getOrCreateInstanceMethodType( // ThisPtr may be null if the member function has an explicit 'this' // parameter. if (!ThisPtr.isNull()) { - const CXXRecordDecl *RD = ThisPtr->getPointeeCXXRecordDecl(); - if (isa<ClassTemplateSpecializationDecl>(RD)) { - // Create pointer type directly in this case. - const PointerType *ThisPtrTy = cast<PointerType>(ThisPtr); - uint64_t Size = CGM.getContext().getTypeSize(ThisPtrTy); - auto Align = getTypeAlignIfRequired(ThisPtrTy, CGM.getContext()); - llvm::DIType *PointeeType = - getOrCreateType(ThisPtrTy->getPointeeType(), Unit); - llvm::DIType *ThisPtrType = - DBuilder.createPointerType(PointeeType, Size, Align); - TypeCache[ThisPtr.getAsOpaquePtr()].reset(ThisPtrType); - // TODO: This and the artificial type below are misleading, the - // types aren't artificial the argument is, but the current - // metadata doesn't represent that. - ThisPtrType = DBuilder.createObjectPointerType(ThisPtrType); - Elts.push_back(ThisPtrType); - } else { - llvm::DIType *ThisPtrType = getOrCreateType(ThisPtr, Unit); - TypeCache[ThisPtr.getAsOpaquePtr()].reset(ThisPtrType); - ThisPtrType = DBuilder.createObjectPointerType(ThisPtrType); - Elts.push_back(ThisPtrType); - } + llvm::DIType *ThisPtrType = getOrCreateType(ThisPtr, Unit); + TypeCache[ThisPtr.getAsOpaquePtr()].reset(ThisPtrType); + ThisPtrType = DBuilder.createObjectPointerType(ThisPtrType); + Elts.push_back(ThisPtrType); } // Copy rest of the arguments. |