[cfe-dev] [RFC] Delayed target-specific diagnostic when compiling for the devices.

John McCall via cfe-dev cfe-dev at lists.llvm.org
Wed Jan 16 09:07:39 PST 2019

On 16 Jan 2019, at 9:45, Alexey Bataev wrote:

> Yes, I thought about this. But we need to delay the diagnostic until the
> Codegen phase. What I need is the way to associate the diagnostic with
> the function so that this diagnostic is available in CodeGen.
> Also, we need to postpone the diagnotics not only for functions, but,for
> example, for some types. For example, __float128 type is not supported
> by CUDA. We can get error messages when we ran into something like
> `typedef __float128 SomeOtherType` (say, in some system header files)
> and get the error diagnostic when we compile for the device. Though,
> actually, this type is not used in the device code, the diagnostic is
> still emitted and we need to delay too and emit it only iff the type is
> used in the device code.

This is exactly what I mean.  We are not going to rewrite the compiler to
delay arbitrary diagnostics until IRGen.  You need to figure out a way to
do this that doesn't require that, and it probably starts with taking
advantage of the deferred-until-function-use infrastructure put in place
for CUDA.


More information about the cfe-dev mailing list