Don't add objc method name mangling to locally declared function.

// rdar://9566314

llvm-svn: 132791
This commit is contained in:
Fariborz Jahanian 2011-06-09 19:25:01 +00:00
parent 7fbe7914af
commit 624b299685
2 changed files with 18 additions and 0 deletions

View File

@ -1122,6 +1122,12 @@ void CXXNameMangler::mangleLocalName(const NamedDecl *ND) {
// := Z <function encoding> E s [<discriminator>]
// <discriminator> := _ <non-negative number>
const DeclContext *DC = ND->getDeclContext();
if (isa<ObjCMethodDecl>(DC) && isa<FunctionDecl>(ND)) {
// Don't add objc method name mangling to locally declared function
mangleUnqualifiedName(ND);
return;
}
Out << 'Z';
if (const ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(DC)) {

View File

@ -42,3 +42,15 @@
}
@end
// rdar://9566314
@interface NX
- (void)Meth;
@end
@implementation NX
- (void)Meth {
void uiIsVisible();
// CHECK: call void @_Z11uiIsVisiblev
uiIsVisible();
}
@end