@@ -2016,29 +2016,20 @@ llvm::DISubroutineType *CGDebugInfo::getOrCreateInstanceMethodType(
20162016 // First element is always return type. For 'void' functions it is NULL.
20172017 Elts.push_back (Args[0 ]);
20182018
2019- const bool HasExplicitObjectParameter = ThisPtr.isNull ();
2020-
2021- // "this" pointer is always first argument. For explicit "this"
2022- // parameters, it will already be in Args[1].
2023- if (!HasExplicitObjectParameter) {
2019+ // "this" pointer is always first argument.
2020+ // ThisPtr may be null if the member function has an explicit 'this'
2021+ // parameter.
2022+ if (!ThisPtr.isNull ()) {
20242023 llvm::DIType *ThisPtrType = getOrCreateType (ThisPtr, Unit);
20252024 TypeCache[ThisPtr.getAsOpaquePtr ()].reset (ThisPtrType);
2026- ThisPtrType =
2027- DBuilder.createObjectPointerType (ThisPtrType, /* Implicit=*/ true );
2025+ ThisPtrType = DBuilder.createObjectPointerType (ThisPtrType);
20282026 Elts.push_back (ThisPtrType);
20292027 }
20302028
20312029 // Copy rest of the arguments.
20322030 for (unsigned i = 1 , e = Args.size (); i != e; ++i)
20332031 Elts.push_back (Args[i]);
20342032
2035- // Attach FlagObjectPointer to the explicit "this" parameter.
2036- if (HasExplicitObjectParameter) {
2037- assert (Elts.size () >= 2 && Args.size () >= 2 &&
2038- " Expected at least return type and object parameter." );
2039- Elts[1 ] = DBuilder.createObjectPointerType (Args[1 ], /* Implicit=*/ false );
2040- }
2041-
20422033 llvm::DITypeRefArray EltTypeArray = DBuilder.getOrCreateTypeArray (Elts);
20432034
20442035 return DBuilder.createSubroutineType (EltTypeArray, OriginalFunc->getFlags (),
@@ -5127,7 +5118,7 @@ llvm::DIType *CGDebugInfo::CreateSelfType(const QualType &QualTy,
51275118 llvm::DIType *CachedTy = getTypeOrNull (QualTy);
51285119 if (CachedTy)
51295120 Ty = CachedTy;
5130- return DBuilder.createObjectPointerType (Ty, /* Implicit= */ true );
5121+ return DBuilder.createObjectPointerType (Ty);
51315122}
51325123
51335124void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable (
0 commit comments