summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-10-17 20:43:29 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-10-17 20:43:29 +0000
commit59449581b28440d33bdde870358bde78aaf8c157 (patch)
treef1109732f43802fe48ea927d8daa8d1e3b05119d
parent8eff29d805e32bd03ef0e14c5d25384b35498336 (diff)
downloadbcm5719-llvm-59449581b28440d33bdde870358bde78aaf8c157.tar.gz
bcm5719-llvm-59449581b28440d33bdde870358bde78aaf8c157.zip
Remove llvm::EscapeString, raw_ostream::write_escaped is much faster.
llvm-svn: 84357
-rw-r--r--llvm/include/llvm/ADT/StringExtras.h4
-rw-r--r--llvm/lib/Support/StringExtras.cpp26
2 files changed, 0 insertions, 30 deletions
diff --git a/llvm/include/llvm/ADT/StringExtras.h b/llvm/include/llvm/ADT/StringExtras.h
index 515cda4b298..76779fc3066 100644
--- a/llvm/include/llvm/ADT/StringExtras.h
+++ b/llvm/include/llvm/ADT/StringExtras.h
@@ -222,10 +222,6 @@ void SplitString(const std::string &Source,
/// \num (where num is a 1-3 byte octal value).
void UnescapeString(std::string &Str);
-/// EscapeString - Modify the argument string, turning '\\' and anything that
-/// doesn't satisfy std::isprint into an escape sequence.
-void EscapeString(std::string &Str);
-
/// HashString - Hash funtion for strings.
///
/// This is the Bernstein hash function.
diff --git a/llvm/lib/Support/StringExtras.cpp b/llvm/lib/Support/StringExtras.cpp
index 1618086e602..0a6e497f1ea 100644
--- a/llvm/lib/Support/StringExtras.cpp
+++ b/llvm/lib/Support/StringExtras.cpp
@@ -86,29 +86,3 @@ void llvm::UnescapeString(std::string &Str) {
}
}
}
-
-/// EscapeString - Modify the argument string, turning '\\' and anything that
-/// doesn't satisfy std::isprint into an escape sequence.
-void llvm::EscapeString(std::string &Str) {
- for (unsigned i = 0; i != Str.size(); ++i) {
- if (Str[i] == '\\') {
- ++i;
- Str.insert(Str.begin()+i, '\\');
- } else if (Str[i] == '\t') {
- Str[i++] = '\\';
- Str.insert(Str.begin()+i, 't');
- } else if (Str[i] == '"') {
- Str.insert(Str.begin()+i++, '\\');
- } else if (Str[i] == '\n') {
- Str[i++] = '\\';
- Str.insert(Str.begin()+i, 'n');
- } else if (!std::isprint(Str[i])) {
- // Always expand to a 3-digit octal escape.
- unsigned Char = Str[i];
- Str[i++] = '\\';
- Str.insert(Str.begin()+i++, '0'+((Char/64) & 7));
- Str.insert(Str.begin()+i++, '0'+((Char/8) & 7));
- Str.insert(Str.begin()+i , '0'+( Char & 7));
- }
- }
-}
OpenPOWER on IntegriCloud