Simplify / normalize some uses of Value::getName.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 21 Jul 2009 08:54:24 +0000 (08:54 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 21 Jul 2009 08:54:24 +0000 (08:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76553 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/ExecutionEngine/ExecutionEngine.cpp
lib/ExecutionEngine/JIT/JIT.cpp
lib/ExecutionEngine/JIT/JITEmitter.cpp
tools/llvm-prof/llvm-prof.cpp

index 1f9e2668f8eb9cff2176de9d0edb614857dd60ff..e2d4d08ec053213029a5e128449ba6408105508f 100644 (file)
@@ -568,7 +568,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
   if (ViewDAGCombine1 || ViewLegalizeTypesDAGs || ViewLegalizeDAGs ||
       ViewDAGCombine2 || ViewDAGCombineLT || ViewISelDAGs || ViewSchedDAGs ||
       ViewSUnitDAGs)
-    BlockName = CurDAG->getMachineFunction().getFunction()->getName() + ':' +
+    BlockName = CurDAG->getMachineFunction().getFunction()->getName() + ":" +
                 BB->getBasicBlock()->getName();
 
   DOUT << "Initial selection DAG:\n";
index ee4b0b232f59f2fee7ef0965fd7df0dbfedb4fa9..cb2888025b27a2e8c248392c797d4d16076da49e 100644 (file)
@@ -993,7 +993,7 @@ void ExecutionEngine::emitGlobals() {
         // External variable reference. Try to use the dynamic loader to
         // get a pointer to it.
         if (void *SymAddr =
-            sys::DynamicLibrary::SearchForAddressOfSymbol(I->getName().c_str()))
+            sys::DynamicLibrary::SearchForAddressOfSymbol(I->getName()))
           addGlobalMapping(I, SymAddr);
         else {
           llvm_report_error("Could not resolve external global address: "
index 81be38bce51089ba4db40db7bb43e254624f74b6..dce5ebdda107d42e3ad434e14142898e7a9ae9ba 100644 (file)
@@ -686,7 +686,7 @@ void *JIT::getOrEmitGlobalVariable(const GlobalVariable *GV) {
     if (GV->getName() == "__dso_handle")
       return (void*)&__dso_handle;
 #endif
-    Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(GV->getName().c_str());
+    Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(GV->getName());
     if (Ptr == 0 && !areDlsymStubsEnabled()) {
       llvm_report_error("Could not resolve external global address: "
                         +GV->getName());
index 1cc16af4f6890489e61777ce47de4427def9673f..ce52273b0037a435f50dde15e4fbba2711b40378 100644 (file)
@@ -1432,7 +1432,7 @@ void JIT::updateDlsymStubTable() {
   SmallVector<unsigned, 8> Offsets;
   for (unsigned i = 0; i != GVs.size(); ++i) {
     Offsets.push_back(offset);
-    offset += GVs[i]->getName().length() + 1;
+    offset += GVs[i]->getName().size() + 1;
   }
   for (StringMapConstIterator<void*> i = ExtFns.begin(), e = ExtFns.end(); 
        i != e; ++i) {
index 2b2bbe24102726818b6993a15887a092b5f4ff0e..f807234f82ae0ef41c7244763d923cc1a3fb51c1 100644 (file)
@@ -185,7 +185,7 @@ bool ProfileInfoPrinterPass::runOnModule(Module &M) {
     std::cout << std::setw(3) << i+1 << ". " 
       << std::setw(5) << FunctionCounts[i].second << "/"
       << TotalExecutions << " "
-      << FunctionCounts[i].first->getName().c_str() << "\n";
+      << FunctionCounts[i].first->getName() << "\n";
   }
 
   std::set<Function*> FunctionsToPrint;
@@ -219,8 +219,8 @@ bool ProfileInfoPrinterPass::runOnModule(Module &M) {
         << Counts[i].second/(double)TotalExecutions*100 << "% "
         << std::setw(5) << Counts[i].second << "/"
         << TotalExecutions << "\t"
-        << F->getName().c_str() << "() - "
-        << Counts[i].first->getName().c_str() << "\n";
+        << F->getName() << "() - "
+        << Counts[i].first->getName() << "\n";
       FunctionsToPrint.insert(F);
     }