https://github.com/weliveindetail commented:

I still think it can be a little surprising, that returning true from a 
"PreCodeGenCallback" skips the entire backend. But I guess the relevant 
invariant is: if exit code indicates success, then one input created one 
output. And that holds, even if the callback didn't write anything. The output 
file will be empty, but it is updated on disk. So, conceptually this is fine.

The default init of the struct members is not great and it requires the ignore 
`-Wreturn-type-c-linkage`, but it prevents an API break for downstream users 
and that is more important.

It would be nice to see a symmetric "PostCodeGenCallback", but I understand 
that we have no use-case and we don't introduce things just for symmetry. We 
can still change that if we ever get NPM in codegen. Pass-plugin support in llc 
is a nice preparation for it btw.

If this lands, can we make it consistent and roll it out to all plugin users 
in-tree? (Before the end of the release cycle?) I can imagine there will be a 
few more edge-case to fix.

https://github.com/llvm/llvm-project/pull/170846
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to