[llvm] [Offload] Use new error code handling mechanism (PR #139275)

Callum Fare via llvm-commits llvm-commits at lists.llvm.org
Mon May 19 08:20:33 PDT 2025


================
@@ -0,0 +1,51 @@
+//===- Auto-generated file, part of the LLVM/Offload project --------------===//
----------------
callumfare wrote:

So with the original patch that landed liboffload (#108413) we reached the decision to check in the auto-generated files. The reasons we had for doing this (in descending order of importance) were:
- The entire new Offload API header is generated. If we didn't check it in, there would be a whole standalone library intended to be used by runtimes and other users that had no headers in the repo. This seemed like it would be a major source of a confusion.
- It made it easier for reviewers to follow what the offload-tblgen tooling is doing, both in that PR and in follow up changes
- Realistically we need clang-format to ensure the autogenerated code is nicely formatted and there were some concerns that it wouldn't always be available in the build. This is also why the `OffloadGenerate` target isn't a hard dependency of the build.

There was a lot of discussion on the pros/cons of this. Obviously this isn't how tablegen is used elsewhere and it's not necessarily intuitive to other LLVM devs. It also invites situations where the `.td` files are updated but somebody forgets to check in the newest generated files (this has already happened once).

I think the latter two bullet points aren't really a big concern at this point, but the first one still is IMO.


https://github.com/llvm/llvm-project/pull/139275


More information about the llvm-commits mailing list