nickdesaulniers added a comment.

In D106030#2878897 <https://reviews.llvm.org/D106030#2878897>, @arsenm wrote:

> 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

I interpreted this differently than @efriedma or @george.burgess.iv I think.  
Rephrasing the question as:

> Do we really need to keep the diagnostic itself in the IR?

The answer is no; we can keep it strictly in the frontend, and reconstitute 
there; we have access to the FunctionDecl which has the attribute.  So I can 
rework this instead of `"user-diagnostic"="oh no"` IR Fn Attr, to be just 
`dontcall` (in IR) then have the frontend check the FunctionDecl for the text 
of the user provided diagnostic.

But if the question was more so:

> Why do we need this?

Then I think @efriedma and @george.burgess.iv provided adequate reasoning. 
Perhaps I can reuse some of their thoughts in the commit message / patch 
description?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106030/new/

https://reviews.llvm.org/D106030

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to