@@ -2021,28 +2021,10 @@ llvm::DISubroutineType *CGDebugInfo::getOrCreateInstanceMethodType(
20212021 // ThisPtr may be null if the member function has an explicit 'this'
20222022 // parameter.
20232023 if (!ThisPtr.isNull ()) {
2024- const CXXRecordDecl *RD = ThisPtr->getPointeeCXXRecordDecl ();
2025- if (isa<ClassTemplateSpecializationDecl>(RD)) {
2026- // Create pointer type directly in this case.
2027- const PointerType *ThisPtrTy = cast<PointerType>(ThisPtr);
2028- uint64_t Size = CGM.getContext ().getTypeSize (ThisPtrTy);
2029- auto Align = getTypeAlignIfRequired (ThisPtrTy, CGM.getContext ());
2030- llvm::DIType *PointeeType =
2031- getOrCreateType (ThisPtrTy->getPointeeType (), Unit);
2032- llvm::DIType *ThisPtrType =
2033- DBuilder.createPointerType (PointeeType, Size, Align);
2034- TypeCache[ThisPtr.getAsOpaquePtr ()].reset (ThisPtrType);
2035- // TODO: This and the artificial type below are misleading, the
2036- // types aren't artificial the argument is, but the current
2037- // metadata doesn't represent that.
2038- ThisPtrType = DBuilder.createObjectPointerType (ThisPtrType);
2039- Elts.push_back (ThisPtrType);
2040- } else {
2041- llvm::DIType *ThisPtrType = getOrCreateType (ThisPtr, Unit);
2042- TypeCache[ThisPtr.getAsOpaquePtr ()].reset (ThisPtrType);
2043- ThisPtrType = DBuilder.createObjectPointerType (ThisPtrType);
2044- Elts.push_back (ThisPtrType);
2045- }
2024+ llvm::DIType *ThisPtrType = getOrCreateType (ThisPtr, Unit);
2025+ TypeCache[ThisPtr.getAsOpaquePtr ()].reset (ThisPtrType);
2026+ ThisPtrType = DBuilder.createObjectPointerType (ThisPtrType);
2027+ Elts.push_back (ThisPtrType);
20462028 }
20472029
20482030 // Copy rest of the arguments.
0 commit comments