[PATCH] D100581: [Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable

Michael Benfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 16 08:24:13 PDT 2021


mbenfield added inline comments.


================
Comment at: clang/lib/Sema/SemaStmt.cpp:437
+  CompoundStmt *CS = CompoundStmt::Create(Context, Elts, L, R);
+  DiagnoseUnusedButSetVariables(CS);
+  return CS;
----------------
mbenfield wrote:
> mbenfield wrote:
> > george.burgess.iv wrote:
> > > It seems like these two warnings are doing analyses with identical requirements (e.g., the function's body must be present), but are taking two different sets of variables into account while doing so.
> > > 
> > > Is there a way we can rephrase this so we only need to walk the AST checking once for all of this?
> > I'll think about this. It might be tricky. 
> I'll implement this. It will be a fairly different approach though. 
I have this implemented. I am going to run a performance comparison on the two approaches before making a new revision here. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100581/new/

https://reviews.llvm.org/D100581



More information about the cfe-commits mailing list