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
auto opType = adaptor.a().getType();
Type llvmIntType = IntegerType::get(&getTypeConverter()->getContext(), 8);
// Dot product of all elements, broadcasted to all elements.
- auto attr = rewriter.getI8IntegerAttr(0xff);
+ auto attr = rewriter.getI8IntegerAttr(static_cast<int8_t>(0xff));
Value scale =
rewriter.create<LLVM::ConstantOp>(op.getLoc(), llvmIntType, attr);
rewriter.replaceOpWithNewOp<DotIntrOp>(op, opType, adaptor.a(), adaptor.b(),
class PrintOpPass : public ViewOpGraphPassBase<PrintOpPass> {
public:
PrintOpPass(raw_ostream &os) : os(os) {}
- PrintOpPass(const PrintOpPass &o) : os(o.os.getOStream()) {}
+ PrintOpPass(const PrintOpPass &o) : PrintOpPass(o.os.getOStream()) {}
void runOnOperation() override {
emitGraph([&]() {
// Generate methods for accessing the attribute names of this operation.
void genAttrNameGetters();
- // Return the index of the given attribute name. This is a relative ordering
- // for this name, used in attribute getters.
- unsigned getAttrNameIndex(StringRef attrName) const;
-
// Generates the OpAsmOpInterface for this operation if possible.
void genOpAsmInterface();
}
}
-unsigned OpEmitter::getAttrNameIndex(StringRef attrName) const {
- auto it = attributeNames.find(attrName);
- assert(it != attributeNames.end() && "expected attribute name to have been "
- "registered in genAttrNameGetters");
- return it->second;
-}
-
void OpEmitter::genAttrGetters() {
FmtContext fctx;
fctx.withBuilder("::mlir::Builder((*this)->getContext())");