mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	Simplify the code in DarwinTargetAsmInfo::emitUsedDirectiveFor so that humans can understand it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76480 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -774,4 +774,3 @@ MachOSym::MachOSym(const GlobalValue *gv, std::string name, uint8_t sect, | |||||||
| } | } | ||||||
|  |  | ||||||
| } // end namespace llvm | } // end namespace llvm | ||||||
|  |  | ||||||
|   | |||||||
| @@ -107,23 +107,23 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM) | |||||||
| /// emitUsedDirectiveFor - On Darwin, internally linked data beginning with | /// emitUsedDirectiveFor - On Darwin, internally linked data beginning with | ||||||
| /// the PrivateGlobalPrefix or the LessPrivateGlobalPrefix does not have the | /// the PrivateGlobalPrefix or the LessPrivateGlobalPrefix does not have the | ||||||
| /// directive emitted (this occurs in ObjC metadata). | /// directive emitted (this occurs in ObjC metadata). | ||||||
| bool | bool DarwinTargetAsmInfo::emitUsedDirectiveFor(const GlobalValue* GV, | ||||||
| DarwinTargetAsmInfo::emitUsedDirectiveFor(const GlobalValue* GV, |  | ||||||
|                                                Mangler *Mang) const { |                                                Mangler *Mang) const { | ||||||
|   if (GV==0) |   if (!GV) return false; | ||||||
|     return false; |  | ||||||
|    |    | ||||||
|   /// FIXME: WHAT IS THIS? |   // Check whether the mangled name has the "Private" or "LessPrivate" prefix. | ||||||
|  |   if (GV->hasLocalLinkage() && !isa<Function>(GV)) { | ||||||
|  |     const std::string &Name = Mang->getMangledName(GV); | ||||||
|  |     const char *PGPrefix = getPrivateGlobalPrefix(); | ||||||
|  |     const char *LPGPrefix = getLessPrivateGlobalPrefix(); | ||||||
|  |     unsigned PGPLen = strlen(PGPrefix); | ||||||
|  |     unsigned LPGPLen = strlen(LPGPrefix); | ||||||
|  |  | ||||||
|   if (GV->hasLocalLinkage() && !isa<Function>(GV) && |     if ((PGPLen != 0 && Name.substr(0, PGPLen) == PGPrefix) || | ||||||
|       ((strlen(getPrivateGlobalPrefix()) != 0 && |         (LPGPLen != 0 && Name.substr(0, LPGPLen) == LPGPrefix)) | ||||||
|         Mang->getMangledName(GV).substr(0,strlen(getPrivateGlobalPrefix())) == |  | ||||||
|           getPrivateGlobalPrefix()) || |  | ||||||
|        (strlen(getLessPrivateGlobalPrefix()) != 0 && |  | ||||||
|         Mang->getMangledName(GV).substr(0, |  | ||||||
|                                         strlen(getLessPrivateGlobalPrefix())) == |  | ||||||
|           getLessPrivateGlobalPrefix()))) |  | ||||||
|       return false; |       return false; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   return true; |   return true; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user