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
This commit is contained in:
Chris Lattner 2009-07-21 22:32:55 +00:00
parent 939a8907ed
commit 449e379bd7

View File

@ -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<Function>(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;
}