clang
3.7.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
work
release_test
rc4
llvm.src
tools
clang
lib
AST
DeclOpenMP.cpp
Go to the documentation of this file.
1
//===--- DeclOpenMP.cpp - Declaration OpenMP AST Node Implementation ------===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
/// \file
10
/// \brief This file implements OMPThreadPrivateDecl class.
11
///
12
//===----------------------------------------------------------------------===//
13
14
#include "
clang/AST/ASTContext.h
"
15
#include "
clang/AST/Decl.h
"
16
#include "
clang/AST/DeclBase.h
"
17
#include "
clang/AST/DeclOpenMP.h
"
18
#include "
clang/AST/Expr.h
"
19
20
using namespace
clang;
21
22
//===----------------------------------------------------------------------===//
23
// OMPThreadPrivateDecl Implementation.
24
//===----------------------------------------------------------------------===//
25
26
void
OMPThreadPrivateDecl::anchor() { }
27
28
OMPThreadPrivateDecl
*
OMPThreadPrivateDecl::Create
(
ASTContext
&
C
,
29
DeclContext
*DC,
30
SourceLocation
L,
31
ArrayRef<Expr *>
VL) {
32
OMPThreadPrivateDecl
*D =
new
(
C
, DC, VL.size() *
sizeof
(
Expr
*))
33
OMPThreadPrivateDecl
(OMPThreadPrivate, DC, L);
34
D->NumVars = VL.size();
35
D->setVars(VL);
36
return
D;
37
}
38
39
OMPThreadPrivateDecl
*
OMPThreadPrivateDecl::CreateDeserialized
(
ASTContext
&
C
,
40
unsigned
ID
,
41
unsigned
N) {
42
OMPThreadPrivateDecl
*D =
new
(
C
,
ID
, N *
sizeof
(
Expr
*))
43
OMPThreadPrivateDecl
(OMPThreadPrivate,
nullptr
,
SourceLocation
());
44
D->NumVars = N;
45
return
D;
46
}
47
48
void
OMPThreadPrivateDecl::setVars(
ArrayRef<Expr *>
VL) {
49
assert(VL.size() == NumVars &&
50
"Number of variables is not the same as the preallocated buffer"
);
51
Expr
**Vars =
reinterpret_cast<
Expr
**
>
(
this
+ 1);
52
std::copy(VL.begin(), VL.end(), Vars);
53
}
54
ASTContext.h
Defines the clang::ASTContext interface.
clang::OMPThreadPrivateDecl::CreateDeserialized
static OMPThreadPrivateDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned N)
Definition:
DeclOpenMP.cpp:39
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition:
ASTContext.h:89
llvm::ArrayRef
Definition:
LLVM.h:31
clang::OMPThreadPrivateDecl::Create
static OMPThreadPrivateDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, ArrayRef< Expr * > VL)
Definition:
DeclOpenMP.cpp:28
clang::LangAS::ID
ID
Defines the set of possible language-specific address spaces.
Definition:
AddressSpaces.h:27
clang::Expr
Definition:
Expr.h:104
DeclBase.h
clang::SourceLocation
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
Definition:
SourceLocation.h:87
DeclOpenMP.h
This file defines OpenMP nodes for declarative directives.
Decl.h
clang::DeclContext
Definition:
DeclBase.h:1101
Expr.h
AttributeLangSupport::C
Definition:
SemaDeclAttr.cpp:39
clang::OMPThreadPrivateDecl
This represents '#pragma omp threadprivate ...' directive. For example, in the following, both 'a' and 'A::b' are threadprivate:
Definition:
DeclOpenMP.h:36
Generated on Mon Aug 31 2015 10:45:15 for clang by
1.8.6