@@ -279,16 +279,8 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
279
279
DebugTypeInfo DebugType,
280
280
bool IsLocalToUnit,
281
281
std::optional<SILLocation> Loc);
282
-
283
- void emitArtificialVariable (IRGenFunction &IGF, llvm::Value *Metadata,
284
- StringRef Name, StringRef Identifier);
285
-
286
282
void emitTypeMetadata (IRGenFunction &IGF, llvm::Value *Metadata,
287
- GenericTypeParamType *Type);
288
-
289
- void emitWitnessTable (IRGenFunction &IGF, llvm::Value *Metadata,
290
- StringRef Name, ProtocolDecl *protocol);
291
-
283
+ unsigned Depth, unsigned Index, StringRef Name);
292
284
void emitPackCountParameter (IRGenFunction &IGF, llvm::Value *Metadata,
293
285
SILDebugVariable VarInfo);
294
286
@@ -3912,10 +3904,9 @@ void IRGenDebugInfoImpl::emitGlobalVariableDeclaration(
3912
3904
Var->addDebugInfo (GV);
3913
3905
}
3914
3906
3915
- void IRGenDebugInfoImpl::emitArtificialVariable (IRGenFunction &IGF,
3916
- llvm::Value *Metadata,
3917
- StringRef Name,
3918
- StringRef Identifier) {
3907
+ void IRGenDebugInfoImpl::emitTypeMetadata (IRGenFunction &IGF,
3908
+ llvm::Value *Metadata, unsigned Depth,
3909
+ unsigned Index, StringRef Name) {
3919
3910
if (Opts.DebugInfoLevel <= IRGenDebugInfoLevel::LineTables)
3920
3911
return ;
3921
3912
@@ -3924,44 +3915,23 @@ void IRGenDebugInfoImpl::emitArtificialVariable(IRGenFunction &IGF,
3924
3915
if (!DS || DS->getInlinedFunction ()->isTransparent ())
3925
3916
return ;
3926
3917
3927
- uint64_t PtrWidthInBits =
3928
- CI.getTargetInfo ().getPointerWidth (clang::LangAS::Default);
3918
+ llvm::SmallString<8 > Buf;
3919
+ static const char *Tau = SWIFT_UTF8 (" \u03C4 " );
3920
+ llvm::raw_svector_ostream OS (Buf);
3921
+ OS << ' $' << Tau << ' _' << Depth << ' _' << Index;
3922
+ uint64_t PtrWidthInBits = CI.getTargetInfo ().getPointerWidth (clang::LangAS::Default);
3929
3923
assert (PtrWidthInBits % 8 == 0 );
3930
3924
auto DbgTy = DebugTypeInfo::getTypeMetadata (
3931
3925
getMetadataType (Name)->getDeclaredInterfaceType ().getPointer (),
3932
3926
Size (PtrWidthInBits / 8 ),
3933
3927
Alignment (CI.getTargetInfo ().getPointerAlign (clang::LangAS::Default)));
3934
- emitVariableDeclaration (
3935
- IGF.Builder , Metadata, DbgTy, IGF.getDebugScope (), {},
3936
- {Identifier, 0 , false }, // swift.type is already a pointer type,
3937
- // having a shadow copy doesn't add another
3938
- // layer of indirection.
3939
- IGF.isAsync () ? CoroDirectValue : DirectValue, ArtificialValue);
3940
- }
3941
-
3942
- void IRGenDebugInfoImpl::emitTypeMetadata (IRGenFunction &IGF,
3943
- llvm::Value *Metadata,
3944
- GenericTypeParamType *Type) {
3945
- llvm::SmallString<8 > Buf;
3946
- llvm::raw_svector_ostream OS (Buf);
3947
- OS << " $" << Type->getCanonicalName ().str ();
3948
- auto Name = Type->getName ().str ();
3949
-
3950
- emitArtificialVariable (IGF, Metadata, Name, OS.str ());
3951
- }
3952
-
3953
- void IRGenDebugInfoImpl::emitWitnessTable (IRGenFunction &IGF,
3954
- llvm::Value *Metadata, StringRef Name,
3955
- ProtocolDecl *protocol) {
3956
- llvm::SmallString<32 > Buf;
3957
- llvm::raw_svector_ostream OS (Buf);
3958
- DebugTypeInfo DbgTy (protocol->getDeclaredType ());
3959
- auto MangledName = getMangledName (DbgTy).Canonical ;
3960
- OS << " $WT" << Name << " $$" << MangledName;;
3961
- // Make sure this ID lives long enough.
3962
- auto Id = IGF.getSwiftModule ()->getASTContext ().getIdentifier (OS.str ());
3963
-
3964
- emitArtificialVariable (IGF, Metadata, Name, Id.str ());
3928
+ emitVariableDeclaration (IGF.Builder , Metadata, DbgTy, IGF.getDebugScope (),
3929
+ {}, {OS.str ().str (), 0 , false },
3930
+ // swift.type is already a pointer type,
3931
+ // having a shadow copy doesn't add another
3932
+ // layer of indirection.
3933
+ IGF.isAsync () ? CoroDirectValue : DirectValue,
3934
+ ArtificialValue);
3965
3935
}
3966
3936
3967
3937
void IRGenDebugInfoImpl::emitPackCountParameter (IRGenFunction &IGF,
@@ -4100,15 +4070,10 @@ void IRGenDebugInfo::emitGlobalVariableDeclaration(
4100
4070
}
4101
4071
4102
4072
void IRGenDebugInfo::emitTypeMetadata (IRGenFunction &IGF, llvm::Value *Metadata,
4103
- GenericTypeParamType *Type) {
4073
+ unsigned Depth, unsigned Index,
4074
+ StringRef Name) {
4104
4075
static_cast <IRGenDebugInfoImpl *>(this )->emitTypeMetadata (IGF, Metadata,
4105
- Type);
4106
- }
4107
-
4108
- void IRGenDebugInfo::emitWitnessTable (IRGenFunction &IGF, llvm::Value *Metadata,
4109
- StringRef Name, ProtocolDecl *protocol) {
4110
- static_cast <IRGenDebugInfoImpl *>(this )->emitWitnessTable (IGF, Metadata, Name,
4111
- protocol);
4076
+ Depth, Index, Name);
4112
4077
}
4113
4078
4114
4079
void IRGenDebugInfo::emitPackCountParameter (IRGenFunction &IGF,
0 commit comments