@@ -2067,29 +2067,20 @@ llvm::DISubroutineType *CGDebugInfo::getOrCreateInstanceMethodType(
20672067 // First element is always return type. For 'void' functions it is NULL.
20682068 Elts.push_back (Args[0 ]);
20692069
2070- const bool HasExplicitObjectParameter = ThisPtr.isNull ();
2071-
2072- // "this" pointer is always first argument. For explicit "this"
2073- // parameters, it will already be in Args[1].
2074- if (!HasExplicitObjectParameter) {
2070+ // "this" pointer is always first argument.
2071+ // ThisPtr may be null if the member function has an explicit 'this'
2072+ // parameter.
2073+ if (!ThisPtr.isNull ()) {
20752074 llvm::DIType *ThisPtrType = getOrCreateType (ThisPtr, Unit);
20762075 TypeCache[ThisPtr.getAsOpaquePtr ()].reset (ThisPtrType);
2077- ThisPtrType =
2078- DBuilder.createObjectPointerType (ThisPtrType, /* Implicit=*/ true );
2076+ ThisPtrType = DBuilder.createObjectPointerType (ThisPtrType);
20792077 Elts.push_back (ThisPtrType);
20802078 }
20812079
20822080 // Copy rest of the arguments.
20832081 for (unsigned i = 1 , e = Args.size (); i != e; ++i)
20842082 Elts.push_back (Args[i]);
20852083
2086- // Attach FlagObjectPointer to the explicit "this" parameter.
2087- if (HasExplicitObjectParameter) {
2088- assert (Elts.size () >= 2 && Args.size () >= 2 &&
2089- " Expected at least return type and object parameter." );
2090- Elts[1 ] = DBuilder.createObjectPointerType (Args[1 ], /* Implicit=*/ false );
2091- }
2092-
20932084 llvm::DITypeRefArray EltTypeArray = DBuilder.getOrCreateTypeArray (Elts);
20942085
20952086 return DBuilder.createSubroutineType (EltTypeArray, OriginalFunc->getFlags (),
@@ -5508,7 +5499,7 @@ llvm::DIType *CGDebugInfo::CreateSelfType(const QualType &QualTy,
55085499 llvm::DIType *CachedTy = getTypeOrNull (QualTy);
55095500 if (CachedTy)
55105501 Ty = CachedTy;
5511- return DBuilder.createObjectPointerType (Ty, /* Implicit= */ true );
5502+ return DBuilder.createObjectPointerType (Ty);
55125503}
55135504
55145505void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable (
0 commit comments