Switch some clients to Value::getName(), and other getName() user
authorDaniel Dunbar <daniel@zuster.org>
Wed, 22 Jul 2009 21:33:09 +0000 (21:33 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 22 Jul 2009 21:33:09 +0000 (21:33 +0000)
simplification.
 - NFC

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

lib/CodeGen/ScheduleDAGPrinter.cpp
lib/Target/PIC16/PIC16DebugInfo.cpp
lib/Target/TargetAsmInfo.cpp
lib/VMCore/Mangler.cpp
tools/lto/LTOCodeGenerator.cpp
tools/opt/PrintSCC.cpp

index 5efd274eea50361745d83c381da722b21ef16177..4514c77483c5afeba96b8eb1499ce27df0c04aed 100644 (file)
@@ -87,8 +87,8 @@ void ScheduleDAG::viewGraph() {
 #ifndef NDEBUG
   if (BB->getBasicBlock())
     ViewGraph(this, "dag." + MF.getFunction()->getName(), false,
-              "Scheduling-Units Graph for " + MF.getFunction()->getName() + ':' +
-              BB->getBasicBlock()->getName());
+              "Scheduling-Units Graph for " + MF.getFunction()->getName() + 
+              ":" + BB->getBasicBlock()->getName());
   else
     ViewGraph(this, "dag." + MF.getFunction()->getName(), false,
               "Scheduling-Units Graph for " + MF.getFunction()->getName());
index 56359b3ff0b12a614686bd45b7bd06109410c6b7..bf635f086ce1373dbdafac1fa845aaa7fb7f7cbf 100644 (file)
@@ -327,7 +327,7 @@ void PIC16DbgInfo::EmitCompositeTypeDecls(Module &M) {
     // Structures and union declaration's debug info has llvm.dbg.composite
     // in its name.
     // FIXME: Checking and relying on llvm.dbg.composite name is not a good idea.
-    if(I->getName().find("llvm.dbg.composite") != std::string::npos) {
+    if(I->getNameStr().find("llvm.dbg.composite") != std::string::npos) {
       GlobalVariable *GV = cast<GlobalVariable >(I);
       DICompositeType CTy(GV);
       if (CTy.getTag() == dwarf::DW_TAG_union_type ||
index 0f770bd30002ebaa52be896f0cb3d42bf3923846..a2fe4185e9a909a24f9734132d18c6fcf4debba0 100644 (file)
@@ -349,33 +349,33 @@ TargetAsmInfo::UniqueSectionForGlobal(const GlobalValue* GV,
                                       SectionKind::Kind Kind) const {
   switch (Kind) {
   case SectionKind::Text:
-    return ".gnu.linkonce.t." + GV->getName();
+    return ".gnu.linkonce.t." + GV->getNameStr();
   case SectionKind::Data:
-    return ".gnu.linkonce.d." + GV->getName();
+    return ".gnu.linkonce.d." + GV->getNameStr();
   case SectionKind::DataRel:
-    return ".gnu.linkonce.d.rel" + GV->getName();
+    return ".gnu.linkonce.d.rel" + GV->getNameStr();
   case SectionKind::DataRelLocal:
-    return ".gnu.linkonce.d.rel.local" + GV->getName();
+    return ".gnu.linkonce.d.rel.local" + GV->getNameStr();
   case SectionKind::DataRelRO:
-    return ".gnu.linkonce.d.rel.ro" + GV->getName();
+    return ".gnu.linkonce.d.rel.ro" + GV->getNameStr();
   case SectionKind::DataRelROLocal:
-    return ".gnu.linkonce.d.rel.ro.local" + GV->getName();
+    return ".gnu.linkonce.d.rel.ro.local" + GV->getNameStr();
   case SectionKind::SmallData:
-    return ".gnu.linkonce.s." + GV->getName();
+    return ".gnu.linkonce.s." + GV->getNameStr();
   case SectionKind::BSS:
-    return ".gnu.linkonce.b." + GV->getName();
+    return ".gnu.linkonce.b." + GV->getNameStr();
   case SectionKind::SmallBSS:
-    return ".gnu.linkonce.sb." + GV->getName();
+    return ".gnu.linkonce.sb." + GV->getNameStr();
   case SectionKind::ROData:
   case SectionKind::RODataMergeConst:
   case SectionKind::RODataMergeStr:
-    return ".gnu.linkonce.r." + GV->getName();
+    return ".gnu.linkonce.r." + GV->getNameStr();
   case SectionKind::SmallROData:
-    return ".gnu.linkonce.s2." + GV->getName();
+    return ".gnu.linkonce.s2." + GV->getNameStr();
   case SectionKind::ThreadData:
-    return ".gnu.linkonce.td." + GV->getName();
+    return ".gnu.linkonce.td." + GV->getNameStr();
   case SectionKind::ThreadBSS:
-    return ".gnu.linkonce.tb." + GV->getName();
+    return ".gnu.linkonce.tb." + GV->getNameStr();
   default:
     llvm_unreachable("Unknown section kind");
   }
index 5c4672b7e5a897c9b99ad97b654a7539ffc6bf99..44cf77826629546e4c35d25d9c92824ed575ad56 100644 (file)
@@ -146,7 +146,7 @@ std::string Mangler::getMangledName(const GlobalValue *GV, const char *Suffix,
       GV->hasLinkerPrivateLinkage() ? Mangler::LinkerPrivate : Mangler::Default;
 
   if (GV->hasName())
-    return makeNameProper(GV->getName() + Suffix, PrefixTy);
+    return makeNameProper(GV->getNameStr() + Suffix, PrefixTy);
   
   // Get the ID for the global, assigning a new one if we haven't got one
   // already.
index 9aca59cd6a8561d36e7f1717e2a51e22243f046b..93689e3528c1879879090f21372f4f5648a42724 100644 (file)
@@ -375,13 +375,13 @@ void LTOCodeGenerator::applyScopeRestrictions()
                                         e = mergedModule->end(); f != e; ++f) {
                 if ( !f->isDeclaration() 
                   && _mustPreserveSymbols.count(mangler.getMangledName(f)) )
-                    mustPreserveList.push_back(::strdup(f->getName().c_str()));
+                  mustPreserveList.push_back(::strdup(f->getNameStr().c_str()));
             }
             for (Module::global_iterator v = mergedModule->global_begin(), 
                                  e = mergedModule->global_end(); v !=  e; ++v) {
                 if ( !v->isDeclaration()
                   && _mustPreserveSymbols.count(mangler.getMangledName(v)) )
-                    mustPreserveList.push_back(::strdup(v->getName().c_str()));
+                  mustPreserveList.push_back(::strdup(v->getNameStr().c_str()));
             }
             passes.add(createInternalizePass(mustPreserveList));
         }
index 2d678ed0be47cdbcfda75abaf6683c5fe15a157b..a0aa4e90e7f9fd1faa234d9cda371d6e9bb44064 100644 (file)
@@ -101,7 +101,7 @@ bool CallGraphSCC::runOnModule(Module &M) {
     outs() << "\nSCC #" << ++sccNum << " : ";
     for (std::vector<CallGraphNode*>::const_iterator I = nextSCC.begin(),
            E = nextSCC.end(); I != E; ++I)
-      outs() << ((*I)->getFunction() ? (*I)->getFunction()->getName()
+      outs() << ((*I)->getFunction() ? (*I)->getFunction()->getNameStr()
                  : std::string("Indirect CallGraph node")) << ", ";
     if (nextSCC.size() == 1 && SCCI.hasLoop())
       outs() << " (Has self-loop).";