clang 20.0.0git
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
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 >:
Inheritance graph
[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 373 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 441 of file TypeLoc.h.

Referenced by clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::copyLocal().

◆ getExtraLocalDataAlignment()

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

◆ getExtraLocalDataSize()

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

◆ getInnerType()

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

◆ getInnerTypeLoc()

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

◆ getLocalData()

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

◆ getLocalDataAlignment()

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

◆ getLocalDataSize()

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

◆ getNextTypeLoc()

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

◆ getNonLocalData()

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

◆ getTypePtr()

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

Friends And Related Function Documentation

◆ TypeLoc

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

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