clang 22.0.0git
DeclOpenACC.cpp
Go to the documentation of this file.
1//===--- DeclOpenACC.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 Decl class declared in Decl.h
10//
11//===----------------------------------------------------------------------===//
12
15#include "clang/AST/Attr.h"
17
18using namespace clang;
19
23}
24
27 SourceLocation StartLoc, SourceLocation DirLoc,
28 SourceLocation EndLoc,
30 return new (Ctx, DC,
31 additionalSizeToAlloc<const OpenACCClause *>(Clauses.size()))
32 OpenACCDeclareDecl(DC, StartLoc, DirLoc, EndLoc, Clauses);
33}
34
37 unsigned NumClauses) {
38 return new (Ctx, ID, additionalSizeToAlloc<const OpenACCClause *>(NumClauses))
39 OpenACCDeclareDecl(NumClauses);
40}
41
44 SourceLocation StartLoc, SourceLocation DirLoc,
45 SourceLocation LParenLoc, Expr *FuncRef,
46 SourceLocation RParenLoc, SourceLocation EndLoc,
48 return new (Ctx, DC,
49 additionalSizeToAlloc<const OpenACCClause *>(Clauses.size()))
50 OpenACCRoutineDecl(DC, StartLoc, DirLoc, LParenLoc, FuncRef, RParenLoc,
51 EndLoc, Clauses);
52}
53
56 unsigned NumClauses) {
57 return new (Ctx, ID, additionalSizeToAlloc<const OpenACCClause *>(NumClauses))
58 OpenACCRoutineDecl(NumClauses);
59}
60
61void OpenACCRoutineDeclAttr::printPrettyPragma(
62 llvm::raw_ostream &OS, const clang::PrintingPolicy &P) const {
63 if (Clauses.size() > 0) {
64 OS << ' ';
65 OpenACCClausePrinter Printer{OS, P};
66 Printer.VisitClauseList(Clauses);
67 }
68}
Defines the clang::ASTContext interface.
StringRef P
This file defines OpenACC nodes for declarative directives.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:188
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1449
Kind
Lists the kind of concrete classes of Decl.
Definition: DeclBase.h:89
This represents one expression.
Definition: Expr.h:112
static bool classofKind(Kind K)
Definition: DeclOpenACC.cpp:20
static OpenACCDeclareDecl * CreateDeserialized(ASTContext &Ctx, GlobalDeclID ID, unsigned NumClauses)
Definition: DeclOpenACC.cpp:36
static bool classofKind(Kind K)
Definition: DeclOpenACC.h:100
static OpenACCDeclareDecl * Create(ASTContext &Ctx, DeclContext *DC, SourceLocation StartLoc, SourceLocation DirLoc, SourceLocation EndLoc, ArrayRef< const OpenACCClause * > Clauses)
Definition: DeclOpenACC.cpp:26
static OpenACCRoutineDecl * Create(ASTContext &Ctx, DeclContext *DC, SourceLocation StartLoc, SourceLocation DirLoc, SourceLocation LParenLoc, Expr *FuncRef, SourceLocation RParenLoc, SourceLocation EndLoc, ArrayRef< const OpenACCClause * > Clauses)
Definition: DeclOpenACC.cpp:43
static OpenACCRoutineDecl * CreateDeserialized(ASTContext &Ctx, GlobalDeclID ID, unsigned NumClauses)
Definition: DeclOpenACC.cpp:55
static bool classofKind(Kind K)
Definition: DeclOpenACC.h:145
Encodes a location in the source.
The JSON file list parser is used to communicate input to InstallAPI.
Describes how types, statements, expressions, and declarations should be printed.
Definition: PrettyPrinter.h:57