This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Fix warnings in AttrTypeSubElements.h
ClosedPublic

Authored by bondhugula on Mar 14 2023, 6:39 PM.

Details

Summary

Fix warnings in AttrTypeSubElements.h (below) with GCC 9.4.0.

mlir/lib/IR/ExtensibleDialect.cpp:443:62:   required from here
mlir/include/mlir/IR/AttrTypeSubElements.h:412:37: warning: parameter ‘derived’ set but not used [-Wunused-but-set-parameter]
  412 | void walkImmediateSubElementsImpl(T derived,
      |                                   ~~^~~

Diff Detail

Event Timeline

bondhugula created this revision.Mar 14 2023, 6:39 PM
bondhugula requested review of this revision.Mar 14 2023, 6:39 PM

Drop extra braces + else nearly.

mehdi_amini accepted this revision.Mar 15 2023, 3:42 AM
mehdi_amini added inline comments.
mlir/include/mlir/IR/AttrTypeSubElements.h
418

Can you mention the warning in the description, I really don't know why gcc could want this for function arg but I'm curious.

This revision is now accepted and ready to land.Mar 15 2023, 3:42 AM
bondhugula edited the summary of this revision. (Show Details)

Update commit summary.

bondhugula marked an inline comment as done.Mar 19 2023, 7:44 PM
bondhugula added inline comments.
mlir/include/mlir/IR/AttrTypeSubElements.h
418

Sure - I see warnings like these:

/home/uday/llvm-project-upstream/mlir/lib/IR/ExtensibleDialect.cpp:443:62:   required from here
/home/uday/llvm-project-upstream/mlir/include/mlir/IR/AttrTypeSubElements.h:412:37: warning: parameter ‘derived’ set but not used [-Wunused-but-set-parameter]
  412 | void walkImmediateSubElementsImpl(T derived,
      |                                   ~~^~~~~~~
/home/uday/llvm-project-upstream/mlir/include/mlir/IR/AttrTypeSubElements.h:413:65: warning: parameter ‘walkAttrsFn’ set but not used [-Wunused-but-set-parameter]
  413 |                                   function_ref<void(Attribute)> walkAttrsFn,
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/home/uday/llvm-project-upstream/mlir/include/mlir/IR/AttrTypeSubElements.h:414:60: warning: parameter ‘walkTypesFn’ set but not used [-Wunused-but-set-parameter]
  414 |                                   function_ref<void(Type)> walkTypesFn) {
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
bondhugula edited the summary of this revision. (Show Details)Mar 19 2023, 7:44 PM
This revision was automatically updated to reflect the committed changes.
bondhugula marked an inline comment as done.