[PATCH] D106030: [Clang] add support for error+warning fn attrs
George Burgess IV via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 15 12:12:37 PDT 2021
george.burgess.iv added a comment.
> Adding something to the IR for the sole purpose of producing a diagnostic feels really weird. I'm not sure I see why the frontend can't see this attribute and directly warn
To add a bit more clarification, the goal of this attribute is specifically to emit diagnostics after optimizations such as inlining have taken place. `diagnose_if` is clang's hammer if we want frontend diagnostics: https://godbolt.org/z/jbzbqEzbG . `diagnose_if` is a bit more flexible than "the condition must be an ICE per the standard," but AIUI the kernel has code like what Eli mentioned, which clang currently can't work with in the frontend (since it requires inlining, etc etc).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106030/new/
https://reviews.llvm.org/D106030
More information about the llvm-commits
mailing list