From 060a789c844dc1f3a4a1843766bbdaafe40f87d7 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Tue, 14 Aug 2018 10:04:36 +0000 Subject: [PATCH] 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. llvm-svn: 339667 --- clang/lib/AST/MicrosoftMangle.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index 40281481f1d1..8067c42dff5e 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -905,8 +905,14 @@ void MicrosoftCXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND, 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)) { -- 2.34.1