clang  6.0.0svn
Classes | Namespaces | Macros | Typedefs | Functions
Type.cpp File Reference
#include "clang/AST/Type.h"
#include "Linkage.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/PrettyPrinter.h"
#include "clang/AST/TypeVisitor.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/StringExtras.h"
#include <algorithm>
#include "clang/AST/TypeNodes.def"
#include "clang/Basic/OpenCLImageTypes.def"
#include "clang/AST/BuiltinTypes.def"
Include dependency graph for Type.cpp:

Go to the source code of this file.

Classes

class  clang::TypePropertyCache< Private >
 The type-property cache. More...
 

Namespaces

 clang
 Dataflow Directional Tag Classes.
 

Macros

#define ABSTRACT_TYPE(Class, Parent)
 
#define TYPE(Class, Parent)
 
#define ABSTRACT_TYPE(Class, Parent)
 
#define TYPE(Class, Parent)
 
#define ABSTRACT_TYPE(Class, Parent)
 
#define TYPE(Class, Parent)
 
#define ABSTRACT_TYPE(Class, Parent)
 
#define TYPE(Class, Parent)
 
#define ABSTRACT_TYPE(Class, Parent)
 
#define TYPE(Class, Parent)
 
#define TYPE(Class, Base)
 
#define DEPENDENT_TYPE(Class, Base)   QualType Visit##Class##Type(const Class##Type *T) { return QualType(T, 0); }
 
#define TRIVIAL_TYPE_CLASS(Class)   QualType Visit##Class##Type(const Class##Type *T) { return QualType(T, 0); }
 
#define ABSTRACT_TYPE(Derived, Base)
 
#define TYPE(Derived, Base)   case Derived: return #Derived;
 
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)
 
#define TYPE(Class, Base)
 
#define NON_CANONICAL_TYPE(Class, Base)   case Type::Class:
 
#define TYPE(Class, Base)
 
#define DEPENDENT_TYPE(Class, Base)   case Type::Class:
 
#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base)   case Type::Class:
 
#define TYPE(Class, Base)
 
#define NON_CANONICAL_TYPE(Class, Base)   case Type::Class:
 
#define TYPE(Class, Base)
 
#define DEPENDENT_TYPE(Class, Base)   case Type::Class:
 
#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base)   case Type::Class:
 
#define NON_CANONICAL_TYPE(Class, Parent)
 
#define TYPE(Class, Parent)
 
#define SIGNED_TYPE(Id, SingletonId)   case BuiltinType::Id:
 
#define UNSIGNED_TYPE(Id, SingletonId)   case BuiltinType::Id:
 
#define FLOATING_TYPE(Id, SingletonId)   case BuiltinType::Id:
 
#define BUILTIN_TYPE(Id, SingletonId)
 
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)   case BuiltinType::Id:
 

Typedefs

typedef TypePropertyCache< Private > Cache
 

Functions

template<typename T >
static const T * getAsSugar (const Type *Cur)
 This will check for a T (which should be a Type which can act as sugar, such as a TypedefType) by removing any existing sugar until it reaches a T or a non-sugared type. More...
 
static TagDeclgetInterestingTagDecl (TagDecl *decl)
 
static CachedProperties computeCachedProperties (const Type *T)
 

Macro Definition Documentation

◆ ABSTRACT_TYPE [1/6]

#define ABSTRACT_TYPE (   Class,
  Parent 
)

◆ ABSTRACT_TYPE [2/6]

#define ABSTRACT_TYPE (   Class,
  Parent 
)

◆ ABSTRACT_TYPE [3/6]

#define ABSTRACT_TYPE (   Class,
  Parent 
)

◆ ABSTRACT_TYPE [4/6]

#define ABSTRACT_TYPE (   Class,
  Parent 
)

◆ ABSTRACT_TYPE [5/6]

#define ABSTRACT_TYPE (   Class,
  Parent 
)

◆ ABSTRACT_TYPE [6/6]

#define ABSTRACT_TYPE (   Derived,
  Base 
)

◆ BUILTIN_TYPE

#define BUILTIN_TYPE (   Id,
  SingletonId 
)

◆ DEPENDENT_TYPE [1/3]

#define DEPENDENT_TYPE (   Class,
  Base 
)    QualType Visit##Class##Type(const Class##Type *T) { return QualType(T, 0); }

Definition at line 704 of file Type.cpp.

◆ DEPENDENT_TYPE [2/3]

#define DEPENDENT_TYPE (   Class,
  Base 
)    case Type::Class:

Definition at line 704 of file Type.cpp.

◆ DEPENDENT_TYPE [3/3]

#define DEPENDENT_TYPE (   Class,
  Base 
)    case Type::Class:

Definition at line 704 of file Type.cpp.

◆ FLOATING_TYPE

#define FLOATING_TYPE (   Id,
  SingletonId 
)    case BuiltinType::Id:

◆ IMAGE_TYPE [1/2]

#define IMAGE_TYPE (   ImgType,
  Id,
  SingletonId,
  Access,
  Suffix 
)
Value:
case Id: \
return "__" #Access " " #ImgType "_t";
int Id
Definition: ASTDiff.cpp:191

◆ IMAGE_TYPE [2/2]

#define IMAGE_TYPE (   ImgType,
  Id,
  SingletonId,
  Access,
  Suffix 
)    case BuiltinType::Id:

◆ NON_CANONICAL_TYPE [1/3]

#define NON_CANONICAL_TYPE (   Class,
  Base 
)    case Type::Class:

◆ NON_CANONICAL_TYPE [2/3]

#define NON_CANONICAL_TYPE (   Class,
  Base 
)    case Type::Class:

◆ NON_CANONICAL_TYPE [3/3]

#define NON_CANONICAL_TYPE (   Class,
  Parent 
)
Value:
case Type::Class: \
llvm_unreachable("non-canonical type");

◆ NON_CANONICAL_UNLESS_DEPENDENT_TYPE [1/2]

#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE (   Class,
  Base 
)    case Type::Class:

◆ NON_CANONICAL_UNLESS_DEPENDENT_TYPE [2/2]

#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE (   Class,
  Base 
)    case Type::Class:

◆ SIGNED_TYPE

#define SIGNED_TYPE (   Id,
  SingletonId 
)    case BuiltinType::Id:

◆ TRIVIAL_TYPE_CLASS

#define TRIVIAL_TYPE_CLASS (   Class)    QualType Visit##Class##Type(const Class##Type *T) { return QualType(T, 0); }

Definition at line 708 of file Type.cpp.

◆ TYPE [1/12]

#define TYPE (   Class,
  Parent 
)
Value:
case Type::Class: { \
const Class##Type *ty = cast<Class##Type>(this); \
if (!ty->isSugared()) return QualType(ty, 0); \
return ty->desugar(); \
}
A (possibly-)qualified type.
Definition: Type.h:614
The base class of the type hierarchy.
Definition: Type.h:1300

Definition at line 703 of file Type.cpp.

◆ TYPE [2/12]

#define TYPE (   Class,
  Parent 
)
Value:
case Type::Class: { \
const Class##Type *Ty = cast<Class##Type>(CurTy); \
if (!Ty->isSugared()) \
return SplitQualType(Ty, Qs); \
Cur = Ty->desugar(); \
break; \
}
The base class of the type hierarchy.
Definition: Type.h:1300
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:557

Definition at line 703 of file Type.cpp.

◆ TYPE [3/12]

#define TYPE (   Class,
  Parent 
)
Value:
case Type::Class: { \
const Class##Type *ty = cast<Class##Type>(split.Ty); \
if (!ty->isSugared()) goto done; \
next = ty->desugar(); \
break; \
}
The base class of the type hierarchy.
Definition: Type.h:1300

Definition at line 703 of file Type.cpp.

◆ TYPE [4/12]

#define TYPE (   Class,
  Parent 
)
Value:
case Type::Class: { \
const Class##Type *Ty = cast<Class##Type>(Cur); \
if (!Ty->isSugared()) return 0; \
Cur = Ty->desugar().getTypePtr(); \
break; \
}
The base class of the type hierarchy.
Definition: Type.h:1300

Definition at line 703 of file Type.cpp.

◆ TYPE [5/12]

#define TYPE (   Class,
  Parent 
)
Value:
case Class: { \
const Class##Type *Ty = cast<Class##Type>(Cur); \
if (!Ty->isSugared()) return Cur; \
Cur = Ty->desugar().getTypePtr(); \
break; \
}
The base class of the type hierarchy.
Definition: Type.h:1300

Definition at line 703 of file Type.cpp.

◆ TYPE [6/12]

#define TYPE (   Class,
  Base 
)

Definition at line 703 of file Type.cpp.

◆ TYPE [7/12]

#define TYPE (   Derived,
  Base 
)    case Derived: return #Derived;

Definition at line 703 of file Type.cpp.

◆ TYPE [8/12]

#define TYPE (   Class,
  Base 
)

Definition at line 703 of file Type.cpp.

◆ TYPE [9/12]

#define TYPE (   Class,
  Base 
)

Definition at line 703 of file Type.cpp.

◆ TYPE [10/12]

#define TYPE (   Class,
  Base 
)

Definition at line 703 of file Type.cpp.

◆ TYPE [11/12]

#define TYPE (   Class,
  Base 
)

Definition at line 703 of file Type.cpp.

◆ TYPE [12/12]

#define TYPE (   Class,
  Parent 
)

Definition at line 703 of file Type.cpp.

◆ UNSIGNED_TYPE

#define UNSIGNED_TYPE (   Id,
  SingletonId 
)    case BuiltinType::Id:

Typedef Documentation

◆ Cache

typedef TypePropertyCache<Private> Cache

Definition at line 3362 of file Type.cpp.

Function Documentation

◆ computeCachedProperties()

static CachedProperties computeCachedProperties ( const Type T)
static

◆ getAsSugar()

template<typename T >
static const T* getAsSugar ( const Type Cur)
static

This will check for a T (which should be a Type which can act as sugar, such as a TypedefType) by removing any existing sugar until it reaches a T or a non-sugared type.

Definition at line 328 of file Type.cpp.

References clang::Type::getTypeClass().

◆ getInterestingTagDecl()

static TagDecl* getInterestingTagDecl ( TagDecl decl)
static

Definition at line 3000 of file Type.cpp.

Referenced by clang::TagType::getDecl(), and clang::InjectedClassNameType::getDecl().