FLANG
check-cuda.h
1//===-- lib/Semantics/check-cuda.h ------------------------------*- C++ -*-===//
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#ifndef FORTRAN_SEMANTICS_CHECK_CUDA_H_
10#define FORTRAN_SEMANTICS_CHECK_CUDA_H_
11
12#include "flang/Semantics/semantics.h"
13#include <list>
14
15namespace Fortran::parser {
16struct Program;
17class Messages;
18struct Name;
19class CharBlock;
20struct AssignmentStmt;
23struct ActionStmt;
24struct IfConstruct;
29} // namespace Fortran::parser
30
31namespace Fortran::semantics {
32
34
35class CUDAChecker : public virtual BaseChecker {
36public:
37 explicit CUDAChecker(SemanticsContext &c) : context_{c} {}
38 void Enter(const parser::SubroutineSubprogram &);
39 void Enter(const parser::FunctionSubprogram &);
40 void Enter(const parser::SeparateModuleSubprogram &);
41 void Enter(const parser::CUFKernelDoConstruct &);
42 void Leave(const parser::CUFKernelDoConstruct &);
43 void Enter(const parser::AssignmentStmt &);
44 void Enter(const parser::OpenACCBlockConstruct &);
45 void Leave(const parser::OpenACCBlockConstruct &);
46 void Enter(const parser::OpenACCCombinedConstruct &);
47 void Leave(const parser::OpenACCCombinedConstruct &);
48 void Enter(const parser::OpenACCLoopConstruct &);
49 void Leave(const parser::OpenACCLoopConstruct &);
50 void Enter(const parser::DoConstruct &);
51 void Leave(const parser::DoConstruct &);
52
53private:
54 SemanticsContext &context_;
55 int deviceConstructDepth_{0};
56};
57
58bool CanonicalizeCUDA(parser::Program &);
59
60} // namespace Fortran::semantics
61
62#endif // FORTRAN_SEMANTICS_CHECK_CUDA_H_
Definition char-block.h:28
Definition message.h:320
Definition semantics.h:67
Definition check-expression.h:19
Definition parse-tree.h:490
Definition parse-tree.h:2016
Definition parse-tree.h:5512
Definition parse-tree.h:2338
Definition parse-tree.h:523
Definition parse-tree.h:547
Definition parse-tree.h:3298
Definition parse-tree.h:2372
Definition parse-tree.h:580
Definition parse-tree.h:5425
Definition parse-tree.h:5447
Definition parse-tree.h:5466
Definition parse-tree.h:3324
Definition parse-tree.h:3308
Definition semantics.h:421