Skip to content

Commit a8fb5c6

Browse files
eecksteinPopFlamingo
authored andcommitted
utils: support quoted block names in the viewcfg script
1 parent d1d3f28 commit a8fb5c6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

utils/viewcfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ class Block(object):
7777
for match in re.finditer(r'\bbb[0-9]+\b', self.last_line):
7878
self.succs.append(match.group())
7979

80-
for match in re.finditer(r'\blabel %(\S+)\b', self.last_line):
80+
it = re.finditer(r'\blabel %"?([^\s"]+)\b', self.last_line)
81+
for match in it:
8182
self.succs.append(match.group(1))
8283

8384
return self.succs
@@ -95,7 +96,7 @@ def main():
9596
block_map = {}
9697
cur_block = None
9798
sil_block_pattern = re.compile(r'^(\S+)(\(.*\))?: *(\/\/ *Preds:(.*))?$')
98-
llvm_block_pattern1 = re.compile(r'^(\S+): *; *preds =(.*)?$')
99+
llvm_block_pattern1 = re.compile(r'^"?([^\s"]+)"?: *; *preds =(.*)?$')
99100
llvm_block_pattern2 = re.compile(r'^; <label>:(\d+):? *; *preds =(.*)?$')
100101

101102
# Scan the input file.

0 commit comments

Comments
 (0)