Switch to getNameStr().
authorDaniel Dunbar <daniel@zuster.org>
Fri, 24 Jul 2009 08:24:36 +0000 (08:24 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 24 Jul 2009 08:24:36 +0000 (08:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76962 91177308-0d34-0410-b5e6-96231b3b80d8

12 files changed:
lib/Analysis/CFGPrinter.cpp
lib/CodeGen/MachineFunction.cpp
lib/CodeGen/ScheduleDAGPrinter.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
lib/Target/PIC16/PIC16DebugInfo.cpp
lib/Target/PIC16/PIC16TargetAsmInfo.cpp
lib/Target/X86/X86TargetAsmInfo.cpp
lib/Transforms/IPO/DeadArgumentElimination.cpp
lib/Transforms/Utils/CodeExtractor.cpp
tools/bugpoint/ExtractFunction.cpp

index 8ada5a3f74cddf0df8d9906a65a19db640bb5816..73f50d741c616d7da425fbd18d42e25a30432460 100644 (file)
@@ -35,14 +35,14 @@ namespace llvm {
 template<>
 struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
   static std::string getGraphName(const Function *F) {
-    return "CFG for '" + F->getName() + "' function";
+    return "CFG for '" + F->getNameStr() + "' function";
   }
 
   static std::string getNodeLabel(const BasicBlock *Node,
                                   const Function *Graph,
                                   bool ShortNames) {
     if (ShortNames && !Node->getName().empty())
-      return Node->getName() + ":";
+      return Node->getNameStr() + ":";
 
     std::ostringstream Out;
     if (ShortNames) {
@@ -136,7 +136,7 @@ namespace {
     explicit CFGPrinter(void *pid) : FunctionPass(pid) {}
 
     virtual bool runOnFunction(Function &F) {
-      std::string Filename = "cfg." + F.getName() + ".dot";
+      std::string Filename = "cfg." + F.getNameStr() + ".dot";
       cerr << "Writing '" << Filename << "'...";
       std::ofstream File(Filename.c_str());
 
@@ -166,7 +166,7 @@ namespace {
     CFGOnlyPrinter() : FunctionPass(&ID) {}
     explicit CFGOnlyPrinter(void *pid) : FunctionPass(pid) {}
     virtual bool runOnFunction(Function &F) {
-      std::string Filename = "cfg." + F.getName() + ".dot";
+      std::string Filename = "cfg." + F.getNameStr() + ".dot";
       cerr << "Writing '" << Filename << "'...";
       std::ofstream File(Filename.c_str());
 
@@ -196,7 +196,7 @@ P2("dot-cfg-only",
 /// being a 'dot' and 'gv' program in your path.
 ///
 void Function::viewCFG() const {
-  ViewGraph(this, "cfg" + getName());
+  ViewGraph(this, "cfg" + getNameStr());
 }
 
 /// viewCFGOnly - This function is meant for use from the debugger.  It works
@@ -205,7 +205,7 @@ void Function::viewCFG() const {
 /// his can make the graph smaller.
 ///
 void Function::viewCFGOnly() const {
-  ViewGraph(this, "cfg" + getName(), true);
+  ViewGraph(this, "cfg" + getNameStr(), true);
 }
 
 FunctionPass *llvm::createCFGPrinterPass () {
index 9d6669b085261d4302e87b934b448abe14498d74..34f840a8284d9633ba68012e021cec2cc14653fe 100644 (file)
@@ -304,7 +304,7 @@ namespace llvm {
   template<>
   struct DOTGraphTraits<const MachineFunction*> : public DefaultDOTGraphTraits {
     static std::string getGraphName(const MachineFunction *F) {
-      return "CFG for '" + F->getFunction()->getName() + "' function";
+      return "CFG for '" + F->getFunction()->getNameStr() + "' function";
     }
 
     static std::string getNodeLabel(const MachineBasicBlock *Node,
@@ -312,7 +312,7 @@ namespace llvm {
                                     bool ShortNames) {
       if (ShortNames && Node->getBasicBlock() &&
           !Node->getBasicBlock()->getName().empty())
-        return Node->getBasicBlock()->getName() + ":";
+        return Node->getBasicBlock()->getNameStr() + ":";
 
       std::ostringstream Out;
       if (ShortNames) {
@@ -339,7 +339,7 @@ namespace llvm {
 void MachineFunction::viewCFG() const
 {
 #ifndef NDEBUG
-  ViewGraph(this, "mf" + getFunction()->getName());
+  ViewGraph(this, "mf" + getFunction()->getNameStr());
 #else
   cerr << "SelectionDAG::viewGraph is only available in debug builds on "
        << "systems with Graphviz or gv!\n";
@@ -349,7 +349,7 @@ void MachineFunction::viewCFG() const
 void MachineFunction::viewCFGOnly() const
 {
 #ifndef NDEBUG
-  ViewGraph(this, "mf" + getFunction()->getName(), true);
+  ViewGraph(this, "mf" + getFunction()->getNameStr(), true);
 #else
   cerr << "SelectionDAG::viewGraph is only available in debug builds on "
        << "systems with Graphviz or gv!\n";
index 4514c77483c5afeba96b8eb1499ce27df0c04aed..ae358ec4fb5beef56000f9a11ef5dd698edae004 100644 (file)
@@ -86,12 +86,12 @@ void ScheduleDAG::viewGraph() {
 // This code is only for debugging!
 #ifndef NDEBUG
   if (BB->getBasicBlock())
-    ViewGraph(this, "dag." + MF.getFunction()->getName(), false,
-              "Scheduling-Units Graph for " + MF.getFunction()->getName() + 
-              ":" + BB->getBasicBlock()->getName());
+    ViewGraph(this, "dag." + MF.getFunction()->getNameStr(), false,
+              "Scheduling-Units Graph for " + MF.getFunction()->getNameStr() + 
+              ":" + BB->getBasicBlock()->getNameStr());
   else
-    ViewGraph(this, "dag." + MF.getFunction()->getName(), false,
-              "Scheduling-Units Graph for " + MF.getFunction()->getName());
+    ViewGraph(this, "dag." + MF.getFunction()->getNameStr(), false,
+              "Scheduling-Units Graph for " + MF.getFunction()->getNameStr());
 #else
   cerr << "ScheduleDAG::viewGraph is only available in debug builds on "
        << "systems with Graphviz or gv!\n";
index e2d4d08ec053213029a5e128449ba6408105508f..b0a19df05203813df0091d0d17cbe6192e980faa 100644 (file)
@@ -568,8 +568,8 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
   if (ViewDAGCombine1 || ViewLegalizeTypesDAGs || ViewLegalizeDAGs ||
       ViewDAGCombine2 || ViewDAGCombineLT || ViewISelDAGs || ViewSchedDAGs ||
       ViewSUnitDAGs)
-    BlockName = CurDAG->getMachineFunction().getFunction()->getName() + ":" +
-                BB->getBasicBlock()->getName();
+    BlockName = CurDAG->getMachineFunction().getFunction()->getNameStr() + ":" +
+                BB->getBasicBlock()->getNameStr();
 
   DOUT << "Initial selection DAG:\n";
   DEBUG(CurDAG->dump());
index 6fd5df2b937d6ec7ba45801eb6fb9bb6756a756e..386d732348ff3290a0a384388a23e4de6be021c9 100644 (file)
@@ -138,8 +138,8 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
 void SelectionDAG::viewGraph(const std::string &Title) {
 // This code is only for debugging!
 #ifndef NDEBUG
-  ViewGraph(this, "dag." + getMachineFunction().getFunction()->getName(), false,
-            Title);
+  ViewGraph(this, "dag." + getMachineFunction().getFunction()->getNameStr(), 
+            false, Title);
 #else
   cerr << "SelectionDAG::viewGraph is only available in debug builds on "
        << "systems with Graphviz or gv!\n";
index 86d1e16589b121d2e0decfc1fec3fa0f0c6c92ed..79948704ef12dd78627c25cb33fc4bc1c9673c7d 100644 (file)
@@ -96,15 +96,15 @@ static ExFunc lookupFunction(const Function *F) {
   const FunctionType *FT = F->getFunctionType();
   for (unsigned i = 0, e = FT->getNumContainedTypes(); i != e; ++i)
     ExtName += getTypeID(FT->getContainedType(i));
-  ExtName += "_" + F->getName();
+  ExtName + "_" + F->getNameStr();
 
   sys::ScopedLock Writer(*FunctionsLock);
   ExFunc FnPtr = FuncNames[ExtName];
   if (FnPtr == 0)
-    FnPtr = FuncNames["lle_X_"+F->getName()];
+    FnPtr = FuncNames["lle_X_" + F->getNameStr()];
   if (FnPtr == 0)  // Try calling a generic function... if it exists...
     FnPtr = (ExFunc)(intptr_t)
-      sys::DynamicLibrary::SearchForAddressOfSymbol("lle_X_"+F->getName());
+      sys::DynamicLibrary::SearchForAddressOfSymbol("lle_X_"+F->getNameStr());
   if (FnPtr != 0)
     ExportedFunctions->insert(std::make_pair(F, FnPtr));  // Cache for later
   return FnPtr;
index bf635f086ce1373dbdafac1fa845aaa7fb7f7cbf..fd0d309e141c94fd7a37654b078d0d0a9d9cf59f 100644 (file)
@@ -117,7 +117,7 @@ void PIC16DbgInfo::PopulateStructOrUnionTypeInfo (DIType Ty,
   CTy.getName(TagName);
   // UniqueSuffix is .number where number is obtained from
   // llvm.dbg.composite<number>.
-  std::string UniqueSuffix = "." + Ty.getGV()->getName().substr(18);
+  std::string UniqueSuffix = "." + Ty.getGV()->getNameStr().substr(18);
   TagName += UniqueSuffix;
   unsigned short size = CTy.getSizeInBits()/8;
   // 7th and 8th byte represent size.
@@ -446,7 +446,7 @@ void PIC16DbgInfo::EmitVarDebugInfo(Module &M) {
     bool HasAux = false;
     int Aux[PIC16Dbg::AuxSize] = { 0 };
     std::string TagName = "";
-    std::string VarName = TAI->getGlobalPrefix()+DIGV.getGlobal()->getName();
+    std::string VarName = TAI->getGlobalPrefix()+DIGV.getGlobal()->getNameStr();
     PopulateDebugInfo(Ty, TypeNo, HasAux, Aux, TagName);
     // Emit debug info only if type information is availaible.
     if (TypeNo != PIC16Dbg::T_NULL) {
index 9adf63a0a97ca3a4bc978e0d0666e86d69bbba70..c7708fa761f25f838a0c99384b5bb6732ec9b6de 100644 (file)
@@ -310,7 +310,7 @@ PIC16TargetAsmInfo::CreateBSSSectionForGlobal(const GlobalVariable *GV,
       }
     }
   } else {
-    std::string Prefix = GV->getName() + "." + Addr + ".";
+    std::string Prefix = GV->getNameStr() + "." + Addr + ".";
     Name = PAN::getUdataSectionName(BSSSections.size(), Prefix) + " " + Addr;
   }
   
@@ -361,7 +361,7 @@ PIC16TargetAsmInfo::CreateIDATASectionForGlobal(const GlobalVariable *GV,
       }
     }
   } else {
-    std::string Prefix = GV->getName() + "." + Addr + ".";
+    std::string Prefix = GV->getNameStr() + "." + Addr + ".";
     Name = PAN::getIdataSectionName(IDATASections.size(), Prefix) + " " + Addr;
   }
 
@@ -399,7 +399,7 @@ PIC16TargetAsmInfo::CreateROSectionForGlobal(const GlobalVariable *GV,
       }
     }
   } else {
-    std::string Prefix = GV->getName() + "." + Addr + ".";
+    std::string Prefix = GV->getNameStr() + "." + Addr + ".";
     Name = PAN::getRomdataSectionName(ROSections.size(), Prefix) + " " + Addr;
   }
 
index 99615dbd8ba68c68b22bbc66cef069247450b998..52b4f425927647e2c0c58d957c57c621c2e93a4b 100644 (file)
@@ -45,8 +45,8 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM):
 
   AlignmentIsInBytes = false;
   TextAlignFillValue = 0x90;
-    
-    
+
+
   if (!is64Bit)
     Data64bitsDirective = 0;       // we can't emit a 64-bit unit
   ZeroDirective = "\t.space\t";  // ".space N" emits N zeros.
@@ -64,7 +64,7 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM):
   // Leopard and above support aligned common symbols.
   COMMDirectiveTakesAlignment = (Subtarget->getDarwinVers() >= 9);
   HasDotTypeDotSizeDirective = false;
-    
+
   if (is64Bit) {
     PersonalityPrefix = "";
     PersonalitySuffix = "+4@GOTPCREL";
index 3491b1c85bfa9f344c770b4e87bcc667c35d779f..f9d7864423de5660999422c75776dd0f130d3b1b 100644 (file)
@@ -73,7 +73,7 @@ namespace {
 
       std::string getDescription() const {
         return std::string((IsArg ? "Argument #" : "Return value #")) 
-               + utostr(Idx) + " of function " + F->getName();
+               + utostr(Idx) + " of function " + F->getNameStr();
       }
     };
 
index a0193992a757e5425a66b25b52264e84da194789..2a91b0e80d355b09637ce6f90c7825f2df9e8eb8 100644 (file)
@@ -307,11 +307,11 @@ Function *CodeExtractor::constructFunction(const Values &inputs,
       Value *Idx[2];
       Idx[0] = Context.getNullValue(Type::Int32Ty);
       Idx[1] = Context.getConstantInt(Type::Int32Ty, i);
-      std::string GEPname = "gep_" + inputs[i]->getName();
       TerminatorInst *TI = newFunction->begin()->getTerminator();
-      GetElementPtrInst *GEP = GetElementPtrInst::Create(AI, Idx, Idx+2, 
-                                                         GEPname, TI);
-      RewriteVal = new LoadInst(GEP, "load" + GEPname, TI);
+      GetElementPtrInst *GEP = 
+        GetElementPtrInst::Create(AI, Idx, Idx+2, 
+                                  "gep_" + inputs[i]->getName(), TI);
+      RewriteVal = new LoadInst(GEP, "loadgep_" + inputs[i]->getName(), TI);
     } else
       RewriteVal = AI++;
 
index e9f7f938a7e913ff7eb2dae794a086b37f5e8d4d..f315f672ecbca430eec89b10db20c35dcf74826e 100644 (file)
@@ -353,7 +353,7 @@ Module *BugDriver::ExtractMappedBlocksFromModule(const
     // If the BB doesn't have a name, give it one so we have something to key
     // off of.
     if (!BB->hasName()) BB->setName("tmpbb");
-    BlocksToNotExtractFile << BB->getParent()->getName() << " "
+    BlocksToNotExtractFile << BB->getParent()->getNameStr() << " "
                            << BB->getName() << "\n";
   }
   BlocksToNotExtractFile.close();