summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-14 11:25:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-14 11:53:03 +0200
commit3ef7e85deb7afde6c9453c30be0a7893528a90a1 (patch)
tree0f4fe27737656447dcf2ea079783ab19712b84b0
parent6feb40b950557dcfdc5249f22d72edad397d4c67 (diff)
remove some dead code from unusedfields plugin
Change-Id: I268b32270a17c0c3fcf8236c3e0eebac9a57cb5d
-rw-r--r--compilerplugins/clang/unusedfields.cxx6
-rwxr-xr-xcompilerplugins/clang/unusedfields.py3
2 files changed, 0 insertions, 9 deletions
diff --git a/compilerplugins/clang/unusedfields.cxx b/compilerplugins/clang/unusedfields.cxx
index 72354f757d90..c4d5a5eaec9a 100644
--- a/compilerplugins/clang/unusedfields.cxx
+++ b/compilerplugins/clang/unusedfields.cxx
@@ -60,7 +60,6 @@ bool operator < (const MyFieldInfo &lhs, const MyFieldInfo &rhs)
// try to limit the voluminous output a little
static std::set<MyFieldInfo> touchedFromInsideSet;
-static std::set<MyFieldInfo> touchedFromConstructorSet;
static std::set<MyFieldInfo> touchedFromOutsideSet;
static std::set<MyFieldInfo> readFromSet;
static std::set<MyFieldInfo> definitionSet;
@@ -102,8 +101,6 @@ void UnusedFields::run()
std::string output;
for (const MyFieldInfo & s : touchedFromInsideSet)
output += "inside:\t" + s.parentClass + "\t" + s.fieldName + "\n";
- for (const MyFieldInfo & s : touchedFromConstructorSet)
- output += "constructor:\t" + s.parentClass + "\t" + s.fieldName + "\n";
for (const MyFieldInfo & s : touchedFromOutsideSet)
output += "outside:\t" + s.parentClass + "\t" + s.fieldName + "\n";
for (const MyFieldInfo & s : readFromSet)
@@ -489,9 +486,6 @@ void UnusedFields::checkTouchedFromOutside(const FieldDecl* fieldDecl, const Exp
// ignore move/copy operator, it's self->self
} else if (constructorDecl && (constructorDecl->isCopyConstructor() || constructorDecl->isMoveConstructor())) {
// ignore move/copy constructor, it's self->self
- } else if (constructorDecl && memberExprParentFunction->getParent() == fieldDecl->getParent()) {
- // if the field is touched from inside it's parent class constructor
- touchedFromConstructorSet.insert(fieldInfo);
} else {
if (memberExprParentFunction->getParent() == fieldDecl->getParent()) {
touchedFromInsideSet.insert(fieldInfo);
diff --git a/compilerplugins/clang/unusedfields.py b/compilerplugins/clang/unusedfields.py
index 217a6e7c8623..4e8e60fa1622 100755
--- a/compilerplugins/clang/unusedfields.py
+++ b/compilerplugins/clang/unusedfields.py
@@ -9,7 +9,6 @@ protectedAndPublicDefinitionSet = set() # set of tuple(type, name)
definitionToSourceLocationMap = dict()
definitionToTypeMap = dict()
touchedFromInsideSet = set()
-touchedFromConstructorSet = set()
readFromSet = set()
sourceLocationSet = set()
touchedFromOutsideSet = set()
@@ -48,8 +47,6 @@ with io.open("loplugin.unusedfields.log", "rb", buffering=1024*1024) as txt:
definitionToSourceLocationMap[fieldInfo] = tokens[5]
elif tokens[0] == "inside:":
touchedFromInsideSet.add(parseFieldInfo(tokens))
- elif tokens[0] == "constructor:":
- touchedFromConstructorSet.add(parseFieldInfo(tokens))
elif tokens[0] == "outside:":
touchedFromOutsideSet.add(parseFieldInfo(tokens))
elif tokens[0] == "read:":