[clang] [clang][NFC] Create CodeGenShared component for shared code with ClangIR (PR #157936)
Bruno Cardoso Lopes via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 12 13:06:54 PDT 2025
bcardosolopes wrote:
My take is that most of these shared helpers I've seen so far are more AST-only queries (no llvm stuff), and if we can put them under `clang/{Basic,AST}` (perhaps with a new subdir if they don't immediately look like a fit) I think that's better overall because other tools that don't do codegen can benefit from the same queries (clang-tidy, analyzer, etc). This PR sounds like of this type to me.
> In other cases the candidates for shared code will reference an IR-specific object, which may be llvm::Constant* (for example) in LLVM IR but mlir::Value in CIR. These will make sharing harder, but we might be able to figure something out with templates or some other tactic.
IMO a `CodeGenShared` would make more sense for these ones. Those require more work to refactor and make generic and right now they don't feel as pressing as the first type mentioned above.
https://github.com/llvm/llvm-project/pull/157936
More information about the cfe-commits
mailing list