clang  6.0.0svn
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]
Collaboration diagram for clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >:
Collaboration 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. More...
 
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 356 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

Definition at line 386 of file TypeLoc.h.

◆ 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 424 of file TypeLoc.h.

◆ getExtraLocalDataAlignment()

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

Definition at line 413 of file TypeLoc.h.

◆ getExtraLocalDataSize()

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

Definition at line 409 of file TypeLoc.h.

◆ getInnerType()

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

Definition at line 439 of file TypeLoc.h.

◆ getInnerTypeLoc()

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

Definition at line 441 of file TypeLoc.h.

◆ getLocalData()

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

Definition at line 417 of file TypeLoc.h.

◆ getLocalDataAlignment()

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

Definition at line 373 of file TypeLoc.h.

◆ getLocalDataSize()

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

Definition at line 378 of file TypeLoc.h.

◆ getNextTypeLoc()

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

Definition at line 400 of file TypeLoc.h.

Referenced by clang::ASTReader::GetTypeSourceInfo().

◆ getNonLocalData()

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

Definition at line 431 of file TypeLoc.h.

◆ 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

Definition at line 357 of file TypeLoc.h.


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