forked from OSchip/llvm-project
931939bf92
When compiling CUDA or OpenMP device code Clang parses header files that expect certain predefined macros from the host architecture. To make this work the compiler passes the host triple via the -aux-triple argument and (until now) pulls in all macros for that "auxiliary triple" unconditionally. However this results in defines like __SSE_MATH__ that will trigger inline assembly making use of the "advertised" target features. See the discussion of D47849 and PR38464 for a detailed explanation of the encountered problems. Instead of blacklisting "known bad" examples this patch starts adding defines that are needed for certain headers like bits/wordsize.h and bits/mathinline.h. The disadvantage of this approach is that it decouples the definitions from their target toolchain. However in my opinion it's more important to keep definitions for one header close together. For one this will include a clear documentation why these particular defines are needed. Furthermore it simplifies maintenance because adding defines for a new header or support for a new aux-triple only needs to touch one piece of code. Differential Revision: https://reviews.llvm.org/D50845 llvm-svn: 340681 |
||
---|---|---|
.. | ||
Inputs | ||
add-inline-in-definition.cu | ||
addr-of-overloaded-fn.cu | ||
alias.cu | ||
amdgpu-attrs.cu | ||
asm-constraints-device.cu | ||
asm-constraints-mixed.cu | ||
attr-declspec.cu | ||
attributes-on-non-cuda.cu | ||
bad-attributes.cu | ||
bad-calls-on-same-line.cu | ||
builtins.cu | ||
call-device-fn-from-host.cu | ||
call-host-fn-from-device.cu | ||
call-stack-for-deferred-err.cu | ||
config-type.cu | ||
cuda-builtin-vars.cu | ||
cuda-inherits-calling-conv.cu | ||
cxx11-kernel-call.cu | ||
device-var-init.cu | ||
error-includes-mode.cu | ||
exceptions.cu | ||
extern-shared.cu | ||
function-overload.cu | ||
function-target.cu | ||
function-template-overload.cu | ||
global-initializers-host.cu | ||
gnu-inline.cu | ||
host-device-constexpr.cu | ||
implicit-copy.cu | ||
implicit-device-lambda.cu | ||
implicit-intrinsic.cu | ||
implicit-member-target-collision-cxx11.cu | ||
implicit-member-target-collision.cu | ||
implicit-member-target.cu | ||
kernel-call.cu | ||
launch_bounds.cu | ||
lit.local.cfg | ||
method-target.cu | ||
no-call-stack-for-immediate-errs.cu | ||
no-destructor-overload.cu | ||
no-host-device-constexpr.cu | ||
overloaded-delete.cu | ||
pr27778.cu | ||
qualifiers.cu | ||
reference-to-kernel-fn.cu | ||
trace-through-global.cu | ||
vararg.cu | ||
vla.cu |