Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Side by Side Diff: tools/check-name-clashes.py

Issue 1009373002: Remove BLACKLIST from check-name-clashes.py, it's wrong nowadays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/x87/code-stubs-x87.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 the V8 project authors. All rights reserved. 2 # Copyright 2014 the V8 project authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import js2c 6 import js2c
7 import os 7 import os
8 import re 8 import re
9 import sys 9 import sys
10 10
11 FILENAME = "src/runtime/runtime.h" 11 FILENAME = "src/runtime/runtime.h"
12 LISTHEAD = re.compile(r"#define\s+(\w+LIST\w*)\((\w+)\)") 12 LISTHEAD = re.compile(r"#define\s+(\w+LIST\w*)\((\w+)\)")
13 LISTBODY = re.compile(r".*\\$") 13 LISTBODY = re.compile(r".*\\$")
14 BLACKLIST = ['INLINE_FUNCTION_LIST', 'INLINE_OPTIMIZED_FUNCTION_LIST']
15 14
16 15
17 class Function(object): 16 class Function(object):
18 def __init__(self, match): 17 def __init__(self, match):
19 self.name = match.group(1).strip() 18 self.name = match.group(1).strip()
20 19
21 def ListMacroRe(list): 20 def ListMacroRe(list):
22 macro = LISTHEAD.match(list[0]).group(2) 21 macro = LISTHEAD.match(list[0]).group(2)
23 re_string = "\s*%s\((\w+)" % macro 22 re_string = "\s*%s\((\w+)" % macro
24 return re.compile(re_string) 23 return re.compile(re_string)
25 24
26 25
27 def FindLists(filename): 26 def FindLists(filename):
28 lists = [] 27 lists = []
29 current_list = [] 28 current_list = []
30 mode = "SEARCHING" 29 mode = "SEARCHING"
31 with open(filename, "r") as f: 30 with open(filename, "r") as f:
32 for line in f: 31 for line in f:
33 if mode == "SEARCHING": 32 if mode == "SEARCHING":
34 match = LISTHEAD.match(line) 33 match = LISTHEAD.match(line)
35 if match and match.group(1) not in BLACKLIST: 34 if match:
36 mode = "APPENDING" 35 mode = "APPENDING"
37 current_list.append(line) 36 current_list.append(line)
38 else: 37 else:
39 current_list.append(line) 38 current_list.append(line)
40 match = LISTBODY.match(line) 39 match = LISTBODY.match(line)
41 if not match: 40 if not match:
42 mode = "SEARCHING" 41 mode = "SEARCHING"
43 lists.append(current_list) 42 lists.append(current_list)
44 current_list = [] 43 current_list = []
45 return lists 44 return lists
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 109
111 if errors > 0: 110 if errors > 0:
112 return 1 111 return 1
113 print("Runtime/Natives name clashes: checked %d/%d functions, all good." % 112 print("Runtime/Natives name clashes: checked %d/%d functions, all good." %
114 (len(functions), len(natives))) 113 (len(functions), len(natives)))
115 return 0 114 return 0
116 115
117 116
118 if __name__ == "__main__": 117 if __name__ == "__main__":
119 sys.exit(Main()) 118 sys.exit(Main())
OLDNEW
« no previous file with comments | « src/x87/code-stubs-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698