Skip to content

Commit

Permalink
demangler: be a bit more verbose when printing the simplified manglin…
Browse files Browse the repository at this point in the history
…g for a thunk

Instead of just printing “thunk” it now also includes the source function type

rdar://problem/30541796
  • Loading branch information
eeckstein committed Feb 28, 2017
1 parent 252af7d commit 2d06da7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion lib/Basic/Demangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3415,7 +3415,8 @@ void NodePrinter::print(NodePointer pointer, bool asContext, bool suppressType)
case Node::Kind::ReabstractionThunk:
case Node::Kind::ReabstractionThunkHelper: {
if (Options.ShortenThunk) {
Printer << "thunk";
Printer << "thunk for ";
print(pointer->getChild(pointer->getNumChildren() - 2));
return;
}
Printer << "reabstraction thunk ";
Expand Down
16 changes: 9 additions & 7 deletions test/Demangle/Inputs/simplified-manglings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ _TtGSqGSaC5sugar7MyClass__ ---> [MyClass]?
_TtGSaGSqC5sugar7MyClass__ ---> [MyClass?]
_TtaC9typealias5DWARF9DIEOffset ---> DWARF.DIEOffset
_Ttas3Int ---> Int
_TTRXFo_dSc_dSb_XFo_iSc_iSb_ ---> thunk
_TTRXFo_dSi_dGSqSi__XFo_iSi_iGSqSi__ ---> thunk
_TTRGrXFo_iV18switch_abstraction1A_ix_XFo_dS0__ix_ ---> thunk
_TTRXFo_dSc_dSb_XFo_iSc_iSb_ ---> thunk for @callee_owned (@unowned UnicodeScalar) -> (@unowned Bool)
_TTRXFo_dSi_dGSqSi__XFo_iSi_iGSqSi__ ---> thunk for @callee_owned (@unowned Int) -> (@unowned Int?)
_TTRGrXFo_iV18switch_abstraction1A_ix_XFo_dS0__ix_ ---> thunk for @callee_owned (@in A) -> (@out A)
_TFCF5types1gFT1bSb_T_L0_10Collection3zimfT_T_ ---> (g(b : Bool) -> ()).(Collection #2).zim() -> ()
_TFF17capture_promotion22test_capture_promotionFT_FT_SiU_FT_Si_promote0 ---> (test_capture_promotion() -> () -> Int).(closure #1)
_TFIVs8_Processi10_argumentsGSaSS_U_FT_GSaSS_ ---> _Process.(variable initialization expression)._arguments
Expand All @@ -160,7 +160,7 @@ _TTSgSiS_ ---> _TTSgSiS_
_TTSgSi__xyz ---> _TTSgSi__xyz
_TTSg5Si___TTSg5Si___TFSqcfT_GSqx_ ---> specialized specialized Optional.init() -> A?
_TTSg5Vs5UInt8___TFV10specialize3XXXcfT1tx_GS0_x_ ---> specialized XXX.init(t : A) -> XXX<A>
_TPA__TTRXFo_oSSoSS_dSb_XFo_iSSiSS_dSb_31 ---> partial apply for thunk
_TPA__TTRXFo_oSSoSS_dSb_XFo_iSSiSS_dSb_31 ---> partial apply for thunk for @callee_owned (@owned String, @owned String) -> (@unowned Bool)
_TiC4Meow5MyCls9subscriptFT1iSi_Sf ---> MyCls.subscript(i : Int) -> Float
_TF8manglingX22egbpdajGbuEbxfgehfvwxnFT_T_ ---> ليهمابتكلموشعربي؟() -> ()
_TF8manglingX24ihqwcrbEcvIaIdqgAFGpqjyeFT_T_ ---> 他们为什么不说中文() -> ()
Expand All @@ -180,8 +180,8 @@ _TPA__TFFVs11GeneratorOfcuRd__s13GeneratorTyperFqd__GS_x_U_FT_GSqx_ ---> partial
_TTSf1cl35_TFF7specgen6callerFSiT_U_FTSiSi_T_Si___TF7specgen12take_closureFFTSiSi_T_T_ ---> specialized take_closure((Int, Int) -> ()) -> ()
_TTSf1cl35_TFF7specgen6callerFSiT_U_FTSiSi_T_Si___TTSg5Si___TF7specgen12take_closureFFTSiSi_T_T_ ---> specialized specialized take_closure((Int, Int) -> ()) -> ()
_TTSg5Si___TTSf1cl35_TFF7specgen6callerFSiT_U_FTSiSi_T_Si___TF7specgen12take_closureFFTSiSi_T_T_ ---> specialized specialized take_closure((Int, Int) -> ()) -> ()
_TTSf1cpfr24_TF8capturep6helperFSiT__n___TTRXFo_dSi_dT__XFo_iSi_dT__ ---> specialized thunk
_TTSf1cpfr24_TF8capturep6helperFSiT__n___TTRXFo_dSi_DT__XFo_iSi_DT__ ---> specialized thunk
_TTSf1cpfr24_TF8capturep6helperFSiT__n___TTRXFo_dSi_dT__XFo_iSi_dT__ ---> specialized thunk for @callee_owned (@unowned Int) -> (@unowned ())
_TTSf1cpfr24_TF8capturep6helperFSiT__n___TTRXFo_dSi_DT__XFo_iSi_DT__ ---> specialized thunk for @callee_owned (@unowned Int) -> (@unowned_inner_pointer ())
_TTSf1cpi0_cpfl0_cpse0v4u123_cpg53globalinit_33_06E7F1D906492AE070936A9B58CBAE1C_token8_cpfr36_TFtest_capture_propagation2_closure___TF7specgen12take_closureFFTSiSi_T_T_ ---> specialized take_closure((Int, Int) -> ()) -> ()
_TTSf0gs___TFVs11_StringCore15_invariantCheckfT_T_ ---> specialized _StringCore._invariantCheck() -> ()
_TTSf2g___TTSf2s_d___TFVs11_StringCoreCfVs13_StringBufferS_ ---> specialized specialized _StringCore.init(_StringBuffer) -> _StringCore
Expand All @@ -198,6 +198,8 @@ _TTWurGV23interface_type_mangling18GenericTypeContextx_S_18GenericWitnessTestS_F
_TFC3red11BaseClassEHcfzT1aSi_S0_ ---> BaseClassEH.init(a : Int) throws -> BaseClassEH
_TFe27mangling_generic_extensionsR_S_8RunciblerVS_3Foog1aSi ---> Foo<A where ...>.a.getter
_TFe27mangling_generic_extensionsR_S_8RunciblerVS_3Foog1bx ---> Foo<A where ...>.b.getter
_TTRXFo_iT__iT_zoPs5Error__XFo__dT_zoPS___ ---> thunk
_TTRXFo_iT__iT_zoPs5Error__XFo__dT_zoPS___ ---> thunk for @callee_owned (@in ()) -> (@out (), @error @owned Error)
_TFE1a ---> _TFE1a
_TFC4testP33_83378C430F65473055F1BD53F3ADCDB71C5doFoofT_T_ ---> C.doFoo() -> ()
_TTRXFo_oCSo13SKPhysicsBodydVSC7CGPointdVSC8CGVectordGSpV10ObjectiveC8ObjCBool___XFdCb_dS_dS0_dS1_dGSpS3____ ---> thunk for @callee_owned (@owned SKPhysicsBody, @unowned CGPoint, @unowned CGVector, @unowned UnsafeMutablePointer<ObjCBool>) -> ()
_T0So13SKPhysicsBodyCSC7CGPointVSC8CGVectorVSpy10ObjectiveC8ObjCBoolVGIxxyyy_AbdFSpyAIGIyByyyy_TR ---> thunk for @callee_owned (@owned SKPhysicsBody, @unowned CGPoint, @unowned CGVector, @unowned UnsafeMutablePointer<ObjCBool>) -> ()

0 comments on commit 2d06da7

Please sign in to comment.