clang 20.0.0git
Public Member Functions | List of all members
clang::TypeLocBuilder Class Reference

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Sema/TypeLocBuilder.h"

Public Member Functions

 TypeLocBuilder ()
 
 ~TypeLocBuilder ()
 
 TypeLocBuilder (const TypeLocBuilder &)=delete
 
TypeLocBuilderoperator= (const TypeLocBuilder &)=delete
 
void reserve (size_t Requested)
 Ensures that this buffer has at least as much capacity as described.
 
void pushFullCopy (TypeLoc L)
 Pushes a copy of the given TypeLoc onto this builder.
 
void pushTrivial (ASTContext &Context, QualType T, SourceLocation Loc)
 Pushes 'T' with all locations pointing to 'Loc'.
 
TypeSpecTypeLoc pushTypeSpec (QualType T)
 Pushes space for a typespec TypeLoc.
 
void clear ()
 Resets this builder to the newly-initialized state.
 
void TypeWasModifiedSafely (QualType T)
 Tell the TypeLocBuilder that the type it is storing has been modified in some safe way that doesn't affect type-location information.
 
template<class TyLocType >
TyLocType push (QualType T)
 Pushes space for a new TypeLoc of the given type.
 
TypeSourceInfogetTypeSourceInfo (ASTContext &Context, QualType T)
 Creates a TypeSourceInfo for the given type.
 
TypeLoc getTypeLocInContext (ASTContext &Context, QualType T)
 Copies the type-location information to the given AST context and returns a TypeLoc referring into the AST context.
 

Detailed Description

Definition at line 22 of file TypeLocBuilder.h.

Constructor & Destructor Documentation

◆ TypeLocBuilder() [1/2]

clang::TypeLocBuilder::TypeLocBuilder ( )
inline

Definition at line 47 of file TypeLocBuilder.h.

◆ ~TypeLocBuilder()

clang::TypeLocBuilder::~TypeLocBuilder ( )
inline

Definition at line 51 of file TypeLocBuilder.h.

◆ TypeLocBuilder() [2/2]

clang::TypeLocBuilder::TypeLocBuilder ( const TypeLocBuilder )
delete

Member Function Documentation

◆ clear()

void clang::TypeLocBuilder::clear ( )
inline

Resets this builder to the newly-initialized state.

Definition at line 83 of file TypeLocBuilder.h.

◆ getTypeLocInContext()

TypeLoc clang::TypeLocBuilder::getTypeLocInContext ( ASTContext Context,
QualType  T 
)
inline

Copies the type-location information to the given AST context and returns a TypeLoc referring into the AST context.

Definition at line 123 of file TypeLocBuilder.h.

References memcpy(), and clang::T.

Referenced by clang::Sema::ActOnCXXNestedNameSpecifierDecltype(), clang::Sema::ActOnCXXNestedNameSpecifierIndexedPack(), and clang::Sema::BuildCXXNestedNameSpecifier().

◆ getTypeSourceInfo()

TypeSourceInfo * clang::TypeLocBuilder::getTypeSourceInfo ( ASTContext Context,
QualType  T 
)
inline

◆ operator=()

TypeLocBuilder & clang::TypeLocBuilder::operator= ( const TypeLocBuilder )
delete

◆ push()

template<class TyLocType >
TyLocType clang::TypeLocBuilder::push ( QualType  T)
inline

◆ pushFullCopy()

void TypeLocBuilder::pushFullCopy ( TypeLoc  L)

◆ pushTrivial()

void TypeLocBuilder::pushTrivial ( ASTContext Context,
QualType  T,
SourceLocation  Loc 
)

Pushes 'T' with all locations pointing to 'Loc'.

The builder must be empty for this to work.

Definition at line 44 of file TypeLocBuilder.cpp.

References reserve(), and clang::T.

Referenced by clang::Sema::ActOnCXXNestedNameSpecifierIndexedPack(), clang::Sema::ActOnPseudoDestructorExpr(), and clang::Sema::BuildCXXNestedNameSpecifier().

◆ pushTypeSpec()

TypeSpecTypeLoc clang::TypeLocBuilder::pushTypeSpec ( QualType  T)
inline

Pushes space for a typespec TypeLoc.

Invalidates any TypeLocs previously retrieved from this builder.

Definition at line 76 of file TypeLocBuilder.h.

References clang::TypeLoc::castAs(), clang::TypeSpecTypeLoc::LocalDataAlignment, clang::TypeSpecTypeLoc::LocalDataSize, and clang::T.

Referenced by clang::Sema::BuildCXXNestedNameSpecifier(), and clang::Sema::BuildQualifiedDeclarationNameExpr().

◆ reserve()

void clang::TypeLocBuilder::reserve ( size_t  Requested)
inline

◆ TypeWasModifiedSafely()

void clang::TypeLocBuilder::TypeWasModifiedSafely ( QualType  T)
inline

Tell the TypeLocBuilder that the type it is storing has been modified in some safe way that doesn't affect type-location information.

Definition at line 94 of file TypeLocBuilder.h.

References clang::T.

Referenced by clang::TreeTransform< Derived >::TransformReferenceType(), and clang::TreeTransform< Derived >::TransformTypeWithDeducedTST().


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