Kaydet (Commit) 0acbfd46 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin, remove unnecessary filtering in post-processing

removing things that point to the same source location is only really
necessary for the method-based analyses, the other's dont need it, and
it can hide stuff we are interested in

Change-Id: Ib5c3b4c2ed4011c158a199fcd08096285976b831
üst 40710c48
...@@ -42,18 +42,6 @@ with io.open("workdir/loplugin.constfields.log", "rb", buffering=1024*1024) as t ...@@ -42,18 +42,6 @@ with io.open("workdir/loplugin.constfields.log", "rb", buffering=1024*1024) as t
else: else:
print( "unknown line: " + line) print( "unknown line: " + line)
# Invert the definitionToSourceLocationMap
# If we see more than one method at the same sourceLocation, it's being autogenerated as part of a template
# and we should just ignore it
sourceLocationToDefinitionMap = {}
for k, v in definitionToSourceLocationMap.iteritems():
sourceLocationToDefinitionMap[v] = sourceLocationToDefinitionMap.get(v, [])
sourceLocationToDefinitionMap[v].append(k)
for k, definitions in sourceLocationToDefinitionMap.iteritems():
if len(definitions) > 1:
for d in definitions:
definitionSet.remove(d)
# Calculate can-be-const-field set # Calculate can-be-const-field set
canBeConstFieldSet = set() canBeConstFieldSet = set()
for d in definitionSet: for d in definitionSet:
......
...@@ -38,13 +38,6 @@ with io.open("workdir/loplugin.countusersofdefaultparams.log", "rb", buffering=1 ...@@ -38,13 +38,6 @@ with io.open("workdir/loplugin.countusersofdefaultparams.log", "rb", buffering=1
else: else:
print( "unknown line: " + line) print( "unknown line: " + line)
# Invert the definitionToSourceLocationMap.
sourceLocationToDefinitionMap = {}
for k, v in definitionToSourceLocationMap.iteritems():
sourceLocationToDefinitionMap[v] = sourceLocationToDefinitionMap.get(v, [])
sourceLocationToDefinitionMap[v].append(k)
tmp1list = list() tmp1list = list()
for k,v in callDict.iteritems(): for k,v in callDict.iteritems():
if len(v) >= 1: if len(v) >= 1:
......
...@@ -45,18 +45,6 @@ with io.open("workdir/loplugin.inlinefields.log", "rb", buffering=1024*1024) as ...@@ -45,18 +45,6 @@ with io.open("workdir/loplugin.inlinefields.log", "rb", buffering=1024*1024) as
else: else:
print( "unknown line: " + line) print( "unknown line: " + line)
# Invert the definitionToSourceLocationMap
# If we see more than one method at the same sourceLocation, it's being autogenerated as part of a template
# and we should just ignore it
sourceLocationToDefinitionMap = {}
for k, v in definitionToSourceLocationMap.iteritems():
sourceLocationToDefinitionMap[v] = sourceLocationToDefinitionMap.get(v, [])
sourceLocationToDefinitionMap[v].append(k)
for k, definitions in sourceLocationToDefinitionMap.iteritems():
if len(definitions) > 1:
for d in definitions:
definitionSet.remove(d)
tmp1list = list() tmp1list = list()
for d in definitionSet: for d in definitionSet:
# TODO see comment in InlineFields::VisitCXXDeleteExpr # TODO see comment in InlineFields::VisitCXXDeleteExpr
......
...@@ -56,18 +56,6 @@ with io.open("workdir/loplugin.methodcycles.log2", "rb", buffering=1024*1024) as ...@@ -56,18 +56,6 @@ with io.open("workdir/loplugin.methodcycles.log2", "rb", buffering=1024*1024) as
cnt = cnt + 1 cnt = cnt + 1
#if cnt > 100000: break #if cnt > 100000: break
# Invert the definitionToSourceLocationMap.
# If we see more than one method at the same sourceLocation, it's being autogenerated as part of a template
# and we should just ignore it.
#sourceLocationToDefinitionMap = {}
#for k, v in definitionToSourceLocationMap.iteritems():
# sourceLocationToDefinitionMap[v] = sourceLocationToDefinitionMap.get(v, [])
# sourceLocationToDefinitionMap[v].append(k)
#for k, definitions in sourceLocationToDefinitionMap.iteritems():
# if len(definitions) > 1:
# for d in definitions:
# definitionSet.remove(d)
# sort the results using a "natural order" so sequences like [item1,item2,item10] sort nicely # 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]+)')): def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
return [int(text) if text.isdigit() else text.lower() return [int(text) if text.isdigit() else text.lower()
......
...@@ -43,18 +43,6 @@ with io.open("workdir/loplugin.unusedenumconstants.log", "rb", buffering=1024*10 ...@@ -43,18 +43,6 @@ with io.open("workdir/loplugin.unusedenumconstants.log", "rb", buffering=1024*10
else: else:
print( "unknown line: " + line) print( "unknown line: " + line)
# Invert the definitionToSourceLocationMap
# If we see more than one method at the same sourceLocation, it's being autogenerated as part of a template
# and we should just ignore
sourceLocationToDefinitionMap = {}
for k, v in definitionToSourceLocationMap.iteritems():
sourceLocationToDefinitionMap[v] = sourceLocationToDefinitionMap.get(v, [])
sourceLocationToDefinitionMap[v].append(k)
for k, definitions in sourceLocationToDefinitionMap.iteritems():
if len(definitions) > 1:
for d in definitions:
definitionSet.remove(d)
def startswith_one_of( srcLoc, fileSet ): def startswith_one_of( srcLoc, fileSet ):
for f in fileSet: for f in fileSet:
if srcLoc.startswith(f): if srcLoc.startswith(f):
......
...@@ -58,18 +58,6 @@ with io.open("workdir/loplugin.unusedfields.log", "rb", buffering=1024*1024) as ...@@ -58,18 +58,6 @@ with io.open("workdir/loplugin.unusedfields.log", "rb", buffering=1024*1024) as
else: else:
print( "unknown line: " + line) print( "unknown line: " + line)
# Invert the definitionToSourceLocationMap
# If we see more than one method at the same sourceLocation, it's being autogenerated as part of a template
# and we should just ignore it
sourceLocationToDefinitionMap = {}
for k, v in definitionToSourceLocationMap.iteritems():
sourceLocationToDefinitionMap[v] = sourceLocationToDefinitionMap.get(v, [])
sourceLocationToDefinitionMap[v].append(k)
for k, definitions in sourceLocationToDefinitionMap.iteritems():
if len(definitions) > 1:
for d in definitions:
definitionSet.remove(d)
# Calculate untouched # Calculate untouched
untouchedSet = set() untouchedSet = set()
untouchedSetD = set() untouchedSetD = set()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment