summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/store/unnecessaryvirtual.py
blob: e05f16c4d84a8f5aa356e76c6430e47c992ee829 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/python

import sys
import io

definitionSet = set()
overridingSet = set()


with io.open(sys.argv[1], "rb", buffering=1024*1024) as txt:
    for line in txt:
    
        if line.startswith("definition:\t"):
            idx1 = line.find("\t")
            clazzName = line[idx1+1 : len(line)-1]
            definitionSet.add(clazzName)
            
        elif line.startswith("overriding:\t"):
            idx1 = line.find("\t")
            clazzName = line[idx1+1 : len(line)-1]
            overridingSet.add(clazzName)
            
for clazz in sorted(definitionSet - overridingSet):
    print clazz

# add an empty line at the end to make it easier for the removevirtuals plugin to mmap() the output file 
print