clang 20.0.0git
SemaOpenCL.h
Go to the documentation of this file.
1//===----- SemaOpenCL.h --- Semantic Analysis for OpenCL constructs -------===//
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/// \file
9/// This file declares semantic analysis routines for OpenCL.
10///
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_SEMA_SEMAOPENCL_H
14#define LLVM_CLANG_SEMA_SEMAOPENCL_H
15
16#include "clang/AST/ASTFwd.h"
17#include "clang/Sema/SemaBase.h"
18
19namespace clang {
20class ParsedAttr;
21
22class SemaOpenCL : public SemaBase {
23public:
24 SemaOpenCL(Sema &S);
25
26 void handleNoSVMAttr(Decl *D, const ParsedAttr &AL);
27 void handleAccessAttr(Decl *D, const ParsedAttr &AL);
28
29 // Handles intel_reqd_sub_group_size.
30 void handleSubGroupSize(Decl *D, const ParsedAttr &AL);
31
32 // Performs semantic analysis for the read/write_pipe call.
33 // \param S Reference to the semantic analyzer.
34 // \param Call A pointer to the builtin call.
35 // \return True if a semantic error has been found, false otherwise.
37
38 // Performs a semantic analysis on the {work_group_/sub_group_
39 // /_}reserve_{read/write}_pipe
40 // \param S Reference to the semantic analyzer.
41 // \param Call The call to the builtin function to be analyzed.
42 // \return True if a semantic error was found, false otherwise.
44
46
47 // Performs a semantic analysis on {work_group_/sub_group_
48 // /_}commit_{read/write}_pipe
49 // \param S Reference to the semantic analyzer.
50 // \param Call The call to the builtin function to be analyzed.
51 // \return True if a semantic error was found, false otherwise.
53
54 // Performs a semantic analysis on the call to built-in Pipe
55 // Query Functions.
56 // \param S Reference to the semantic analyzer.
57 // \param Call The call to the builtin function to be analyzed.
58 // \return True if a semantic error was found, false otherwise.
60
61 // OpenCL v2.0 s6.13.9 - Address space qualifier functions.
62 // Performs semantic analysis for the to_global/local/private call.
63 // \param S Reference to the semantic analyzer.
64 // \param BuiltinID ID of the builtin function.
65 // \param Call A pointer to the builtin call.
66 // \return True if a semantic error has been found, false otherwise.
67 bool checkBuiltinToAddr(unsigned BuiltinID, CallExpr *Call);
68
69 /// OpenCL C v2.0, s6.13.17 - Enqueue kernel function contains four different
70 /// overload formats specified in Table 6.13.17.1.
71 /// int enqueue_kernel(queue_t queue,
72 /// kernel_enqueue_flags_t flags,
73 /// const ndrange_t ndrange,
74 /// void (^block)(void))
75 /// int enqueue_kernel(queue_t queue,
76 /// kernel_enqueue_flags_t flags,
77 /// const ndrange_t ndrange,
78 /// uint num_events_in_wait_list,
79 /// clk_event_t *event_wait_list,
80 /// clk_event_t *event_ret,
81 /// void (^block)(void))
82 /// int enqueue_kernel(queue_t queue,
83 /// kernel_enqueue_flags_t flags,
84 /// const ndrange_t ndrange,
85 /// void (^block)(local void*, ...),
86 /// uint size0, ...)
87 /// int enqueue_kernel(queue_t queue,
88 /// kernel_enqueue_flags_t flags,
89 /// const ndrange_t ndrange,
90 /// uint num_events_in_wait_list,
91 /// clk_event_t *event_wait_list,
92 /// clk_event_t *event_ret,
93 /// void (^block)(local void*, ...),
94 /// uint size0, ...)
96
97 /// OpenCL C v2.0, s6.13.17.6 - Check the argument to the
98 /// get_kernel_work_group_size
99 /// and get_kernel_preferred_work_group_size_multiple builtin functions.
101
103};
104
105} // namespace clang
106
107#endif // LLVM_CLANG_SEMA_SEMAOPENCL_H
Forward declaration of all AST node types.
const Decl * D
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2830
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
ParsedAttr - Represents a syntactic attribute.
Definition: ParsedAttr.h:129
bool checkBuiltinNDRangeAndBlock(CallExpr *TheCall)
Definition: SemaOpenCL.cpp:154
bool checkBuiltinKernelWorkGroupSize(CallExpr *TheCall)
OpenCL C v2.0, s6.13.17.6 - Check the argument to the get_kernel_work_group_size and get_kernel_prefe...
Definition: SemaOpenCL.cpp:178
bool checkBuiltinEnqueueKernel(CallExpr *TheCall)
OpenCL C v2.0, s6.13.17 - Enqueue kernel function contains four different overload formats specified ...
Definition: SemaOpenCL.cpp:239
bool checkBuiltinCommitRWPipe(CallExpr *Call)
Definition: SemaOpenCL.cpp:507
void handleSubGroupSize(Decl *D, const ParsedAttr &AL)
Definition: SemaOpenCL.cpp:79
bool checkBuiltinPipePackets(CallExpr *Call)
Definition: SemaOpenCL.cpp:525
void handleNoSVMAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaOpenCL.cpp:23
bool checkSubgroupExt(CallExpr *Call)
Definition: SemaOpenCL.cpp:138
void handleAccessAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaOpenCL.cpp:32
bool checkBuiltinToAddr(unsigned BuiltinID, CallExpr *Call)
Definition: SemaOpenCL.cpp:538
bool checkBuiltinRWPipe(CallExpr *Call)
Definition: SemaOpenCL.cpp:433
bool checkBuiltinReserveRWPipe(CallExpr *Call)
Definition: SemaOpenCL.cpp:483
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:493
The JSON file list parser is used to communicate input to InstallAPI.