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

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 22 11:45:08 PDT 2018


Merged to 7.0 in r340437.

On Tue, Aug 14, 2018 at 3:04 AM, David Chisnall via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
> Author: theraven
> Date: Tue Aug 14 03:04:36 2018
> New Revision: 339667
>
> URL: http://llvm.org/viewvc/llvm-project?rev=339667&view=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&r1=339666&r2=339667&view=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 at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


More information about the cfe-commits mailing list