]> granicus.if.org Git - clang/commit
[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)
commit8fe7051c268314081be47127f9b131e0f8925a3c
treeb1d2c790668df87b09d5dc02fc52ab146be6d7be
parentcc44eec4a2f354453ab71cf5a070b287fbcf0486
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235905 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenModule.cpp
test/CodeGenCUDA/filter-decl.cu