From 093e54f1165ed06d73337ce89757987b0177e4ec Mon Sep 17 00:00:00 2001 From: Matt Gallagher Date: Thu, 28 Apr 2016 12:42:02 +1000 Subject: [PATCH 1/4] Fixed an apparent typo in demangleImplConvention Fixed an apparent typo where two cases tested for the same lowercase 'd' pattern, resulting in one case never being used. According to the comment block, doc/ABI.rst and lib/AST/Mangle.cpp, the second case should be an uppercase 'D'. --- lib/Basic/Demangle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Basic/Demangle.cpp b/lib/Basic/Demangle.cpp index 52d56bd9d612e..8ac325f19619c 100644 --- a/lib/Basic/Demangle.cpp +++ b/lib/Basic/Demangle.cpp @@ -2157,7 +2157,7 @@ class Demangler { auto Nothing = StringRef(); CASE('a', Nothing, Nothing, "@autoreleased") CASE('d', "@callee_unowned", "@unowned", "@unowned") - CASE('d', Nothing, Nothing, "@unowned_inner_pointer") + CASE('D', Nothing, Nothing, "@unowned_inner_pointer") CASE('g', "@callee_guaranteed", "@guaranteed", Nothing) CASE('e', Nothing, "@deallocating", Nothing) CASE('i', Nothing, "@in", "@out") From 008fbcfde2049c599c69c31ec64e59398c921eb5 Mon Sep 17 00:00:00 2001 From: Matt Gallagher Date: Thu, 28 Apr 2016 14:08:38 +1000 Subject: [PATCH 2/4] Fixed an apparent typo. Changed 'd' to 'D' to match corresponding fix in Demangle.cpp. --- lib/Basic/Remangle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Basic/Remangle.cpp b/lib/Basic/Remangle.cpp index 225ae5ff36c42..7daa59c8dac09 100644 --- a/lib/Basic/Remangle.cpp +++ b/lib/Basic/Remangle.cpp @@ -1165,7 +1165,7 @@ void Remangler::mangleImplConvention(Node *node) { } else if (text == "@unowned") { Out << 'd'; } else if (text == "@unowned_inner_pointer") { - Out << 'd'; // only in results + Out << 'D'; // only in results } else if (text == "@guaranteed") { Out << 'g'; } else if (text == "@deallocating") { From 10a0160ca5ab2bcb545ba3324becbdbad3fb4aec Mon Sep 17 00:00:00 2001 From: Matt Gallagher Date: Thu, 28 Apr 2016 14:11:15 +1000 Subject: [PATCH 3/4] Added test for @unowned_inner_pointer Corresponds to fix in Demangle.cpp --- test/Demangle/Inputs/manglings.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Demangle/Inputs/manglings.txt b/test/Demangle/Inputs/manglings.txt index dc7b1d32d5f77..4bf083fe826ef 100644 --- a/test/Demangle/Inputs/manglings.txt +++ b/test/Demangle/Inputs/manglings.txt @@ -193,6 +193,7 @@ _TTSfq1cl35_TFF7specgen6callerFSiT_U_FTSiSi_T_Si___TF7specgen12take_closureFFTSi _TTSf1cl35_TFF7specgen6callerFSiT_U_FTSiSi_T_Si___TTSg5Si___TF7specgen12take_closureFFTSiSi_T_T_ ---> function signature specialization ()).(closure #1), Argument Types : [Swift.Int]> of generic specialization of specgen.take_closure ((Swift.Int, Swift.Int) -> ()) -> () _TTSg5Si___TTSf1cl35_TFF7specgen6callerFSiT_U_FTSiSi_T_Si___TF7specgen12take_closureFFTSiSi_T_T_ ---> generic specialization of function signature specialization ()).(closure #1), Argument Types : [Swift.Int]> of specgen.take_closure ((Swift.Int, Swift.Int) -> ()) -> () _TTSf1cpfr24_TF8capturep6helperFSiT__n___TTRXFo_dSi_dT__XFo_iSi_dT__ ---> function signature specialization ()]> of reabstraction thunk helper from @callee_owned (@unowned Swift.Int) -> (@unowned ()) to @callee_owned (@in Swift.Int) -> (@unowned ()) +_TTSf1cpfr24_TF8capturep6helperFSiT__n___TTRXFo_dSi_DT__XFo_iSi_DT__ ---> function signature specialization ()]> of reabstraction thunk helper from @callee_owned (@unowned Swift.Int) -> (@unowned_inner_pointer ()) to @callee_owned (@in Swift.Int) -> (@unowned_inner_pointer ()) _TTSf1cpi0_cpfl0_cpse0v4u123_cpg53globalinit_33_06E7F1D906492AE070936A9B58CBAE1C_token8_cpfr36_TFtest_capture_propagation2_closure___TF7specgen12take_closureFFTSiSi_T_T_ ---> function signature specialization of specgen.take_closure ((Swift.Int, Swift.Int) -> ()) -> () _TTSf0gs___TFVs11_StringCore15_invariantCheckfT_T_ ---> function signature specialization of Swift._StringCore._invariantCheck () -> () _TTSf2g___TTSf2s_d___TFVs11_StringCoreCfVs13_StringBufferS_ ---> function signature specialization of function signature specialization of Swift._StringCore.init (Swift._StringBuffer) -> Swift._StringCore From 9568f22280cf5e406c8922bb1688d6e4bbfbe2a8 Mon Sep 17 00:00:00 2001 From: Matt Gallagher Date: Thu, 28 Apr 2016 14:12:25 +1000 Subject: [PATCH 4/4] Added test for @unowned_inner_pointer Corresponding to fix in Demangle.cpp. --- test/Demangle/Inputs/simplified-manglings.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Demangle/Inputs/simplified-manglings.txt b/test/Demangle/Inputs/simplified-manglings.txt index 127e8be31f302..d46778ccd44c9 100644 --- a/test/Demangle/Inputs/simplified-manglings.txt +++ b/test/Demangle/Inputs/simplified-manglings.txt @@ -177,6 +177,7 @@ _TTSf1cl35_TFF7specgen6callerFSiT_U_FTSiSi_T_Si___TF7specgen12take_closureFFTSiS _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 _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