clang  3.9.0
Functions
SemaCUDA.cpp File Reference

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

#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/ExprCXX.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Sema.h"
#include "clang/Sema/SemaDiagnostic.h"
#include "clang/Sema/Template.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallVector.h"
Include dependency graph for SemaCUDA.cpp:

Go to the source code of this file.

Functions

template<typename T >
static void EraseUnwantedCUDAMatchesImpl (Sema &S, const FunctionDecl *Caller, llvm::SmallVectorImpl< T > &Matches, std::function< const FunctionDecl *(const T &)> FetchDecl)
 
static bool resolveCalleeCUDATargetConflict (Sema::CUDAFunctionTarget Target1, Sema::CUDAFunctionTarget Target2, Sema::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. More...
 

Detailed Description

This file implements semantic analysis for CUDA constructs.

Definition in file SemaCUDA.cpp.

Function Documentation

template<typename T >
static void EraseUnwantedCUDAMatchesImpl ( Sema S,
const FunctionDecl Caller,
llvm::SmallVectorImpl< T > &  Matches,
std::function< const FunctionDecl *(const T &)>  FetchDecl 
)
static

Definition at line 149 of file SemaCUDA.cpp.

References clang::Sema::IdentifyCUDAPreference().

static bool resolveCalleeCUDATargetConflict ( Sema::CUDAFunctionTarget  Target1,
Sema::CUDAFunctionTarget  Target2,
Sema::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 205 of file SemaCUDA.cpp.

References clang::Sema::CFT_Global, and clang::Sema::CFT_HostDevice.

Referenced by clang::Sema::inferCUDATargetForImplicitSpecialMember().