diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-24 11:04:21 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-24 11:04:33 +0200 |
commit | f273676325d1865bc08d9617ae2d7c736f6ff8ca (patch) | |
tree | bc6b0cd6257fffd5b54e8654d93e4def6f75dd18 /compilerplugins/clang/unusedfields.py | |
parent | c18c50cda347e239ed48f2e390f3f6a65533a3b0 (diff) |
update unusedfields plugin to use new clang warn_unused attribute support
Change-Id: I7b84de29b672e40cbf3c3d340d235f334d2be8cb
Diffstat (limited to 'compilerplugins/clang/unusedfields.py')
-rwxr-xr-x | compilerplugins/clang/unusedfields.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/compilerplugins/clang/unusedfields.py b/compilerplugins/clang/unusedfields.py index 7325175d5d3d..7fc6d4aeb2e4 100755 --- a/compilerplugins/clang/unusedfields.py +++ b/compilerplugins/clang/unusedfields.py @@ -6,6 +6,7 @@ import io definitionSet = set() definitionToSourceLocationMap = dict() +definitionToTypeMap = dict() callSet = set() sourceLocationSet = set() # things we need to exclude for reasons like : @@ -26,12 +27,14 @@ with io.open(sys.argv[1], "rb", buffering=1024*1024) as txt: if line.startswith("definition:\t"): idx1 = line.find("\t",12) idx2 = line.find("\t",idx1+1) - funcInfo = (normalizeTypeParams(line[12:idx1]), normalizeTypeParams(line[idx1+1:idx2])) + idx3 = line.find("\t",idx2+1) + funcInfo = (normalizeTypeParams(line[12:idx1]), line[idx1+1:idx2]) definitionSet.add(funcInfo) - definitionToSourceLocationMap[funcInfo] = line[idx2+1:].strip() + definitionToTypeMap[funcInfo] = line[idx2+1:idx3].strip() + definitionToSourceLocationMap[funcInfo] = line[idx3+1:].strip() elif line.startswith("touch:\t"): idx1 = line.find("\t",7) - callInfo = (normalizeTypeParams(line[7:idx1]), normalizeTypeParams(line[idx1+1:].strip())) + callInfo = (normalizeTypeParams(line[7:idx1]), line[idx1+1:].strip()) callSet.add(callInfo) # Invert the definitionToSourceLocationMap @@ -67,7 +70,7 @@ for d in definitionSet: or srcLoc.startswith("vcl/inc/unx/gtk/gloactiongroup.h")): continue - tmp1set.add((clazz, srcLoc)) + tmp1set.add((clazz + " " + definitionToTypeMap[d], srcLoc)) # sort the results using a "natural order" so sequences like [item1,item2,item10] sort nicely def natural_sort_key(s, _nsre=re.compile('([0-9]+)')): |