[llvm] [Offload] Add Error Codes to PluginInterface (PR #138258)
Ross Brunton via llvm-commits
llvm-commits at lists.llvm.org
Fri May 2 05:30:05 PDT 2025
RossBrunton wrote:
I'm not sure if this is the exact design LLVM is looking for for error codes here, but it's probably worth having something to look at and discuss as a possible solution.
Basically, we have both liboffload and PluginInterface wanting to share the same error codes (to avoid converting to and from them). However, we also want these error codes to be available in the OffloadAPI.h file directly so only one file needs to be shipped to users. Further compounding this is that OffloadAPI.h is a C header, so we can't use any of the std::error_code goodness.
I've added a new tablegen target such that when offload is generating OffloadAPI.h, it also generates a OffloadErrcodes.inc file inside the plugins include dir (which ensures that they always stay in sync), which is checked into the repo like generated files.
This is a bit jank, so if anyone knows of a simpler way, let me know.
https://github.com/llvm/llvm-project/pull/138258
More information about the llvm-commits
mailing list