xref: /freebsd/contrib/llvm-project/clang/lib/Sema/SemaNVPTX.cpp (revision b64c5a0ace59af62eff52bfe110a521dc73c937b)
1 //===------ SemaNVPTX.cpp ------- NVPTX target-specific routines ----------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 //  This file implements semantic analysis functions specific to NVPTX.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "clang/Sema/SemaNVPTX.h"
14 #include "clang/Basic/TargetBuiltins.h"
15 #include "clang/Sema/Sema.h"
16 
17 namespace clang {
18 
19 SemaNVPTX::SemaNVPTX(Sema &S) : SemaBase(S) {}
20 
21 bool SemaNVPTX::CheckNVPTXBuiltinFunctionCall(const TargetInfo &TI,
22                                               unsigned BuiltinID,
23                                               CallExpr *TheCall) {
24   switch (BuiltinID) {
25   case NVPTX::BI__nvvm_cp_async_ca_shared_global_4:
26   case NVPTX::BI__nvvm_cp_async_ca_shared_global_8:
27   case NVPTX::BI__nvvm_cp_async_ca_shared_global_16:
28   case NVPTX::BI__nvvm_cp_async_cg_shared_global_16:
29     return SemaRef.checkArgCountAtMost(TheCall, 3);
30   }
31 
32   return false;
33 }
34 
35 } // namespace clang
36