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 void Enter(const parser::PrintStmt &);
53
54private:
55 SemanticsContext &context_;
56 int deviceConstructDepth_{0};
57};
58
59bool CanonicalizeCUDA(parser::Program &);
60
61} // namespace Fortran::semantics
62
63#endif // FORTRAN_SEMANTICS_CHECK_CUDA_H_
Definition char-block.h:28
Definition message.h:322
Definition semantics.h:67
Definition check-expression.h:19
Definition parse-tree.h:490
Definition parse-tree.h:2017
Definition parse-tree.h:5518
Definition parse-tree.h:2339
Definition parse-tree.h:523
Definition parse-tree.h:547
Definition parse-tree.h:3299
Definition parse-tree.h:2373
Definition parse-tree.h:580
Definition parse-tree.h:5431
Definition parse-tree.h:5453
Definition parse-tree.h:5472
Definition parse-tree.h:2792
Definition parse-tree.h:3325
Definition parse-tree.h:3309
Definition semantics.h:421