summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmtAsm.cpp
diff options
context:
space:
mode:
authorArtem Belevich <tra@google.com>2015-04-27 19:37:53 +0000
committerArtem Belevich <tra@google.com>2015-04-27 19:37:53 +0000
commitfa62ad40872b0d85f9b9a55f0b806c910edab257 (patch)
treea84ff38123dfd0635d6cf3f876b2245558998be0 /clang/lib/Sema/SemaStmtAsm.cpp
parent0eafe5df712a0394feb8d49d629dc8bace0f292d (diff)
downloadbcm5719-llvm-fa62ad40872b0d85f9b9a55f0b806c910edab257.tar.gz
bcm5719-llvm-fa62ad40872b0d85f9b9a55f0b806c910edab257.zip
[cuda] Ignore "TLS unsupported by target" errors for host variables during device compilation.
During device-side CUDA compilation clang currently complains about all TLS variables, regardless of whether they are __host__ or __device__. This patch suppresses "TLS unsupported" errors for host variables during device compilation and for device variables during host compilation. Differential Revision: http://reviews.llvm.org/D9269 llvm-svn: 235907
Diffstat (limited to 'clang/lib/Sema/SemaStmtAsm.cpp')
-rw-r--r--clang/lib/Sema/SemaStmtAsm.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp
index 179e207e76a..9f48616ea5b 100644
--- a/clang/lib/Sema/SemaStmtAsm.cpp
+++ b/clang/lib/Sema/SemaStmtAsm.cpp
@@ -124,16 +124,8 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
// The parser verifies that there is a string literal here.
assert(AsmString->isAscii());
- bool ValidateConstraints = true;
- if (getLangOpts().CUDA) {
- // In CUDA mode don't verify asm constraints in device functions during host
- // compilation and vice versa.
- bool InDeviceMode = getLangOpts().CUDAIsDevice;
- FunctionDecl *FD = getCurFunctionDecl();
- bool IsDeviceFunction =
- FD && (FD->hasAttr<CUDADeviceAttr>() || FD->hasAttr<CUDAGlobalAttr>());
- ValidateConstraints = IsDeviceFunction == InDeviceMode;
- }
+ bool ValidateConstraints =
+ DeclAttrsMatchCUDAMode(getLangOpts(), getCurFunctionDecl());
for (unsigned i = 0; i != NumOutputs; i++) {
StringLiteral *Literal = Constraints[i];
OpenPOWER on IntegriCloud