OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8818b8f
)
teach EscapeString and UnescapeString to handle ".
author
Chris Lattner
<sabre@nondot.org>
Wed, 15 Apr 2009 20:12:52 +0000
(20:12 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Wed, 15 Apr 2009 20:12:52 +0000
(20:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69211
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Support/StringExtras.cpp
patch
|
blob
|
history
diff --git
a/lib/Support/StringExtras.cpp
b/lib/Support/StringExtras.cpp
index
d403a08
..
1618086
100644
(file)
--- a/
lib/Support/StringExtras.cpp
+++ b/
lib/Support/StringExtras.cpp
@@
-77,6
+77,7
@@
void llvm::UnescapeString(std::string &Str) {
case 'r': Str[i] = '\r'; break;
case 't': Str[i] = '\t'; break;
case 'v': Str[i] = '\v'; break;
+ case '"': Str[i] = '\"'; break;
case '\'': Str[i] = '\''; break;
case '\\': Str[i] = '\\'; break;
}
@@
-96,6
+97,8
@@
void llvm::EscapeString(std::string &Str) {
} 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');