[llvm-commits] [llvm] r65712 - /llvm/trunk/lib/VMCore/AsmWriter.cpp

Chris Lattner sabre at nondot.org
Sat Feb 28 12:31:14 PST 2009


Author: lattner
Date: Sat Feb 28 14:31:14 2009
New Revision: 65712

URL: http://llvm.org/viewvc/llvm-project?rev=65712&view=rev
Log:
inline method into its only use and simplify the result.

Modified:
    llvm/trunk/lib/VMCore/AsmWriter.cpp

Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=65712&r1=65711&r2=65712&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Sat Feb 28 14:31:14 2009
@@ -125,16 +125,6 @@
   OS << '"';
 }
 
-/// getLLVMName - Turn the specified string into an 'LLVM name', which is
-/// surrounded with ""'s and escaped if it has special chars in it.
-static std::string getLLVMName(const std::string &Name) {
-  assert(!Name.empty() && "Cannot get empty name!");
-  std::string result;
-  raw_string_ostream OS(result);
-  PrintLLVMName(OS, Name.c_str(), Name.length(), NoPrefix);
-  return OS.str();
-}
-
 /// PrintLLVMName - Turn the specified name into an 'LLVM name', which is either
 /// prefixed with % (if the string only contains simple characters) or is
 /// surrounded with ""'s (if it has special chars in it).  Print it out.
@@ -179,7 +169,10 @@
         continue;
     }
     
-    TypeNames.insert(std::make_pair(Ty, '%' + getLLVMName(TI->first)));
+    std::string NameStr;
+    raw_string_ostream NameOS(NameStr);
+    PrintLLVMName(NameOS, TI->first.c_str(), TI->first.length(), LocalPrefix);
+    TypeNames.insert(std::make_pair(Ty, NameOS.str()));
   }
 }
 





More information about the llvm-commits mailing list