diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-02-21 16:40:21 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-02-21 16:40:21 +0000 |
commit | 12a21e4b69d4f156490cc82bee3d4b28368b4840 (patch) | |
tree | 700cbecd3b3454b7cbba3dcb5a45afca9678d66e /clang/lib/Sema/SemaStmtAsm.cpp | |
parent | 43a7600a7f6b76230a2c699be8772974d6b18322 (diff) | |
download | bcm5719-llvm-12a21e4b69d4f156490cc82bee3d4b28368b4840.tar.gz bcm5719-llvm-12a21e4b69d4f156490cc82bee3d4b28368b4840.zip |
Revert "[CUDA]Delayed diagnostics for the asm instructions."
This reverts commit r354593 to fix the problem with the crash on
windows.
llvm-svn: 354596
Diffstat (limited to 'clang/lib/Sema/SemaStmtAsm.cpp')
-rw-r--r-- | clang/lib/Sema/SemaStmtAsm.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp index e1ea3b66463..0848ed4ceae 100644 --- a/clang/lib/Sema/SemaStmtAsm.cpp +++ b/clang/lib/Sema/SemaStmtAsm.cpp @@ -253,6 +253,15 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple, // The parser verifies that there is a string literal here. assert(AsmString->isAscii()); + // If we're compiling CUDA file and function attributes indicate that it's not + // for this compilation side, skip all the checks. + if (!DeclAttrsMatchCUDAMode(getLangOpts(), getCurFunctionDecl())) { + GCCAsmStmt *NS = new (Context) GCCAsmStmt( + Context, AsmLoc, IsSimple, IsVolatile, NumOutputs, NumInputs, Names, + Constraints, Exprs.data(), AsmString, NumClobbers, Clobbers, RParenLoc); + return NS; + } + for (unsigned i = 0; i != NumOutputs; i++) { StringLiteral *Literal = Constraints[i]; assert(Literal->isAscii()); |