From 3d5126fbad17647088b7335cd5fea178407211e2 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 22 Jul 2009 21:33:09 +0000 Subject: [PATCH] Switch some clients to Value::getName(), and other getName() user simplification. - NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76789 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/ScheduleDAGPrinter.cpp | 4 ++-- lib/Target/PIC16/PIC16DebugInfo.cpp | 2 +- lib/Target/TargetAsmInfo.cpp | 26 +++++++++++++------------- lib/VMCore/Mangler.cpp | 2 +- tools/lto/LTOCodeGenerator.cpp | 4 ++-- tools/opt/PrintSCC.cpp | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/CodeGen/ScheduleDAGPrinter.cpp b/lib/CodeGen/ScheduleDAGPrinter.cpp index 5efd274eea5..4514c77483c 100644 --- a/lib/CodeGen/ScheduleDAGPrinter.cpp +++ b/lib/CodeGen/ScheduleDAGPrinter.cpp @@ -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()); diff --git a/lib/Target/PIC16/PIC16DebugInfo.cpp b/lib/Target/PIC16/PIC16DebugInfo.cpp index 56359b3ff0b..bf635f086ce 100644 --- a/lib/Target/PIC16/PIC16DebugInfo.cpp +++ b/lib/Target/PIC16/PIC16DebugInfo.cpp @@ -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(I); DICompositeType CTy(GV); if (CTy.getTag() == dwarf::DW_TAG_union_type || diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp index 0f770bd3000..a2fe4185e9a 100644 --- a/lib/Target/TargetAsmInfo.cpp +++ b/lib/Target/TargetAsmInfo.cpp @@ -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"); } diff --git a/lib/VMCore/Mangler.cpp b/lib/VMCore/Mangler.cpp index 5c4672b7e5a..44cf7782662 100644 --- a/lib/VMCore/Mangler.cpp +++ b/lib/VMCore/Mangler.cpp @@ -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. diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp index 9aca59cd6a8..93689e3528c 100644 --- a/tools/lto/LTOCodeGenerator.cpp +++ b/tools/lto/LTOCodeGenerator.cpp @@ -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)); } diff --git a/tools/opt/PrintSCC.cpp b/tools/opt/PrintSCC.cpp index 2d678ed0be4..a0aa4e90e7f 100644 --- a/tools/opt/PrintSCC.cpp +++ b/tools/opt/PrintSCC.cpp @@ -101,7 +101,7 @@ bool CallGraphSCC::runOnModule(Module &M) { outs() << "\nSCC #" << ++sccNum << " : "; for (std::vector::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)."; -- 2.11.0