@@ -2018,17 +2018,8 @@ CGDebugInfo::getOrCreateMethodType(const CXXMethodDecl *Method,
20182018 return getOrCreateInstanceMethodType (ThisType, Func, Unit);
20192019}
20202020
2021- llvm::DISubroutineType *CGDebugInfo::getOrCreateMethodTypeForDestructor (
2022- const CXXMethodDecl *Method, llvm::DIFile *Unit, QualType FNType) {
2023- const FunctionProtoType *Func = FNType->getAs <FunctionProtoType>();
2024- // skip the first param since it is also this
2025- return getOrCreateInstanceMethodType (Method->getThisType (), Func, Unit, true );
2026- }
2027-
2028- llvm::DISubroutineType *
2029- CGDebugInfo::getOrCreateInstanceMethodType (QualType ThisPtr,
2030- const FunctionProtoType *Func,
2031- llvm::DIFile *Unit, bool SkipFirst) {
2021+ llvm::DISubroutineType *CGDebugInfo::getOrCreateInstanceMethodType (
2022+ QualType ThisPtr, const FunctionProtoType *Func, llvm::DIFile *Unit) {
20322023 FunctionProtoType::ExtProtoInfo EPI = Func->getExtProtoInfo ();
20332024 Qualifiers &Qc = EPI.TypeQuals ;
20342025 Qc.removeConst ();
@@ -2068,7 +2059,7 @@ CGDebugInfo::getOrCreateInstanceMethodType(QualType ThisPtr,
20682059 }
20692060
20702061 // Copy rest of the arguments.
2071- for (unsigned i = (SkipFirst ? 2 : 1 ) , e = Args.size (); i != e; ++i)
2062+ for (unsigned i = 1 , e = Args.size (); i != e; ++i)
20722063 Elts.push_back (Args[i]);
20732064
20742065 // Attach FlagObjectPointer to the explicit "this" parameter.
@@ -4381,12 +4372,6 @@ llvm::DISubroutineType *CGDebugInfo::getOrCreateFunctionType(const Decl *D,
43814372 // subprogram DIE will miss DW_AT_decl_file and DW_AT_decl_line fields.
43824373 return DBuilder.createSubroutineType (DBuilder.getOrCreateTypeArray ({}));
43834374
4384- if (const auto *Method = dyn_cast<CXXDestructorDecl>(D)) {
4385- // Read method type from 'FnType' because 'D.getType()' does not cover
4386- // implicit arguments for destructors.
4387- return getOrCreateMethodTypeForDestructor (Method, F, FnType);
4388- }
4389-
43904375 if (const auto *Method = dyn_cast<CXXMethodDecl>(D))
43914376 return getOrCreateMethodType (Method, F);
43924377
0 commit comments