aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-21 22:32:55 +0000
committerChris Lattner <sabre@nondot.org>2009-07-21 22:32:55 +0000
commit449e379bd7fe48ceef537f3e6c96d2853ee7e0a9 (patch)
tree2f5ff80c772a4cd6d21ea9d162aac7ddcae65cc5
parent939a8907eda969687bc2b28be85f8f4fc204c982 (diff)
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
-rw-r--r--lib/Target/DarwinTargetAsmInfo.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp
index ec300b9373..30468efe3e 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<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;
}