@@ -243,6 +243,8 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
243243 Optional<SILLocation> Loc);
244244 void emitTypeMetadata (IRGenFunction &IGF, llvm::Value *Metadata,
245245 unsigned Depth, unsigned Index, StringRef Name);
246+ void emitPackCountParameter (IRGenFunction &IGF, llvm::Value *Metadata,
247+ SILDebugVariable VarInfo);
246248
247249 // / Return the DIBuilder.
248250 llvm::DIBuilder &getBuilder () { return DBuilder; }
@@ -1528,11 +1530,16 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
15281530 File, FwdDeclLine, Flags, MangledName);
15291531 }
15301532
1531- case TypeKind::SILPack:
15321533 case TypeKind::Pack:
1533- case TypeKind::PackExpansion:
15341534 llvm_unreachable (" Unimplemented!" );
15351535
1536+ case TypeKind::SILPack:
1537+ case TypeKind::PackExpansion:
1538+ // assert(SizeInBits == CI.getTargetInfo().getPointerWidth(0));
1539+ return createPointerSizedStruct (Scope,
1540+ MangledName,
1541+ MainFile, 0 , Flags, MangledName);
1542+
15361543 case TypeKind::BuiltinTuple:
15371544 llvm_unreachable (" BuiltinTupleType should not show up here" );
15381545
@@ -2977,6 +2984,25 @@ void IRGenDebugInfoImpl::emitTypeMetadata(IRGenFunction &IGF,
29772984 ArtificialValue);
29782985}
29792986
2987+ void IRGenDebugInfoImpl::emitPackCountParameter (IRGenFunction &IGF,
2988+ llvm::Value *Metadata,
2989+ SILDebugVariable VarInfo) {
2990+ if (Opts.DebugInfoLevel <= IRGenDebugInfoLevel::LineTables)
2991+ return ;
2992+
2993+ // Don't emit debug info in transparent functions.
2994+ auto *DS = IGF.getDebugScope ();
2995+ if (!DS || DS->getInlinedFunction ()->isTransparent ())
2996+ return ;
2997+
2998+ Type IntTy = IGM.Context .getIntType ();
2999+ auto &TI = IGM.getTypeInfoForUnlowered (IntTy);
3000+ auto DbgTy = *CompletedDebugTypeInfo::getFromTypeInfo (IntTy, TI, IGM);
3001+ emitVariableDeclaration (
3002+ IGF.Builder , Metadata, DbgTy, IGF.getDebugScope (), {}, VarInfo,
3003+ IGF.isAsync () ? CoroDirectValue : DirectValue, ArtificialValue);
3004+ }
3005+
29803006SILLocation::FilenameAndLocation
29813007IRGenDebugInfoImpl::decodeSourceLoc (SourceLoc SL) {
29823008 auto &Cached = FilenameAndLocationCache[SL.getOpaquePointerValue ()];
@@ -3108,6 +3134,13 @@ void IRGenDebugInfo::emitTypeMetadata(IRGenFunction &IGF, llvm::Value *Metadata,
31083134 Depth, Index, Name);
31093135}
31103136
3137+ void IRGenDebugInfo::emitPackCountParameter (IRGenFunction &IGF,
3138+ llvm::Value *Metadata,
3139+ SILDebugVariable VarInfo) {
3140+ static_cast <IRGenDebugInfoImpl *>(this )->emitPackCountParameter (IGF, Metadata,
3141+ VarInfo);
3142+ }
3143+
31113144llvm::DIBuilder &IRGenDebugInfo::getBuilder () {
31123145 return static_cast <IRGenDebugInfoImpl *>(this )->getBuilder ();
31133146}
0 commit comments