simplify based on the fact that darwin always uses L/l.
authorChris Lattner <sabre@nondot.org>
Tue, 21 Jul 2009 22:32:55 +0000 (22:32 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 21 Jul 2009 22:32:55 +0000 (22:32 +0000)
llvm-svn: 76662

llvm/lib/Target/DarwinTargetAsmInfo.cpp

index ec300b9..30468ef 100644 (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;
   }