Skip to content

Commit 623c252

Browse files
committed
Merging r339667:
------------------------------------------------------------------------ r339667 | theraven | 2018-08-14 12:04:36 +0200 (Tue, 14 Aug 2018) | 11 lines 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: 340437
1 parent 780e797 commit 623c252

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

clang/lib/AST/MicrosoftMangle.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,8 +940,14 @@ void MicrosoftCXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND,
940940

941941
case DeclarationName::ObjCZeroArgSelector:
942942
case DeclarationName::ObjCOneArgSelector:
943-
case DeclarationName::ObjCMultiArgSelector:
944-
llvm_unreachable("Can't mangle Objective-C selector names here!");
943+
case DeclarationName::ObjCMultiArgSelector: {
944+
// This is reachable only when constructing an outlined SEH finally
945+
// block. Nothing depends on this mangling and it's used only with
946+
// functinos with internal linkage.
947+
llvm::SmallString<64> Name;
948+
mangleSourceName(Name.str());
949+
break;
950+
}
945951

946952
case DeclarationName::CXXConstructorName:
947953
if (isStructorDecl(ND)) {

0 commit comments

Comments
 (0)