clang 20.0.0git
Functions
DeclCXX.cpp File Reference
#include "clang/AST/DeclCXX.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTLambda.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/ASTUnresolvedSet.h"
#include "clang/AST/Attr.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/LambdaCapture.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/ODRHash.h"
#include "clang/AST/Type.h"
#include "clang/AST/TypeLoc.h"
#include "clang/AST/UnresolvedSet.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/OperatorKinds.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Functions

static bool hasRepeatedBaseClass (const CXXRecordDecl *StartRD)
 Determine whether a class has a repeated base class.
 
static bool allLookupResultsAreTheSame (const DeclContext::lookup_result &R)
 
static NamedDeclgetLambdaCallOperatorHelper (const CXXRecordDecl &RD)
 
static DeclContext::lookup_result getLambdaStaticInvokers (const CXXRecordDecl &RD)
 
static CXXMethodDeclgetInvokerAsMethod (NamedDecl *ND)
 
static CanQualType GetConversionType (ASTContext &Context, NamedDecl *Conv)
 
static void CollectVisibleConversions (ASTContext &Context, const CXXRecordDecl *Record, bool InVirtual, AccessSpecifier Access, const llvm::SmallPtrSet< CanQualType, 8 > &ParentHiddenTypes, ASTUnresolvedSet &Output, UnresolvedSetImpl &VOutput, llvm::SmallPtrSet< NamedDecl *, 8 > &HiddenVBaseCs)
 Collect the visible conversions of a base class.
 
static void CollectVisibleConversions (ASTContext &Context, const CXXRecordDecl *Record, ASTUnresolvedSet &Output)
 Collect the visible conversions of a class.
 
static bool isDeclContextInNamespace (const DeclContext *DC)
 
static bool hasPureVirtualFinalOverrider (const CXXRecordDecl &RD, const CXXFinalOverriderMap *FinalOverriders)
 
static bool recursivelyOverrides (const CXXMethodDecl *DerivedMD, const CXXMethodDecl *BaseMD)
 
static QualType getThisObjectType (ASTContext &C, const FunctionProtoType *FPT, const CXXRecordDecl *Decl)
 
static bool isValidStructGUID (ASTContext &Ctx, QualType T)
 Determine if T is a valid 'struct _GUID' of the shape that we expect.
 
static const char * getAccessName (AccessSpecifier AS)
 

Function Documentation

◆ allLookupResultsAreTheSame()

static bool allLookupResultsAreTheSame ( const DeclContext::lookup_result R)
static

◆ CollectVisibleConversions() [1/2]

static void CollectVisibleConversions ( ASTContext Context,
const CXXRecordDecl Record,
ASTUnresolvedSet Output 
)
static

Collect the visible conversions of a class.

This would be extremely straightforward if it weren't for virtual bases. It might be worth special-casing that, really.

Definition at line 1828 of file DeclCXX.cpp.

References clang::ASTUnresolvedSet::addDecl(), clang::ASTUnresolvedSet::append(), clang::UnresolvedSetImpl::begin(), CollectVisibleConversions(), E, clang::UnresolvedSetImpl::end(), GetConversionType(), and clang::UnresolvedSetIterator::getDecl().

◆ CollectVisibleConversions() [2/2]

static void CollectVisibleConversions ( ASTContext Context,
const CXXRecordDecl Record,
bool  InVirtual,
AccessSpecifier  Access,
const llvm::SmallPtrSet< CanQualType, 8 > &  ParentHiddenTypes,
ASTUnresolvedSet Output,
UnresolvedSetImpl VOutput,
llvm::SmallPtrSet< NamedDecl *, 8 > &  HiddenVBaseCs 
)
static

Collect the visible conversions of a base class.

Parameters
Recorda base class of the class we're considering
InVirtualwhether this base class is a virtual base (or a base of a virtual base)
Accessthe access along the inheritance path to this base
ParentHiddenTypesthe conversions provided by the inheritors of this base
Outputthe set to which to add conversions from non-virtual bases
VOutputthe set to which to add conversions from virtual bases
HiddenVBaseCsthe set of conversions which were hidden in a virtual base along some inheritance path

Definition at line 1765 of file DeclCXX.cpp.

References clang::ASTUnresolvedSet::addDecl(), clang::UnresolvedSetImpl::addDecl(), CollectVisibleConversions(), GetConversionType(), and clang::CXXRecordDecl::MergeAccess().

Referenced by CollectVisibleConversions(), and clang::CXXRecordDecl::getVisibleConversionFunctions().

◆ getAccessName()

static const char * getAccessName ( AccessSpecifier  AS)
static

Definition at line 3563 of file DeclCXX.cpp.

References clang::AS_none, clang::AS_private, clang::AS_protected, and clang::AS_public.

Referenced by clang::operator<<().

◆ GetConversionType()

static CanQualType GetConversionType ( ASTContext Context,
NamedDecl Conv 
)
static

◆ getInvokerAsMethod()

static CXXMethodDecl * getInvokerAsMethod ( NamedDecl ND)
static

Definition at line 1659 of file DeclCXX.cpp.

Referenced by clang::CXXRecordDecl::getLambdaStaticInvoker().

◆ getLambdaCallOperatorHelper()

static NamedDecl * getLambdaCallOperatorHelper ( const CXXRecordDecl RD)
static

◆ getLambdaStaticInvokers()

static DeclContext::lookup_result getLambdaStaticInvokers ( const CXXRecordDecl RD)
static

◆ getThisObjectType()

static QualType getThisObjectType ( ASTContext C,
const FunctionProtoType FPT,
const CXXRecordDecl Decl 
)
static

◆ hasPureVirtualFinalOverrider()

static bool hasPureVirtualFinalOverrider ( const CXXRecordDecl RD,
const CXXFinalOverriderMap FinalOverriders 
)
static

◆ hasRepeatedBaseClass()

static bool hasRepeatedBaseClass ( const CXXRecordDecl StartRD)
static

Determine whether a class has a repeated base class.

This is intended for use when determining if a class is standard-layout, so makes no attempt to handle virtual bases.

Definition at line 176 of file DeclCXX.cpp.

References clang::CXXRecordDecl::bases(), clang::TypeDecl::getTypeForDecl(), and clang::Type::isDependentType().

Referenced by clang::CXXRecordDecl::setBases().

◆ isDeclContextInNamespace()

static bool isDeclContextInNamespace ( const DeclContext DC)
static

◆ isValidStructGUID()

static bool isValidStructGUID ( ASTContext Ctx,
QualType  T 
)
static

◆ recursivelyOverrides()

static bool recursivelyOverrides ( const CXXMethodDecl DerivedMD,
const CXXMethodDecl BaseMD 
)
static