clang API Documentation

Defines | Enumerations | Functions
SemaOpenMP.cpp File Reference

This file implements semantic analysis for OpenMP directives and clauses. More...

#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclOpenMP.h"
#include "clang/AST/StmtCXX.h"
#include "clang/AST/StmtOpenMP.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaInternal.h"
Include dependency graph for SemaOpenMP.cpp:

Go to the source code of this file.

Defines

#define DSAStack   static_cast<DSAStackTy *>(VarDataSharingAttributesStack)

Enumerations

enum  DefaultDataSharingAttributes
 Default data sharing attributes, which can be applied to directive. More...

Functions

static void ReportOriginalDSA (Sema &SemaRef, DSAStackTy *Stack, const VarDecl *VD, DSAStackTy::DSAVarData DVar, bool IsLoopIterVar=false)
static bool CheckNestingOfRegions (Sema &SemaRef, DSAStackTy *Stack, OpenMPDirectiveKind CurrentRegion, const DeclarationNameInfo &CurrentName, SourceLocation StartLoc)
static bool CheckOpenMPIterationSpace (OpenMPDirectiveKind DKind, Stmt *S, Sema &SemaRef, DSAStackTy &DSA, unsigned CurrentNestedLoopCount, unsigned NestedLoopCount, Expr *NestedLoopCountExpr, llvm::DenseMap< VarDecl *, Expr * > &VarsWithImplicitDSA, LoopIterationSpace &ResultIterSpace)
 Called on a for stmt to check and extract its iteration space for further processing (such as collapsing).
static VarDeclBuildVarDecl (Sema &SemaRef, SourceLocation Loc, QualType Type, StringRef Name)
 Build a variable declaration for OpenMP loop iteration variable.
static ExprResult BuildCounterUpdate (Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, ExprResult Start, ExprResult Iter, ExprResult Step, bool Subtract)
 Build 'VarRef = Start + Iter * Step'.
static ExprResult WidenIterationCount (unsigned Bits, Expr *E, Sema &SemaRef)
 Convert integer expression E to make it have at least Bits bits.
static bool FitsInto (unsigned Bits, bool Signed, Expr *E, Sema &SemaRef)
 Check if the given expression E is a constant integer that fits into Bits bits.
static unsigned CheckOpenMPLoop (OpenMPDirectiveKind DKind, Expr *NestedLoopCountExpr, Stmt *AStmt, Sema &SemaRef, DSAStackTy &DSA, llvm::DenseMap< VarDecl *, Expr * > &VarsWithImplicitDSA, BuiltLoopExprs &Built)
 Called on a for stmt to check itself and nested loops (if any).
static ExprGetCollapseNumberExpr (ArrayRef< OMPClause * > Clauses)

Detailed Description

This file implements semantic analysis for OpenMP directives and clauses.

Definition in file SemaOpenMP.cpp.


Define Documentation

#define DSAStack   static_cast<DSAStackTy *>(VarDataSharingAttributesStack)

Enumeration Type Documentation

Default data sharing attributes, which can be applied to directive.

Definition at line 38 of file SemaOpenMP.cpp.


Function Documentation

static ExprResult BuildCounterUpdate ( Sema SemaRef,
Scope S,
SourceLocation  Loc,
ExprResult  VarRef,
ExprResult  Start,
ExprResult  Iter,
ExprResult  Step,
bool  Subtract 
) [static]
static VarDecl* BuildVarDecl ( Sema SemaRef,
SourceLocation  Loc,
QualType  Type,
StringRef  Name 
) [static]
static bool CheckNestingOfRegions ( Sema SemaRef,
DSAStackTy *  Stack,
OpenMPDirectiveKind  CurrentRegion,
const DeclarationNameInfo CurrentName,
SourceLocation  StartLoc 
) [static]
static bool CheckOpenMPIterationSpace ( OpenMPDirectiveKind  DKind,
Stmt S,
Sema SemaRef,
DSAStackTy &  DSA,
unsigned  CurrentNestedLoopCount,
unsigned  NestedLoopCount,
Expr NestedLoopCountExpr,
llvm::DenseMap< VarDecl *, Expr * > &  VarsWithImplicitDSA,
LoopIterationSpace &  ResultIterSpace 
) [static]
static unsigned CheckOpenMPLoop ( OpenMPDirectiveKind  DKind,
Expr NestedLoopCountExpr,
Stmt AStmt,
Sema SemaRef,
DSAStackTy &  DSA,
llvm::DenseMap< VarDecl *, Expr * > &  VarsWithImplicitDSA,
BuiltLoopExprs &  Built 
) [static]
static bool FitsInto ( unsigned  Bits,
bool  Signed,
Expr E,
Sema SemaRef 
) [static]

Check if the given expression E is a constant integer that fits into Bits bits.

Definition at line 2628 of file SemaOpenMP.cpp.

References clang::Sema::Context, and clang::Expr::isIntegerConstantExpr().

Referenced by CheckOpenMPLoop().

static Expr* GetCollapseNumberExpr ( ArrayRef< OMPClause * >  Clauses) [static]
static void ReportOriginalDSA ( Sema SemaRef,
DSAStackTy *  Stack,
const VarDecl VD,
DSAStackTy::DSAVarData  DVar,
bool  IsLoopIterVar = false 
) [static]
static ExprResult WidenIterationCount ( unsigned  Bits,
Expr E,
Sema SemaRef 
) [static]

Convert integer expression E to make it have at least Bits bits.

Definition at line 2611 of file SemaOpenMP.cpp.

References clang::Sema::AA_Converting, AttributeLangSupport::C, clang::Sema::Context, clang::ExprError(), clang::Expr::getType(), and clang::Sema::PerformImplicitConversion().

Referenced by CheckOpenMPLoop().