rename getValueName -> getMangledName. These two files have very
authorChris Lattner <sabre@nondot.org>
Tue, 14 Jul 2009 06:21:12 +0000 (06:21 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 14 Jul 2009 06:21:12 +0000 (06:21 +0000)
dubious looking things that I need to investigate in more detail.

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

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/Target/DarwinTargetAsmInfo.cpp

index 867b00370c1177e542ff86d79fa38dc86576e81c..00edcac24d1cf816a2f288ba02984f7593ffe2ea 100644 (file)
@@ -210,13 +210,13 @@ bool AsmPrinter::doFinalization(Module &M) {
     for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
          I != E; ++I) {
       if (I->hasExternalWeakLinkage())
-        O << TAI->getWeakRefDirective() << Mang->getValueName(I) << '\n';
+        O << TAI->getWeakRefDirective() << Mang->getMangledName(I) << '\n';
     }
     
     for (Module::const_iterator I = M.begin(), E = M.end();
          I != E; ++I) {
       if (I->hasExternalWeakLinkage())
-        O << TAI->getWeakRefDirective() << Mang->getValueName(I) << '\n';
+        O << TAI->getWeakRefDirective() << Mang->getMangledName(I) << '\n';
     }
   }
 
@@ -227,11 +227,10 @@ bool AsmPrinter::doFinalization(Module &M) {
     O << '\n';
     for (Module::const_alias_iterator I = M.alias_begin(), E = M.alias_end();
          I != E; ++I) {
-      std::string Name = Mang->getValueName(I);
-      std::string Target;
+      std::string Name = Mang->getMangledName(I);
 
       const GlobalValue *GV = cast<GlobalValue>(I->getAliasedGlobal());
-      Target = Mang->getValueName(GV);
+      std::string Target = Mang->getMangledName(GV);
 
       if (I->hasExternalLinkage() || !TAI->getWeakRefDirective())
         O << "\t.globl\t" << Name << '\n';
@@ -270,15 +269,16 @@ AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF,
   assert(MF && "No machine function?");
   Name = MF->getFunction()->getName();
   if (Name.empty())
-    Name = Mang->getValueName(MF->getFunction());
+    Name = Mang->getMangledName(MF->getFunction());
   
+  // FIXME: THIS SEEMS REALLY WRONG, it will get two prefixes.
   Name = Mang->makeNameProper(TAI->getEHGlobalPrefix() + Name + ".eh");
   return Name;
 }
 
 void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
   // What's my mangled name?
-  CurrentFnName = Mang->getValueName(MF.getFunction());
+  CurrentFnName = Mang->getMangledName(MF.getFunction());
   IncrementFunctionNumber();
 }
 
@@ -576,11 +576,11 @@ const std::string &AsmPrinter::getGlobalLinkName(const GlobalVariable *GV,
                                                  std::string &LinkName) const {
   if (isa<Function>(GV)) {
     LinkName += TAI->getFunctionAddrPrefix();
-    LinkName += Mang->getValueName(GV);
+    LinkName += Mang->getMangledName(GV);
     LinkName += TAI->getFunctionAddrSuffix();
   } else {
     LinkName += TAI->getGlobalVarAddrPrefix();
-    LinkName += Mang->getValueName(GV);
+    LinkName += Mang->getMangledName(GV);
     LinkName += TAI->getGlobalVarAddrSuffix();
   }  
   
@@ -858,11 +858,11 @@ void AsmPrinter::EmitConstantValueOnly(const Constant *CV) {
     // FunctionAddrPrefix/Suffix (these all default to "" )
     if (isa<Function>(GV)) {
       O << TAI->getFunctionAddrPrefix()
-        << Mang->getValueName(GV)
+        << Mang->getMangledName(GV)
         << TAI->getFunctionAddrSuffix();
     } else {
       O << TAI->getGlobalVarAddrPrefix()
-        << Mang->getValueName(GV)
+        << Mang->getMangledName(GV)
         << TAI->getGlobalVarAddrSuffix();
     }
   } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CV)) {
index 609497638a04ef59e9f0a1f4d6fdd32a44e4631d..d33146764da2cc2812f8dbf608a463a616bf9b25 100644 (file)
@@ -103,18 +103,21 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM)
 /// emitUsedDirectiveFor - On Darwin, internally linked data beginning with
 /// the PrivateGlobalPrefix or the LessPrivateGlobalPrefix does not have the
 /// directive emitted (this occurs in ObjC metadata).
-
 bool
 DarwinTargetAsmInfo::emitUsedDirectiveFor(const GlobalValue* GV,
                                           Mangler *Mang) const {
   if (GV==0)
     return false;
+  
+  /// FIXME: WHAT IS THIS?
+  
   if (GV->hasLocalLinkage() && !isa<Function>(GV) &&
       ((strlen(getPrivateGlobalPrefix()) != 0 &&
-        Mang->getValueName(GV).substr(0,strlen(getPrivateGlobalPrefix())) ==
+        Mang->getMangledName(GV).substr(0,strlen(getPrivateGlobalPrefix())) ==
           getPrivateGlobalPrefix()) ||
        (strlen(getLessPrivateGlobalPrefix()) != 0 &&
-        Mang->getValueName(GV).substr(0,strlen(getLessPrivateGlobalPrefix())) ==
+        Mang->getMangledName(GV).substr(0,
+                                        strlen(getLessPrivateGlobalPrefix())) ==
           getLessPrivateGlobalPrefix())))
     return false;
   return true;