clang 22.0.0git
clang::CodeCompleteConsumer::OverloadCandidate Class Reference

#include "clang/Sema/CodeCompleteConsumer.h"

Public Types

enum  CandidateKind {
  CK_Function , CK_FunctionTemplate , CK_FunctionType , CK_FunctionProtoTypeLoc ,
  CK_Template , CK_Aggregate
}
 Describes the type of overload candidate. More...

Public Member Functions

 OverloadCandidate (FunctionDecl *Function)
 OverloadCandidate (FunctionTemplateDecl *FunctionTemplateDecl)
 OverloadCandidate (const FunctionType *Type)
 OverloadCandidate (FunctionProtoTypeLoc Prototype)
 OverloadCandidate (const RecordDecl *Aggregate)
 OverloadCandidate (const TemplateDecl *Template)
CandidateKind getKind () const
 Determine the kind of overload candidate.
FunctionDeclgetFunction () const
 Retrieve the function overload candidate or the templated function declaration for a function template.
FunctionTemplateDeclgetFunctionTemplate () const
 Retrieve the function template overload candidate.
const FunctionTypegetFunctionType () const
 Retrieve the function type of the entity, regardless of how the function is stored.
const FunctionProtoTypeLoc getFunctionProtoTypeLoc () const
 Retrieve the function ProtoTypeLoc candidate.
const TemplateDeclgetTemplate () const
const RecordDeclgetAggregate () const
 Retrieve the aggregate type being initialized.
unsigned getNumParams () const
 Get the number of parameters in this signature.
QualType getParamType (unsigned N) const
 Get the type of the Nth parameter.
const NamedDeclgetParamDecl (unsigned N) const
 Get the declaration of the Nth parameter.
CodeCompletionStringCreateSignatureString (unsigned CurrentArg, Sema &S, CodeCompletionAllocator &Allocator, CodeCompletionTUInfo &CCTUInfo, bool IncludeBriefComments, bool Braced) const
 Create a new code-completion string that describes the function signature of this overload candidate.

Detailed Description

Definition at line 1024 of file CodeCompleteConsumer.h.

Member Enumeration Documentation

◆ CandidateKind

Describes the type of overload candidate.

Enumerator
CK_Function 

The candidate is a function declaration.

CK_FunctionTemplate 

The candidate is a function template, arguments are being completed.

CK_FunctionType 

The "candidate" is actually a variable, expression, or block for which we only have a function prototype.

CK_FunctionProtoTypeLoc 

The candidate is a variable or expression of function type for which we have the location of the prototype declaration.

CK_Template 

The candidate is a template, template arguments are being completed.

CK_Aggregate 

The candidate is aggregate initialization of a record type.

Definition at line 1027 of file CodeCompleteConsumer.h.

Constructor & Destructor Documentation

◆ OverloadCandidate() [1/6]

clang::CodeCompleteConsumer::OverloadCandidate::OverloadCandidate ( FunctionDecl * Function)
inline

Definition at line 1080 of file CodeCompleteConsumer.h.

References CK_Function, and Function.

◆ OverloadCandidate() [2/6]

clang::CodeCompleteConsumer::OverloadCandidate::OverloadCandidate ( FunctionTemplateDecl * FunctionTemplateDecl)
inline

Definition at line 1085 of file CodeCompleteConsumer.h.

References CK_FunctionTemplate, and FunctionTemplate.

◆ OverloadCandidate() [3/6]

clang::CodeCompleteConsumer::OverloadCandidate::OverloadCandidate ( const FunctionType * Type)
inline

Definition at line 1090 of file CodeCompleteConsumer.h.

References CK_FunctionType, and Type.

◆ OverloadCandidate() [4/6]

clang::CodeCompleteConsumer::OverloadCandidate::OverloadCandidate ( FunctionProtoTypeLoc Prototype)
inline

Definition at line 1095 of file CodeCompleteConsumer.h.

References CK_FunctionProtoTypeLoc, clang::Prototype, and ProtoTypeLoc.

◆ OverloadCandidate() [5/6]

clang::CodeCompleteConsumer::OverloadCandidate::OverloadCandidate ( const RecordDecl * Aggregate)
inline

Definition at line 1100 of file CodeCompleteConsumer.h.

References clang::Aggregate, AggregateType, and CK_Aggregate.

◆ OverloadCandidate() [6/6]

clang::CodeCompleteConsumer::OverloadCandidate::OverloadCandidate ( const TemplateDecl * Template)
inline

Definition at line 1105 of file CodeCompleteConsumer.h.

References CK_Template, and Template.

Member Function Documentation

◆ CreateSignatureString()

◆ getAggregate()

const RecordDecl * clang::CodeCompleteConsumer::OverloadCandidate::getAggregate ( ) const
inline

Retrieve the aggregate type being initialized.

Definition at line 1136 of file CodeCompleteConsumer.h.

References AggregateType, CK_Aggregate, and getKind().

Referenced by CreateSignatureString().

◆ getFunction()

FunctionDecl * CodeCompleteConsumer::OverloadCandidate::getFunction ( ) const

Retrieve the function overload candidate or the templated function declaration for a function template.

Definition at line 498 of file CodeCompleteConsumer.cpp.

References CK_Function, CK_FunctionTemplate, Function, FunctionTemplate, and getKind().

Referenced by CreateSignatureString(), and getParamDecl().

◆ getFunctionProtoTypeLoc()

const FunctionProtoTypeLoc CodeCompleteConsumer::OverloadCandidate::getFunctionProtoTypeLoc ( ) const

Retrieve the function ProtoTypeLoc candidate.

This can be called for any Kind, but returns null for kinds other than CK_FunctionProtoTypeLoc.

Definition at line 531 of file CodeCompleteConsumer.cpp.

References CK_FunctionProtoTypeLoc, and ProtoTypeLoc.

Referenced by CreateSignatureString().

◆ getFunctionTemplate()

FunctionTemplateDecl * clang::CodeCompleteConsumer::OverloadCandidate::getFunctionTemplate ( ) const
inline

Retrieve the function template overload candidate.

Definition at line 1116 of file CodeCompleteConsumer.h.

References CK_FunctionTemplate, FunctionTemplate, and getKind().

◆ getFunctionType()

const FunctionType * CodeCompleteConsumer::OverloadCandidate::getFunctionType ( ) const

Retrieve the function type of the entity, regardless of how the function is stored.

Definition at line 508 of file CodeCompleteConsumer.cpp.

References CK_Aggregate, CK_Function, CK_FunctionProtoTypeLoc, CK_FunctionTemplate, CK_FunctionType, CK_Template, Function, FunctionTemplate, ProtoTypeLoc, and Type.

Referenced by CreateSignatureString(), getNumParams(), and getParamType().

◆ getKind()

CandidateKind clang::CodeCompleteConsumer::OverloadCandidate::getKind ( ) const
inline

Determine the kind of overload candidate.

Definition at line 1109 of file CodeCompleteConsumer.h.

Referenced by CreateSignatureString(), getAggregate(), getFunctionTemplate(), and getTemplate().

◆ getNumParams()

unsigned CodeCompleteConsumer::OverloadCandidate::getNumParams ( ) const

Get the number of parameters in this signature.

Definition at line 537 of file CodeCompleteConsumer.cpp.

References AggregateType, CK_Aggregate, CK_Template, getFunctionType(), and Template.

Referenced by getParamType(), and clang::SemaCodeCompletion::ProduceConstructorSignatureHelp().

◆ getParamDecl()

const NamedDecl * CodeCompleteConsumer::OverloadCandidate::getParamDecl ( unsigned N) const

Get the declaration of the Nth parameter.

Returns null if the decl is unknown or N is out of range.

Definition at line 586 of file CodeCompleteConsumer.cpp.

References AggregateType, CK_Aggregate, CK_FunctionProtoTypeLoc, CK_Template, getFunction(), clang::TemplateParameterList::getParam(), getTemplate(), ProtoTypeLoc, and clang::CodeCompletionString::size().

◆ getParamType()

QualType CodeCompleteConsumer::OverloadCandidate::getParamType ( unsigned N) const

Get the type of the Nth parameter.

Returns null if the type is unknown or N is out of range.

Definition at line 557 of file CodeCompleteConsumer.cpp.

References AggregateType, CK_Aggregate, CK_Template, getFunctionType(), getNumParams(), clang::TemplateParameterList::getParam(), getTemplate(), and clang::CodeCompletionString::size().

◆ getTemplate()

const TemplateDecl * clang::CodeCompleteConsumer::OverloadCandidate::getTemplate ( ) const
inline

Definition at line 1130 of file CodeCompleteConsumer.h.

References CK_Template, getKind(), and Template.

Referenced by CreateSignatureString(), getParamDecl(), and getParamType().

Member Data Documentation

◆ AggregateType

const RecordDecl* clang::CodeCompleteConsumer::OverloadCandidate::AggregateType

The class being aggregate-initialized, when Kind == CK_Aggregate.

Definition at line 1076 of file CodeCompleteConsumer.h.

Referenced by getAggregate(), getNumParams(), getParamDecl(), getParamType(), and OverloadCandidate().

◆ Function

FunctionDecl* clang::CodeCompleteConsumer::OverloadCandidate::Function

The function overload candidate, available when Kind == CK_Function.

Definition at line 1056 of file CodeCompleteConsumer.h.

Referenced by getFunction(), getFunctionType(), and OverloadCandidate().

◆ FunctionTemplate

FunctionTemplateDecl* clang::CodeCompleteConsumer::OverloadCandidate::FunctionTemplate

The function template overload candidate, available when Kind == CK_FunctionTemplate.

Definition at line 1060 of file CodeCompleteConsumer.h.

Referenced by getFunction(), getFunctionTemplate(), getFunctionType(), and OverloadCandidate().

◆ ProtoTypeLoc

FunctionProtoTypeLoc clang::CodeCompleteConsumer::OverloadCandidate::ProtoTypeLoc

The location of the function prototype that describes the entity being called, when Kind == CK_FunctionProtoTypeLoc.

Definition at line 1068 of file CodeCompleteConsumer.h.

Referenced by getFunctionProtoTypeLoc(), getFunctionType(), getParamDecl(), and OverloadCandidate().

◆ Template

const TemplateDecl* clang::CodeCompleteConsumer::OverloadCandidate::Template

The template overload candidate, available when Kind == CK_Template.

Definition at line 1072 of file CodeCompleteConsumer.h.

Referenced by getNumParams(), getTemplate(), and OverloadCandidate().

◆ Type

const FunctionType* clang::CodeCompleteConsumer::OverloadCandidate::Type

The function type that describes the entity being called, when Kind == CK_FunctionType.

Definition at line 1064 of file CodeCompleteConsumer.h.

Referenced by getFunctionType(), and OverloadCandidate().


The documentation for this class was generated from the following files: