summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-28 20:31:14 +0000
committerChris Lattner <sabre@nondot.org>2009-02-28 20:31:14 +0000
commit7b394e87ff4c2c6ee8cd3f52d7dd6c9f07eb8165 (patch)
tree4e266f6740f8c8bda6a077f3bce8431536770981 /llvm
parent12734717956521d2f0efaf42547da951734d583b (diff)
downloadbcm5719-llvm-7b394e87ff4c2c6ee8cd3f52d7dd6c9f07eb8165.tar.gz
bcm5719-llvm-7b394e87ff4c2c6ee8cd3f52d7dd6c9f07eb8165.zip
inline method into its only use and simplify the result.
llvm-svn: 65712
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index d07ff8f4fc7..6967cdf2216 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -125,16 +125,6 @@ static void PrintLLVMName(raw_ostream &OS, const char *NameStr,
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 @@ TypePrinting::TypePrinting(const Module *M, raw_ostream &os) : OS(os) {
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()));
}
}
OpenPOWER on IntegriCloud