[analyzer] exploded-graph-rewriter: Fix escaping for bitwise-or.

'|' is a special character in graphviz, so it needs to be properly
escaped and unescaped.

llvm-svn: 364269
This commit is contained in:
Artem Dergachev 2019-06-25 02:16:56 +00:00
parent beb85ad66d
commit 14f4de9bb9
2 changed files with 8 additions and 2 deletions

View File

@ -8,7 +8,7 @@
// FIXME: Substitution doesn't seem to work on Windows.
// UNSUPPORTED: system-windows
void string_region_escapes() {
void escapes() {
// CHECK: <td align="left"><b>Store: </b></td>
// CHECK-SAME: <td align="left">foo</td><td align="left">0</td>
// CHECK-SAME: <td align="left">&amp;Element\{"foo",0 S64b,char\}</td>
@ -16,4 +16,9 @@ void string_region_escapes() {
// CHECK-SAME: <td align="left">"foo"</td>
// CHECK-SAME: <td align="left">&amp;Element\{"foo",0 S64b,char\}</td>
const char *const foo = "foo";
// CHECK: <font color="cyan3">BinaryOperator</font>
// CHECK-SAME: <td align="left">1 \| 2</td>
// CHECK-SAME: <td align="left">3 S32b</td>
int x = 1 | 2;
}

View File

@ -300,6 +300,7 @@ class ExplodedGraph(object):
.replace('\\{', '{') \
.replace('\\}', '}') \
.replace('\\\\', '\\') \
.replace('\\|', '|') \
.replace('\\<', '\\\\<') \
.replace('\\>', '\\\\>') \
.rstrip(',')
@ -329,7 +330,7 @@ class DotDumpVisitor(object):
.replace('\\<', '&lt;')
.replace('\\>', '&gt;')
.replace('\\l', '<br />')
.replace('|', ''), end='')
.replace('|', '\\|'), end='')
@staticmethod
def _diff_plus_minus(is_added):