[PATCH] D58463: [CUDA]Delayed diagnostics for the asm instructions.

2019-02-26 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D58463#1411086 , @tra wrote: > >> E.g.: > >> > >> namespace { > >> __host__ __device__ a() { > >> int prev; > >> __asm__ __volatile__("mov %0, 0" : "=a" (prev)::); > >> return prev; > >> } > >> > >> __hos

[PATCH] D58463: [CUDA]Delayed diagnostics for the asm instructions.

2019-02-26 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. >> E.g.: >> >> namespace { >> __host__ __device__ a() { >> int prev; >> __asm__ __volatile__("mov %0, 0" : "=a" (prev)::); >> return prev; >> } >> >> __host__ __device__ b() { >> int prev; >> return prev; >> } >> >> } //namespace >> >>

[PATCH] D58463: [CUDA]Delayed diagnostics for the asm instructions.

2019-02-26 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D58463#1411039 , @tra wrote: > > Hi Artem, I think we can just delay emission of this warning to solve this > > problem. > > I'm not sure we can always tell whether the warning is real or if it's the > consequence of failing t

[PATCH] D58463: [CUDA]Delayed diagnostics for the asm instructions.

2019-02-26 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. > Hi Artem, I think we can just delay emission of this warning to solve this > problem. I'm not sure we can always tell whether the warning is real or if it's the consequence of failing to parse inline asm. E.g.: namespace { __host__ __device__ a() { int prev;

[PATCH] D58463: [CUDA]Delayed diagnostics for the asm instructions.

2019-02-26 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D58463#1410900 , @tra wrote: > There's a new quirk we've ran into after this patch landed. Consider this > code: > > int foo() { > int prev; > __asm__ __volatile__("mov %0, 0" : "=a" (prev)::); > return prev; >

[PATCH] D58463: [CUDA]Delayed diagnostics for the asm instructions.

2019-02-26 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. There's a new quirk we've ran into after this patch landed. Consider this code: int foo() { int prev; __asm__ __volatile__("whatever" : "=a" (prev)::); return prev; } When we compile for device, asm constraint is not valid for NVPTX, we emit delayed diag and

[PATCH] D58463: [CUDA]Delayed diagnostics for the asm instructions.

2019-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL354593: [CUDA]Delayed diagnostics for the asm instructions. (authored by ABataev, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://

[PATCH] D58463: [CUDA]Delayed diagnostics for the asm instructions.

2019-02-20 Thread Artem Belevich via Phabricator via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. Thank you. Comment at: lib/Sema/Sema.cpp:1494-1496 +if (getLangOpts().CUDAIsDevice) + return CUDADiagIfDeviceCode(Loc, DiagID); +return CUDADiagIfHostCode(Loc, DiagID)

[PATCH] D58463: [CUDA]Delayed diagnostics for the asm instructions.

2019-02-20 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev created this revision. ABataev added reviewers: tra, jlebar. Herald added a subscriber: jdoerfert. Herald added a project: clang. Adapted targetDiag for the CUDA and used for the delayed diagnostics in asm constructs. Works for both host and device compilation sides. Repository: rC Cla