andykaylor wrote: > 👋 since I wrote the issue. I've been working on translating C to rust, > primarily with clang ir. I ran into some code in the wild that had the > pattern from the linked issue, and shrunk it down to what I linked there. > > My assumption was that constness should be preserved (clang-ast properly > preserves it) and that it should be the same for clang-ir side since it's > useful information if you want to look at the clang ir itself. > > If not I'm also fine to close the issue, since I do have a way around it > (transmute/fetch from the ast), and since it does cause some maintenance > burden I can understand not wanting to support this use case.
That's an interesting use case. I don't think we want to preserve all the information in the AST. We also would like to break any dependencies on the AST, since that means the CIR can't be effectively written to disk without also writing the entire AST. Why wouldn't you perform your translation directly from the AST? https://github.com/llvm/llvm-project/pull/218114 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
