From 449e379bd7fe48ceef537f3e6c96d2853ee7e0a9 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 21 Jul 2009 22:32:55 +0000 Subject: [PATCH] simplify based on the fact that darwin always uses L/l. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76662 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/DarwinTargetAsmInfo.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp index ec300b93737..30468efe3e3 100644 --- a/lib/Target/DarwinTargetAsmInfo.cpp +++ b/lib/Target/DarwinTargetAsmInfo.cpp @@ -113,15 +113,11 @@ bool DarwinTargetAsmInfo::emitUsedDirectiveFor(const GlobalValue* GV, // Check whether the mangled name has the "Private" or "LinkerPrivate" prefix. if (GV->hasLocalLinkage() && !isa(GV)) { + // FIXME: ObjC metadata is currently emitted as internal symbols that have + // \1L and \0l prefixes on them. Fix them to be Private/LinkerPrivate and + // this horrible hack can go away. const std::string &Name = Mang->getMangledName(GV); - // FIXME: Always "L" and "l", simplify! - const char *PGPrefix = getPrivateGlobalPrefix(); - const char *LPGPrefix = getLinkerPrivateGlobalPrefix(); - unsigned PGPLen = strlen(PGPrefix); - unsigned LPGPLen = strlen(LPGPrefix); - - if ((PGPLen != 0 && Name.substr(0, PGPLen) == PGPrefix) || - (LPGPLen != 0 && Name.substr(0, LPGPLen) == LPGPrefix)) + if (Name[0] == 'L' || Name[0] == 'l') return false; }