Rename LessPrivateGlobalPrefix -> LinkerPrivateGlobalPrefix to match the
authorChris Lattner <sabre@nondot.org>
Tue, 21 Jul 2009 17:30:51 +0000 (17:30 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 21 Jul 2009 17:30:51 +0000 (17:30 +0000)
LLVM IR concept.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76590 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetAsmInfo.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/MachOWriter.cpp
lib/Target/DarwinTargetAsmInfo.cpp
lib/Target/MSP430/MSP430AsmPrinter.cpp
lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
lib/Target/TargetAsmInfo.cpp

index a89b90669a597e188058e21413890a64d0d6c1b6..9d76f3c058c45bd7cba7beebb2202029fc96648c 100644 (file)
@@ -239,10 +239,10 @@ namespace llvm {
     /// have names in the .o file.  This is often "." or "L".
     const char *PrivateGlobalPrefix;      // Defaults to "."
     
-    /// LessPrivateGlobalPrefix - This prefix is used for symbols that should
+    /// LinkerPrivateGlobalPrefix - This prefix is used for symbols that should
     /// be passed through the assembler but be removed by the linker.  This
     /// is "l" on Darwin, currently used for some ObjC metadata.
-    const char *LessPrivateGlobalPrefix;      // Defaults to ""
+    const char *LinkerPrivateGlobalPrefix;      // Defaults to ""
     
     /// JumpTableSpecialLabelPrefix - If not null, a extra (dead) label is
     /// emitted before jump tables with the specified prefix.
@@ -708,8 +708,8 @@ namespace llvm {
     const char *getPrivateGlobalPrefix() const {
       return PrivateGlobalPrefix;
     }
-    const char *getLessPrivateGlobalPrefix() const {
-      return LessPrivateGlobalPrefix;
+    const char *getLinkerPrivateGlobalPrefix() const {
+      return LinkerPrivateGlobalPrefix;
     }
     const char *getJumpTableSpecialLabelPrefix() const {
       return JumpTableSpecialLabelPrefix;
index ad6cf77b767e039dabf38700aaf4ce2518efbca6..08eab53cf29c8c2b3bfac8b18257eec84625b980 100644 (file)
@@ -155,7 +155,7 @@ void AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const {
 
 bool AsmPrinter::doInitialization(Module &M) {
   Mang = new Mangler(M, TAI->getGlobalPrefix(), TAI->getPrivateGlobalPrefix(),
-                     TAI->getLessPrivateGlobalPrefix());
+                     TAI->getLinkerPrivateGlobalPrefix());
   
   if (TAI->doesAllowQuotesInName())
     Mang->setUseQuotes(true);
index a6a439a226ae3a24ba6ad267f2c6c7735956ed1f..0ce9044e858abb715ea4833b7b27a05d54ac61bb 100644 (file)
@@ -747,6 +747,7 @@ MachOSym::MachOSym(const GlobalValue *gv, std::string name, uint8_t sect,
   GV(gv), n_strx(0), n_type(sect == NO_SECT ? N_UNDF : N_SECT), n_sect(sect),
   n_desc(0), n_value(0) {
 
+  // FIXME: This is completely broken, it should use the mangler interface.
   switch (GV->getLinkage()) {
   default:
     llvm_unreachable("Unexpected linkage type!");
@@ -765,7 +766,7 @@ MachOSym::MachOSym(const GlobalValue *gv, std::string name, uint8_t sect,
     GVName = TAI->getPrivateGlobalPrefix() + name;
     break;
   case GlobalValue::LinkerPrivateLinkage:
-    GVName = TAI->getLessPrivateGlobalPrefix() + name;
+    GVName = TAI->getLinkerPrivateGlobalPrefix() + name;
     break;
   case GlobalValue::InternalLinkage:
     GVName = TAI->getGlobalPrefix() + name;
index 6540edd97aec7799de862b7509b2efc620d166d7..31c29a72bdff61f02dc48243989ae4c1b7b1cd10 100644 (file)
@@ -57,7 +57,7 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM)
   // Syntax:
   GlobalPrefix = "_";
   PrivateGlobalPrefix = "L";
-  LessPrivateGlobalPrefix = "l";  // Marker for some ObjC metadata
+  LinkerPrivateGlobalPrefix = "l";  // Marker for some ObjC metadata
   NeedsSet = true;
   NeedsIndirectEncoding = true;
   AllowQuotesInName = true;
@@ -105,17 +105,18 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM)
 }
 
 /// emitUsedDirectiveFor - On Darwin, internally linked data beginning with
-/// the PrivateGlobalPrefix or the LessPrivateGlobalPrefix does not have the
+/// the PrivateGlobalPrefix or the LinkerPrivateGlobalPrefix does not have the
 /// directive emitted (this occurs in ObjC metadata).
 bool DarwinTargetAsmInfo::emitUsedDirectiveFor(const GlobalValue* GV,
                                                Mangler *Mang) const {
   if (!GV) return false;
   
-  // Check whether the mangled name has the "Private" or "LessPrivate" prefix.
+  // Check whether the mangled name has the "Private" or "LinkerPrivate" prefix.
   if (GV->hasLocalLinkage() && !isa<Function>(GV)) {
     const std::string &Name = Mang->getMangledName(GV);
+    // FIXME: Always "L" and "l", simplify!
     const char *PGPrefix = getPrivateGlobalPrefix();
-    const char *LPGPrefix = getLessPrivateGlobalPrefix();
+    const char *LPGPrefix = getLinkerPrivateGlobalPrefix();
     unsigned PGPLen = strlen(PGPrefix);
     unsigned LPGPLen = strlen(LPGPrefix);
 
index 6cc5dedc15618426fa21725a426c501f0c10f24f..f6da3f301967594f3413eec2bef5e826066e34fd 100644 (file)
@@ -82,7 +82,7 @@ FunctionPass *llvm::createMSP430CodePrinterPass(formatted_raw_ostream &o,
 
 bool MSP430AsmPrinter::doInitialization(Module &M) {
   Mang = new Mangler(M, "", TAI->getPrivateGlobalPrefix(),
-                     TAI->getLessPrivateGlobalPrefix());
+                     TAI->getLinkerPrivateGlobalPrefix());
   return false; // success
 }
 
index ba7fd4c62c8ae2f889408fb092c53b506d1826aa..383ba8f0144be1f164a2a74d40a0ec88190debfe 100644 (file)
@@ -452,7 +452,7 @@ bool MipsAsmPrinter::
 doInitialization(Module &M) 
 {
   Mang = new Mangler(M, "", TAI->getPrivateGlobalPrefix(),
-                     TAI->getLessPrivateGlobalPrefix());
+                     TAI->getLinkerPrivateGlobalPrefix());
 
   // Tell the assembler which ABI we are using
   O << "\t.section .mdebug." << emitCurrentABIString() << '\n';
index 71394e8ad7e8cac247d3d4c30ebcd13beddf7296..7710819405101a288227ce4d2a2630522dc2a438 100644 (file)
@@ -224,7 +224,7 @@ void SparcAsmPrinter::printCCOperand(const MachineInstr *MI, int opNum) {
 
 bool SparcAsmPrinter::doInitialization(Module &M) {
   Mang = new Mangler(M, "", TAI->getPrivateGlobalPrefix(),
-                     TAI->getLessPrivateGlobalPrefix());
+                     TAI->getLinkerPrivateGlobalPrefix());
   return false; // success
 }
 
index 7b0989fce3546204d69c59e143e85667e5425b3d..f4f181c307bfa1be2bb2d8e01b062888bcd29e1a 100644 (file)
@@ -93,7 +93,7 @@ FunctionPass *llvm::createSystemZCodePrinterPass(formatted_raw_ostream &o,
 
 bool SystemZAsmPrinter::doInitialization(Module &M) {
   Mang = new Mangler(M, "", TAI->getPrivateGlobalPrefix(),
-                     TAI->getLessPrivateGlobalPrefix());
+                     TAI->getLinkerPrivateGlobalPrefix());
   return false; // success
 }
 
index fc8d58abfc37a9e5813a6639af654be80967162e..2a2e9876678bd3ac5f8d0abfc8700a7de5a1727c 100644 (file)
@@ -49,7 +49,7 @@ TargetAsmInfo::TargetAsmInfo(const TargetMachine &tm)
   MaxOperandLength = 0;
   GlobalPrefix = "";
   PrivateGlobalPrefix = ".";
-  LessPrivateGlobalPrefix = "";
+  LinkerPrivateGlobalPrefix = "";
   JumpTableSpecialLabelPrefix = 0;
   GlobalVarAddrPrefix = "";
   GlobalVarAddrSuffix = "";