clangir icon indicating copy to clipboard operation
clangir copied to clipboard

MLIR based diagnostics (e.g. LifetimeChecker) should be defined using tablegen

Open inclyc opened this issue 2 years ago • 1 comments

Currently CIR uses the diagnostic engine provided by MLIR.

I wonder if CIR will migrate to the diagnostic engine of clang itself in the future? Because the existing clang diagnostic information is defined declaratively using TableGen, and has its diagnostic groups and settings (e.g. enabled by default or not).

Example:

https://github.com/llvm/clangir/blob/ee7db998b82fbd931838ff917726989d8ed9910f/clang/lib/CIR/Dialect/Transforms/LifetimeCheck.cpp#L659

Link: https://mlir.llvm.org/docs/Diagnostics/ Link: https://clang.llvm.org/docs/InternalsManual.html#the-diagnostics-subsystem

inclyc avatar Oct 10 '22 01:10 inclyc

Yes, it might be something we could be doing in the future, but probably not worth investing time right now given this will need a more broad discussion with MLIR and Clang folks as part of upstreaming ClangIR.

bcardosolopes avatar Oct 10 '22 16:10 bcardosolopes