clangir
clangir copied to clipboard
Support for `Decl::PragmaComment`
Is support for pragmas in scope for ClangIR? I was wondering if the content of a pragma could be exposed as a ClangIR attribute, maybe analogously to ASTFunctionDeclAttr
by wrapping PragmaCommentDecl
?
I'd be happy to add this if it's a good first issue.
Hi @j2kun, there are two bits of PragmaCommentDecl
that'd be interesting to implement in ClangIR:
Basically PCK_Linker
and PCK_Lib
. LLVM Codegen ignores the rest, like you can see in CodeGenModule.cpp:6464
. I'm not sure how much worth would be to implement these since they both related with ELF or metadata stuff in LLVM, but I'm happy to review any work. I guess part of the answer here is that we don't have a need yet (or usecases) for injecting the other comment kinds as something needed in CIR, do you see any other use?
Note that there are other types of pragmas which are super important: openmp's pragma omp
, clang fp contract
, etc. It'd be nice to have those working too, specially openmp. Getting all of it done is probably a larger project, but you can add incremental bits as you find time to work on stuff (and others in the community can pick up later where you stopped, etc).