[cuda] treat file scope __asm as __host__ and ignore it during device-side compilation.
authorArtem Belevich <tra@google.com>
Mon, 27 Apr 2015 18:52:00 +0000 (18:52 +0000)
committerArtem Belevich <tra@google.com>
Mon, 27 Apr 2015 18:52:00 +0000 (18:52 +0000)
commit0488d1e4ba71d364e8f11bd6837a811e32fbf5b1
tree0cd48efc28bdd8b8e113278654d4a2e2730bd4c2
parentfd8a75d73096ebc11d3231cd049c81011af12ecc
[cuda] treat file scope __asm as __host__ and ignore it during device-side compilation.

Currently clang emits file-scope asm during *both* host and device
compilation modes which is usually a wrong thing to do.

There's no way to attach any attribute to an __asm statement, so
there's no way to differentiate between host-side and device-side
file-scope asm.  This patch makes clang to match nvcc behavior and
emit file-scope-asm only during host-side compilation.

Differential Revision: http://reviews.llvm.org/D9270

llvm-svn: 235905
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGenCUDA/filter-decl.cu