clang 19.0.0git
StmtOpenACC.cpp
Go to the documentation of this file.
1//===--- StmtOpenACC.cpp - Classes for OpenACC 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//
9// This file implements the subclasses of Stmt class declared in StmtOpenACC.h
10//
11//===----------------------------------------------------------------------===//
12
15using namespace clang;
16
19 void *Mem = C.Allocate(
20 OpenACCComputeConstruct::totalSizeToAlloc<const OpenACCClause *>(
21 NumClauses));
22 auto *Inst = new (Mem) OpenACCComputeConstruct(NumClauses);
23 return Inst;
24}
25
28 SourceLocation BeginLoc, SourceLocation EndLoc,
30 Stmt *StructuredBlock) {
31 void *Mem = C.Allocate(
32 OpenACCComputeConstruct::totalSizeToAlloc<const OpenACCClause *>(
33 Clauses.size()));
34 auto *Inst = new (Mem)
35 OpenACCComputeConstruct(K, BeginLoc, EndLoc, Clauses, StructuredBlock);
36 return Inst;
37}
Defines the clang::ASTContext interface.
This file defines OpenACC AST classes for statement-level contructs.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:185
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
Definition: StmtOpenACC.h:124
static OpenACCComputeConstruct * Create(const ASTContext &C, OpenACCDirectiveKind K, SourceLocation BeginLoc, SourceLocation EndLoc, ArrayRef< const OpenACCClause * > Clauses, Stmt *StructuredBlock)
Definition: StmtOpenACC.cpp:27
static OpenACCComputeConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Definition: StmtOpenACC.cpp:18
Encodes a location in the source.
Stmt - This represents one statement.
Definition: Stmt.h:84
The JSON file list parser is used to communicate input to InstallAPI.
OpenACCDirectiveKind
Definition: OpenACCKinds.h:25