diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-02-26 20:52:16 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-02-26 20:52:16 +0000 |
commit | ddc181d2561b14b95e7b3afbacaa0e55d16ea733 (patch) | |
tree | ed3a14cd3e7a7ffda04b321e94019ec96030dd2f /clang/lib/Sema/SemaExpr.cpp | |
parent | f9ef9f868c82646203581d8808300874066fa14a (diff) | |
download | bcm5719-llvm-ddc181d2561b14b95e7b3afbacaa0e55d16ea733.tar.gz bcm5719-llvm-ddc181d2561b14b95e7b3afbacaa0e55d16ea733.zip |
[OPENMP]Delay emission for unsupported va_arg expression.
If the OpenMP device is NVPTX and va_arg is used, delay emission of the
error for va_arg unless it is used in the device code.
llvm-svn: 354925
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 00b4cddc6b2..e91115aec5b 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -13909,6 +13909,11 @@ ExprResult Sema::BuildVAArgExpr(SourceLocation BuiltinLoc, } } + // NVPTX does not support va_arg expression. + if (getLangOpts().OpenMP && getLangOpts().OpenMPIsDevice && + Context.getTargetInfo().getTriple().isNVPTX()) + targetDiag(E->getBeginLoc(), diag::err_va_arg_in_device); + // It might be a __builtin_ms_va_list. (But don't ever mark a va_arg() // as Microsoft ABI on an actual Microsoft platform, where // __builtin_ms_va_list and __builtin_va_list are the same.) |