SStella LaurenzoConvert MLIR IndentedOstream to header only.
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Convert MLIR IndentedOstream to header only. This class has been causing me no end of grief for a long time, and the way it is used by mlir-tblgen is technically an ODR violation in certain situations. Due to the way that the build is layered, it is important that the MLIR tablegen libraries only depend on the LLVM tablegen libraries, not on anything else (like MLIRSupport). It has to be this way because these libraries/binaries are special and must pre-exist the full shared libraries. Therefore, the dependency chain must be clean (and static). At some point, someone pulled out a separate build target for just IndendedOstream in an attempt to satisfy the constraint. But because it is weird in different ways, this target was never installed properly as part of distributions, etc -- this causes problems for downstreams seeking to build a tblggen binary that doesn't itself have ODR/shared library problems. I was attempting to fix the distribution stuff but just opted to collapse this into a header-only library and not try to solve this with build layering. I think this is the safest and the least bad thing for such a dep. This also makes for a clean comment that actually explains the constraint (which I was having trouble verbalizing with the weird subset dependency). Differential Revision: https://reviews.llvm.org/D153393 | 2 年前 | |
[mlir][tblgen] Emit deprecation warning if kEmitRawAttributes is used As discussed in https://reviews.llvm.org/D140886, emitting a warning if the old API is used may be beneficial to encourage migration to the new fold API. This reuse the existing Deprecated infrastructure within TableGen, and simply marks the def for kEmitRawAttributesFolder causing a use of it in a record (even if set within a base class) to emit a warning. Error message as printed in the terminal: `` Included from C:/llvm-project/mlir/python/mlir/dialects/TensorOps.td:13: Included from C:/llvm-project/mlir/include\mlir/Dialect/Tensor/IR/TensorOps.td:12: C:/llvm-project/mlir/include\mlir/Dialect/Tensor/IR/TensorBase.td:14:5: warning: Using deprecated def kEmitRawAttributesFolder def Tensor_Dialect : Dialect { ^ note: 'useFoldAPI' of 'kEmitRawAttributesFolder' (default) has been deprecated and is pending removal. Please switch to 'kEmitFoldAdaptorFolder'. See https://discourse.llvm.org/t/psa-new-improved-fold-method-signature-has-landed-please-update-your-downstream-projects/67618 `` Differential Revision: https://reviews.llvm.org/D141604 | 3 年前 |