[mlir] Cleanup: Fix warnings in MLIR
authorMatthias Springer <springerm@google.com>
Fri, 6 Aug 2021 01:28:12 +0000 (10:28 +0900)
committerMatthias Springer <springerm@google.com>
Fri, 6 Aug 2021 01:36:37 +0000 (10:36 +0900)
commit66b1e629d89543cb7542c184f7dfb32deee732e1
treea1d3f7c8debd195d085ca071d0c975edf5885041
parente6a3944ea9dee8ffaa318c347287027480311552
[mlir] Cleanup: Fix warnings in MLIR

Tested with gcc-10. Other compilers may generate additional warnings. This does not fix all warnings. There are a few extra ones in LLVMCore and MLIR.

* `OpEmitter::getAttrNameIndex`: -Wunused-function (function is private and not used anywhere)
* `PrintOpPass` copy constructor: -Wextra ("Base class should be explicitly initialized in the copy constructor")
* `LegalizeForLLVMExport.cpp`: -Woverflow (overflow is expected, silence warning by making the cast explicit)

Differential Revision: https://reviews.llvm.org/D107525
mlir/lib/Dialect/X86Vector/Transforms/LegalizeForLLVMExport.cpp
mlir/lib/Transforms/ViewOpGraph.cpp
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp