summaryrefslogtreecommitdiff
path: root/compilerplugins/clang
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-21 19:13:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-23 08:16:18 +0200
commitd254f8a926d7d3ec4565d01f7a41ad3d9d7c9e87 (patch)
tree6f33b99f7344c3861972760428fb974073130d8d /compilerplugins/clang
parent7c08c1af7116346f2dc0b669e231d82f4230a8c7 (diff)
loplugin:singlevalfields improve unaryoperator
when we see a unaryoperator, unless it's one of a small set, we can know (mostly) that the field will not be written. there is still a small risk of false+ with code taking references via conditional expressions. Change-Id: I96fa808067576a50e5eaf425338e225b4e0bdd4e Reviewed-on: https://gerrit.libreoffice.org/53263 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r--compilerplugins/clang/singlevalfields.cxx4
-rw-r--r--compilerplugins/clang/singlevalfields.results38
2 files changed, 36 insertions, 6 deletions
diff --git a/compilerplugins/clang/singlevalfields.cxx b/compilerplugins/clang/singlevalfields.cxx
index eb510449b9ac..e24781e3a099 100644
--- a/compilerplugins/clang/singlevalfields.cxx
+++ b/compilerplugins/clang/singlevalfields.cxx
@@ -307,8 +307,8 @@ bool SingleValFields::VisitMemberExpr( const MemberExpr* memberExpr )
bPotentiallyAssignedTo = true;
break;
}
- child = parent;
- parent = getParentStmt(parent);
+ // cannot be assigned to anymore
+ break;
}
else if (isa<CallExpr>(parent))
{
diff --git a/compilerplugins/clang/singlevalfields.results b/compilerplugins/clang/singlevalfields.results
index 74a90ed39e47..01cb5880d1b8 100644
--- a/compilerplugins/clang/singlevalfields.results
+++ b/compilerplugins/clang/singlevalfields.results
@@ -1,9 +1,15 @@
+basic/source/inc/token.hxx:110
+ SbiTokenizer bKeywords
+ 1
chart2/source/model/main/DataPoint.hxx:107
chart::DataPoint m_bNoParentPropAllowed
0
chart2/source/view/inc/GL3DRenderer.hxx:161
chart::opengl3D::TextInfoBatch batchNum
512
+connectivity/source/inc/dbase/DIndexIter.hxx:37
+ connectivity::dbase::OIndexIterator m_pOperand
+ 0
include/basic/sbxvar.hxx:70
SbxValues::(anonymous) pData
0
@@ -19,18 +25,30 @@ include/filter/msfilter/dffpropset.hxx:35
include/o3tl/vector_pool.hxx:93
o3tl::detail::struct_from_value::type nextFree
-1
-include/sfx2/charwin.hxx:105
- SvxCharViewControl maHasInsert
+include/oox/dump/dumperbase.hxx:1661
+ oox::dump::RecordObjectBase mbBinaryOnly
+ 0
+include/oox/ole/axcontrol.hxx:427
+ oox::ole::ComCtlModelBase mbCommonPart
1
+include/oox/ole/axcontrol.hxx:428
+ oox::ole::ComCtlModelBase mbComplexPart
+ 1
+include/svtools/HtmlWriter.hxx:29
+ HtmlWriter mbContentWritten
+ 0
include/svtools/svparser.hxx:74
SvParser::TokenStackType nTokenValue
0
include/svtools/svparser.hxx:75
SvParser::TokenStackType bTokenHasValue
0
-include/svx/svdograf.hxx:107
- SdrGrafObj mbIsPreview
+include/svx/svdviter.hxx:73
+ SdrViewIter mbNoMasterPage
0
+include/tools/config.hxx:36
+ Config mnLockCount
+ 1
include/vcl/filter/pdfdocument.hxx:174
vcl::filter::PDFNameElement m_nLength
0
@@ -136,6 +154,15 @@ sw/source/filter/ww8/ww8par.hxx:655
sw/source/filter/ww8/ww8par.hxx:664
WW8FormulaControl mhpsCheckBox
20
+sw/source/uibase/inc/envlop.hxx:66
+ SwEnvDlg pAddresseeSet
+ 0
+sw/source/uibase/inc/envlop.hxx:67
+ SwEnvDlg pSenderSet
+ 0
+unotools/source/config/saveopt.cxx:77
+ SvtSaveOptions_Impl bROUserAutoSave
+ 0
vcl/inc/salprn.hxx:41
SalPrinterQueueInfo mnStatus
0
@@ -157,6 +184,9 @@ vcl/inc/svdata.hxx:285
vcl/inc/svdata.hxx:287
ImplSVNWFData mbProgressNeedsErase
0
+vcl/source/control/morebtn.cxx:26
+ ImplMoreButtonData mpItemList
+ 0
vcl/source/filter/jpeg/transupp.h:128
(anonymous) perfect
0