File indexing completed on 2026-05-10 08:36:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef LLVM_CLANG_AST_STMTSYCL_H
0013 #define LLVM_CLANG_AST_STMTSYCL_H
0014
0015 #include "clang/AST/ASTContext.h"
0016 #include "clang/AST/Decl.h"
0017 #include "clang/AST/Stmt.h"
0018 #include "clang/Basic/SourceLocation.h"
0019
0020 namespace clang {
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 class SYCLKernelCallStmt : public Stmt {
0038 friend class ASTStmtReader;
0039 friend class ASTStmtWriter;
0040
0041 private:
0042 Stmt *OriginalStmt = nullptr;
0043 OutlinedFunctionDecl *OFDecl = nullptr;
0044
0045 public:
0046
0047 SYCLKernelCallStmt(CompoundStmt *CS, OutlinedFunctionDecl *OFD)
0048 : Stmt(SYCLKernelCallStmtClass), OriginalStmt(CS), OFDecl(OFD) {}
0049
0050
0051 SYCLKernelCallStmt(EmptyShell Empty) : Stmt(SYCLKernelCallStmtClass, Empty) {}
0052
0053
0054 CompoundStmt *getOriginalStmt() { return cast<CompoundStmt>(OriginalStmt); }
0055 const CompoundStmt *getOriginalStmt() const {
0056 return cast<CompoundStmt>(OriginalStmt);
0057 }
0058 void setOriginalStmt(CompoundStmt *CS) { OriginalStmt = CS; }
0059
0060
0061 OutlinedFunctionDecl *getOutlinedFunctionDecl() { return OFDecl; }
0062 const OutlinedFunctionDecl *getOutlinedFunctionDecl() const { return OFDecl; }
0063
0064
0065 void setOutlinedFunctionDecl(OutlinedFunctionDecl *OFD) { OFDecl = OFD; }
0066
0067 SourceLocation getBeginLoc() const LLVM_READONLY {
0068 return getOriginalStmt()->getBeginLoc();
0069 }
0070
0071 SourceLocation getEndLoc() const LLVM_READONLY {
0072 return getOriginalStmt()->getEndLoc();
0073 }
0074
0075 SourceRange getSourceRange() const LLVM_READONLY {
0076 return getOriginalStmt()->getSourceRange();
0077 }
0078
0079 static bool classof(const Stmt *T) {
0080 return T->getStmtClass() == SYCLKernelCallStmtClass;
0081 }
0082
0083 child_range children() {
0084 return child_range(&OriginalStmt, &OriginalStmt + 1);
0085 }
0086
0087 const_child_range children() const {
0088 return const_child_range(&OriginalStmt, &OriginalStmt + 1);
0089 }
0090 };
0091
0092 }
0093
0094 #endif