clang 22.0.0git
clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData > Class Template Reference

A metaprogramming base class for TypeLoc classes which correspond to a particular Type subclass. More...

#include "clang/AST/TypeLoc.h"

Inheritance diagram for clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >:
[legend]

Classes

struct  HasNoInnerType

Public Member Functions

unsigned getLocalDataAlignment () const
unsigned getLocalDataSize () const
void copyLocal (Derived other)
TypeLoc getNextTypeLoc () const
const TypeClass * getTypePtr () const

Protected Member Functions

unsigned getExtraLocalDataSize () const
unsigned getExtraLocalDataAlignment () const
LocalData * getLocalData () const
void * getExtraLocalData () const
 Gets a pointer past the Info structure; useful for classes with local data that can't be captured in the Info (e.g.
void * getNonLocalData () const
HasNoInnerType getInnerType () const
TypeLoc getInnerTypeLoc () const

Friends

class TypeLoc

Detailed Description

template<class Base, class Derived, class TypeClass, class LocalData>
class clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >

A metaprogramming base class for TypeLoc classes which correspond to a particular Type subclass.

It is accepted for a single TypeLoc class to correspond to multiple Type classes.

Template Parameters
Basea class from which to derive
Derivedthe class deriving from this one
TypeClassthe concrete Type subclass associated with this location type
LocalDatathe structure type of local location data for this type

TypeLocs with non-constant amounts of local data should override getExtraLocalDataSize(); getExtraLocalData() will then point to this extra memory.

TypeLocs with an inner type should define QualType getInnerType() const and getInnerTypeLoc() will then point to this inner type's location data.

A word about hierarchies: this template is not designed to be derived from multiple times in a hierarchy. It is also not designed to be used for classes where subtypes might provide different amounts of source information. It should be subclassed only at the deepest portion of the hierarchy where all children have identical source information; if that's an abstract type, then further descendents should inherit from InheritingConcreteTypeLoc instead.

Definition at line 389 of file TypeLoc.h.

Member Function Documentation

◆ copyLocal()

template<class Base, class Derived, class TypeClass, class LocalData>
void clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::copyLocal ( Derived other)
inline

◆ getExtraLocalData()

template<class Base, class Derived, class TypeClass, class LocalData>
void * clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getExtraLocalData ( ) const
inlineprotected

Gets a pointer past the Info structure; useful for classes with local data that can't be captured in the Info (e.g.

because it's of variable size).

Definition at line 458 of file TypeLoc.h.

Referenced by copyLocal().

◆ getExtraLocalDataAlignment()

template<class Base, class Derived, class TypeClass, class LocalData>
unsigned clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getExtraLocalDataAlignment ( ) const
inlineprotected

Definition at line 447 of file TypeLoc.h.

Referenced by getLocalDataAlignment().

◆ getExtraLocalDataSize()

template<class Base, class Derived, class TypeClass, class LocalData>
unsigned clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getExtraLocalDataSize ( ) const
inlineprotected

Definition at line 443 of file TypeLoc.h.

Referenced by copyLocal().

◆ getInnerType()

template<class Base, class Derived, class TypeClass, class LocalData>
HasNoInnerType clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getInnerType ( ) const
inlineprotected

Definition at line 473 of file TypeLoc.h.

Referenced by getInnerTypeLoc(), and getNextTypeLoc().

◆ getInnerTypeLoc()

template<class Base, class Derived, class TypeClass, class LocalData>
TypeLoc clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getInnerTypeLoc ( ) const
inlineprotected

Definition at line 475 of file TypeLoc.h.

References getInnerType(), getNonLocalData(), and TypeLoc.

◆ getLocalData()

template<class Base, class Derived, class TypeClass, class LocalData>
LocalData * clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getLocalData ( ) const
inlineprotected

Definition at line 451 of file TypeLoc.h.

Referenced by copyLocal().

◆ getLocalDataAlignment()

template<class Base, class Derived, class TypeClass, class LocalData>
unsigned clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getLocalDataAlignment ( ) const
inline

Definition at line 406 of file TypeLoc.h.

References getExtraLocalDataAlignment().

Referenced by getLocalDataSize().

◆ getLocalDataSize()

template<class Base, class Derived, class TypeClass, class LocalData>
unsigned clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getLocalDataSize ( ) const
inline

Definition at line 411 of file TypeLoc.h.

References getLocalDataAlignment().

Referenced by copyLocal().

◆ getNextTypeLoc()

template<class Base, class Derived, class TypeClass, class LocalData>
TypeLoc clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getNextTypeLoc ( ) const
inline

Definition at line 434 of file TypeLoc.h.

References getInnerType(), getNextTypeLoc(), and TypeLoc.

Referenced by getNextTypeLoc(), and GetTypeSourceInfoForDeclarator().

◆ getNonLocalData()

template<class Base, class Derived, class TypeClass, class LocalData>
void * clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getNonLocalData ( ) const
inlineprotected

Definition at line 465 of file TypeLoc.h.

Referenced by getInnerTypeLoc().

◆ getTypePtr()

◆ TypeLoc

template<class Base, class Derived, class TypeClass, class LocalData>
friend class TypeLoc
friend

Definition at line 390 of file TypeLoc.h.

References TypeLoc.

Referenced by getInnerTypeLoc(), getNextTypeLoc(), and TypeLoc.


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