Re: r339667 - Add a stub mangling for ObjC selectors in the Microsoft ABI.

2018-08-22 Thread Hans Wennborg via cfe-commits
Merged to 7.0 in r340437.

On Tue, Aug 14, 2018 at 3:04 AM, David Chisnall via cfe-commits
 wrote:
> Author: theraven
> Date: Tue Aug 14 03:04:36 2018
> New Revision: 339667
>
> URL: http://llvm.org/viewvc/llvm-project?rev=339667=rev
> Log:
> Add a stub mangling for ObjC selectors in the Microsoft ABI.
>
> This mangling is used only for outlined SEH finally blocks, which have
> internal linkage.
>
> This fixes the failure of CodeGenObjC/2007-04-03-ObjcEH.m on builds with
> expensive checks enabled, on Windows.  This test should probably be
> specifying a triple: it currently picks up whatever the host environment
> is using.  Unfortunately, I have no idea what it is trying to test,
> because it contains no comments and predates Clang having working
> Objective-C IR generation.
>
> Modified:
> cfe/trunk/lib/AST/MicrosoftMangle.cpp
>
> Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=339667=339666=339667=diff
> ==
> --- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
> +++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Tue Aug 14 03:04:36 2018
> @@ -905,8 +905,14 @@ void MicrosoftCXXNameMangler::mangleUnqu
>
>  case DeclarationName::ObjCZeroArgSelector:
>  case DeclarationName::ObjCOneArgSelector:
> -case DeclarationName::ObjCMultiArgSelector:
> -  llvm_unreachable("Can't mangle Objective-C selector names here!");
> +case DeclarationName::ObjCMultiArgSelector: {
> +  // This is reachable only when constructing an outlined SEH finally
> +  // block.  Nothing depends on this mangling and it's used only with
> +  // functinos with internal linkage.
> +  llvm::SmallString<64> Name;
> +  mangleSourceName(Name.str());
> +  break;
> +}
>
>  case DeclarationName::CXXConstructorName:
>if (isStructorDecl(ND)) {
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r339667 - Add a stub mangling for ObjC selectors in the Microsoft ABI.

2018-08-14 Thread David Chisnall via cfe-commits
Author: theraven
Date: Tue Aug 14 03:04:36 2018
New Revision: 339667

URL: http://llvm.org/viewvc/llvm-project?rev=339667=rev
Log:
Add a stub mangling for ObjC selectors in the Microsoft ABI.

This mangling is used only for outlined SEH finally blocks, which have
internal linkage.

This fixes the failure of CodeGenObjC/2007-04-03-ObjcEH.m on builds with
expensive checks enabled, on Windows.  This test should probably be
specifying a triple: it currently picks up whatever the host environment
is using.  Unfortunately, I have no idea what it is trying to test,
because it contains no comments and predates Clang having working
Objective-C IR generation.

Modified:
cfe/trunk/lib/AST/MicrosoftMangle.cpp

Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=339667=339666=339667=diff
==
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Tue Aug 14 03:04:36 2018
@@ -905,8 +905,14 @@ void MicrosoftCXXNameMangler::mangleUnqu
 
 case DeclarationName::ObjCZeroArgSelector:
 case DeclarationName::ObjCOneArgSelector:
-case DeclarationName::ObjCMultiArgSelector:
-  llvm_unreachable("Can't mangle Objective-C selector names here!");
+case DeclarationName::ObjCMultiArgSelector: {
+  // This is reachable only when constructing an outlined SEH finally
+  // block.  Nothing depends on this mangling and it's used only with
+  // functinos with internal linkage.
+  llvm::SmallString<64> Name;
+  mangleSourceName(Name.str());
+  break;
+}
 
 case DeclarationName::CXXConstructorName:
   if (isStructorDecl(ND)) {


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits