@@ -67,6 +67,12 @@ static uint32_t getDeclAlignIfRequired(const Decl *D, const ASTContext &Ctx) {
6767 return D->hasAttr <AlignedAttr>() ? D->getMaxAlignment () : 0 ;
6868}
6969
70+ static bool getIsTransparentStepping (const Decl *D) {
71+ if (!D)
72+ return false ;
73+ return D->hasAttr <TransparentSteppingAttr>();
74+ }
75+
7076CGDebugInfo::CGDebugInfo (CodeGenModule &CGM)
7177 : CGM(CGM), DebugKind(CGM.getCodeGenOpts().getDebugInfo()),
7278 DebugTypeExtRefs(CGM.getCodeGenOpts().DebugTypeExtRefs),
@@ -1882,6 +1888,8 @@ llvm::DISubprogram *CGDebugInfo::CreateCXXMemberFunction(
18821888 SPFlags |= llvm::DISubprogram::SPFlagLocalToUnit;
18831889 if (CGM.getLangOpts ().Optimize )
18841890 SPFlags |= llvm::DISubprogram::SPFlagOptimized;
1891+ if (getIsTransparentStepping (Method))
1892+ SPFlags |= llvm::DISubprogram::SPFlagIsTransparentStepping;
18851893
18861894 // In this debug mode, emit type info for a class when its constructor type
18871895 // info is emitted.
@@ -3809,6 +3817,8 @@ llvm::DISubprogram *CGDebugInfo::getFunctionFwdDeclOrStub(GlobalDecl GD,
38093817 if (Stub) {
38103818 Flags |= getCallSiteRelatedAttrs ();
38113819 SPFlags |= llvm::DISubprogram::SPFlagDefinition;
3820+ if (getIsTransparentStepping (FD))
3821+ SPFlags |= llvm::DISubprogram::SPFlagIsTransparentStepping;
38123822 return DBuilder.createFunction (
38133823 DContext, Name, LinkageName, Unit, Line,
38143824 getOrCreateFunctionType (GD.getDecl (), FnType, Unit), 0 , Flags, SPFlags,
@@ -3958,6 +3968,8 @@ llvm::DISubprogram *CGDebugInfo::getObjCMethodDeclaration(
39583968 if (It == TypeCache.end ())
39593969 return nullptr ;
39603970 auto *InterfaceType = cast<llvm::DICompositeType>(It->second );
3971+ if (getIsTransparentStepping (D))
3972+ SPFlags |= llvm::DISubprogram::SPFlagIsTransparentStepping;
39613973 llvm::DISubprogram *FD = DBuilder.createFunction (
39623974 InterfaceType, getObjCMethodName (OMD), StringRef (),
39633975 InterfaceType->getFile (), LineNo, FnType, LineNo, Flags, SPFlags);
@@ -4124,6 +4136,8 @@ void CGDebugInfo::emitFunctionStart(GlobalDecl GD, SourceLocation Loc,
41244136 SPFlags |= llvm::DISubprogram::SPFlagLocalToUnit;
41254137 if (CGM.getLangOpts ().Optimize )
41264138 SPFlags |= llvm::DISubprogram::SPFlagOptimized;
4139+ if (getIsTransparentStepping (D))
4140+ SPFlags |= llvm::DISubprogram::SPFlagIsTransparentStepping;
41274141
41284142 llvm::DINode::DIFlags FlagsForDef = Flags | getCallSiteRelatedAttrs ();
41294143 llvm::DISubprogram::DISPFlags SPFlagsForDef =
@@ -4210,6 +4224,9 @@ void CGDebugInfo::EmitFunctionDecl(GlobalDecl GD, SourceLocation Loc,
42104224
42114225 llvm::DINodeArray Annotations = CollectBTFDeclTagAnnotations (D);
42124226 llvm::DISubroutineType *STy = getOrCreateFunctionType (D, FnType, Unit);
4227+ if (getIsTransparentStepping (D))
4228+ SPFlags |= llvm::DISubprogram::SPFlagIsTransparentStepping;
4229+
42134230 llvm::DISubprogram *SP = DBuilder.createFunction (
42144231 FDContext, Name, LinkageName, Unit, LineNo, STy, ScopeLine, Flags,
42154232 SPFlags, TParamsArray.get (), nullptr , nullptr , Annotations);
0 commit comments