Address post-commit review in https://reviews.llvm.org/D108524 to add appropriate diagnostics.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LG with comment!
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp | ||
---|---|---|
269–276 | In general we avoid isa->cast linkage = funcOp->getAttr("llvm.linkage") .dyn_cast<mlir::LLVM::LinkageAttr>() .getLinkage(); if (!linkage) { funcOp->emitError() << "Contains llvm.linkage attribute not of type LLVM::LinkageAttr"; return nullptr; } | |
271 | Seems above 80chars to me, can you double check this is clang-formatted? | |
mlir/test/Conversion/StandardToLLVM/convert-funcs.mlir | ||
43 | (Spurious change) |
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp | ||
---|---|---|
269–276 | You are using the result of a dyn_cast unchecked here. |
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp | ||
---|---|---|
269–276 | Grahh you're right, I went too fast here. auto linkageAttr = funcOp->getAttr("llvm.linkage").dyn_cast<mlir::LLVM::LinkageAttr>(); if (! linkageAttr) { funcOp->emitError() << "Contains llvm.linkage attribute not of type LLVM::LinkageAttr"; return nullptr; } linkage = linkageAttr.getLinkage(); or: if (auto linkageAttr = funcOp->getAttr("llvm.linkage").dyn_cast<mlir::LLVM::LinkageAttr>()) { linkage = linkageAttr.getLinkage(); } else { funcOp->emitError() << "Contains llvm.linkage attribute not of type LLVM::LinkageAttr"; return nullptr; } | |
269–276 | I see that Billy already adopted the first one, LGTM |
Seems above 80chars to me, can you double check this is clang-formatted?