clang 22.0.0git
SemaCUDA.cpp File Reference

This file implements semantic analysis for CUDA constructs. More...

#include "clang/Sema/SemaCUDA.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/ExprCXX.h"
#include "clang/Basic/Cuda.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Overload.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/Sema.h"
#include "clang/Sema/Template.h"
#include "llvm/ADT/SmallVector.h"
#include <optional>

Go to the source code of this file.

Functions

template<typename AttrT>
static bool hasExplicitAttr (const VarDecl *D)
template<typename A>
static bool hasAttr (const Decl *D, bool IgnoreImplicitAttr)
template<typename AttrT>
static bool hasImplicitAttr (const FunctionDecl *D)
static bool resolveCalleeCUDATargetConflict (CUDAFunctionTarget Target1, CUDAFunctionTarget Target2, CUDAFunctionTarget *ResolvedTarget)
 When an implicitly-declared special member has to invoke more than one base/field special member, conflicts may occur in the targets of these members.
template<typename AttrTy>
static void copyAttrIfPresent (Sema &S, FunctionDecl *FD, const FunctionDecl &TemplateFD)

Detailed Description

This file implements semantic analysis for CUDA constructs.

Definition in file SemaCUDA.cpp.

Function Documentation

◆ copyAttrIfPresent()

template<typename AttrTy>
void copyAttrIfPresent ( Sema & S,
FunctionDecl * FD,
const FunctionDecl & TemplateFD )
static

◆ hasAttr()

◆ hasExplicitAttr()

template<typename AttrT>
bool hasExplicitAttr ( const VarDecl * D)
static

Definition at line 31 of file SemaCUDA.cpp.

References clang::Decl::getAttr().

Referenced by clang::SemaCUDA::IdentifyTarget(), and IsOverloadOrOverrideImpl().

◆ hasImplicitAttr()

template<typename AttrT>
bool hasImplicitAttr ( const FunctionDecl * D)
static

Definition at line 304 of file SemaCUDA.cpp.

References clang::Decl::getAttr(), and clang::Decl::isImplicit().

◆ resolveCalleeCUDATargetConflict()

bool resolveCalleeCUDATargetConflict ( CUDAFunctionTarget Target1,
CUDAFunctionTarget Target2,
CUDAFunctionTarget * ResolvedTarget )
static

When an implicitly-declared special member has to invoke more than one base/field special member, conflicts may occur in the targets of these members.

For example, if one base's member host and another's is device, it's a conflict. This function figures out if the given targets

Parameters
Target1and
Target2conflict, and if they do not it fills in
ResolvedTargetwith a target that resolves for both calls.
Returns
true if there's a conflict, false otherwise.

Definition at line 351 of file SemaCUDA.cpp.

References clang::Global, and clang::HostDevice.

Referenced by clang::SemaCUDA::inferTargetForImplicitSpecialMember().