clang  14.0.0git
Macros | Functions
TypePrinter.cpp File Reference
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/PrettyPrinter.h"
#include "clang/AST/TemplateBase.h"
#include "clang/AST/TemplateName.h"
#include "clang/AST/Type.h"
#include "clang/Basic/AddressSpaces.h"
#include "clang/Basic/ExceptionSpecificationType.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/Specifiers.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/SaveAndRestore.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <string>
#include "clang/AST/TypeNodes.inc"
#include "clang/Basic/AttrList.inc"
Include dependency graph for TypePrinter.cpp:

Go to the source code of this file.

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 TYPE_ATTR(NAME)
 
#define DECL_OR_TYPE_ATTR(NAME)
 
#define ATTR(NAME)   case attr::NAME:
 

Functions

static void AppendTypeQualList (raw_ostream &OS, unsigned TypeQuals, bool HasRestrictKeyword)
 
static SplitQualType splitAccordingToPolicy (QualType QT, const PrintingPolicy &Policy)
 
static QualType skipTopLevelReferences (QualType T)
 
static const TemplateArgumentgetArgument (const TemplateArgument &A)
 
static const TemplateArgumentgetArgument (const TemplateArgumentLoc &A)
 
static void printArgument (const TemplateArgument &A, const PrintingPolicy &PP, llvm::raw_ostream &OS, bool IncludeType)
 
static void printArgument (const TemplateArgumentLoc &A, const PrintingPolicy &PP, llvm::raw_ostream &OS, bool IncludeType)
 
static bool isSubstitutedTemplateArgument (ASTContext &Ctx, TemplateArgument Arg, TemplateArgument Pattern, ArrayRef< TemplateArgument > Args, unsigned Depth)
 
static bool isSubstitutedType (ASTContext &Ctx, QualType T, QualType Pattern, ArrayRef< TemplateArgument > Args, unsigned Depth)
 
static bool isSubstitutedDefaultArgument (ASTContext &Ctx, TemplateArgument Arg, const NamedDecl *Param, ArrayRef< TemplateArgument > Args, unsigned Depth)
 Make a best-effort determination of whether the type T can be produced by substituting Args into the default argument of Param. More...
 
template<typename TA >
static void printTo (raw_ostream &OS, ArrayRef< TA > Args, const PrintingPolicy &Policy, const TemplateParameterList *TPL, bool IsPack, unsigned ParmIndex)
 

Macro Definition Documentation

◆ ABSTRACT_TYPE [1/3]

#define ABSTRACT_TYPE (   CLASS,
  PARENT 
)

Definition at line 128 of file TypePrinter.cpp.

◆ ABSTRACT_TYPE [2/3]

#define ABSTRACT_TYPE (   CLASS,
  PARENT 
)

Definition at line 128 of file TypePrinter.cpp.

◆ ABSTRACT_TYPE [3/3]

#define ABSTRACT_TYPE (   CLASS,
  PARENT 
)

Definition at line 128 of file TypePrinter.cpp.

◆ ATTR

#define ATTR (   NAME)    case attr::NAME:

◆ DECL_OR_TYPE_ATTR

#define DECL_OR_TYPE_ATTR (   NAME)

◆ TYPE [1/3]

#define TYPE (   CLASS,
  PARENT 
)
Value:
void print##CLASS##Before(const CLASS##Type *T, raw_ostream &OS); \
void print##CLASS##After(const CLASS##Type *T, raw_ostream &OS);

Definition at line 129 of file TypePrinter.cpp.

◆ TYPE [2/3]

#define TYPE (   CLASS,
  PARENT 
)
Value:
case Type::CLASS: \
print##CLASS##Before(cast<CLASS##Type>(T), OS); \
break;

Definition at line 129 of file TypePrinter.cpp.

◆ TYPE [3/3]

#define TYPE (   CLASS,
  PARENT 
)
Value:
case Type::CLASS: \
print##CLASS##After(cast<CLASS##Type>(T), OS); \
break;

Definition at line 129 of file TypePrinter.cpp.

◆ TYPE_ATTR

#define TYPE_ATTR (   NAME)

Function Documentation

◆ AppendTypeQualList()

static void AppendTypeQualList ( raw_ostream &  OS,
unsigned  TypeQuals,
bool  HasRestrictKeyword 
)
static

◆ getArgument() [1/2]

static const TemplateArgument& getArgument ( const TemplateArgument A)
static

Definition at line 1849 of file TypePrinter.cpp.

Referenced by clang::Sema::CheckTemplateArgumentList().

◆ getArgument() [2/2]

static const TemplateArgument& getArgument ( const TemplateArgumentLoc A)
static

Definition at line 1851 of file TypePrinter.cpp.

◆ isSubstitutedDefaultArgument()

static bool isSubstitutedDefaultArgument ( ASTContext Ctx,
TemplateArgument  Arg,
const NamedDecl Param,
ArrayRef< TemplateArgument Args,
unsigned  Depth 
)
static

Make a best-effort determination of whether the type T can be produced by substituting Args into the default argument of Param.

Definition at line 1979 of file TypePrinter.cpp.

◆ isSubstitutedTemplateArgument()

static bool isSubstitutedTemplateArgument ( ASTContext Ctx,
TemplateArgument  Arg,
TemplateArgument  Pattern,
ArrayRef< TemplateArgument Args,
unsigned  Depth 
)
static

Definition at line 1940 of file TypePrinter.cpp.

◆ isSubstitutedType()

static bool isSubstitutedType ( ASTContext Ctx,
QualType  T,
QualType  Pattern,
ArrayRef< TemplateArgument Args,
unsigned  Depth 
)
static

Definition at line 1874 of file TypePrinter.cpp.

◆ printArgument() [1/2]

static void printArgument ( const TemplateArgument A,
const PrintingPolicy PP,
llvm::raw_ostream &  OS,
bool  IncludeType 
)
static

Definition at line 1855 of file TypePrinter.cpp.

◆ printArgument() [2/2]

static void printArgument ( const TemplateArgumentLoc A,
const PrintingPolicy PP,
llvm::raw_ostream &  OS,
bool  IncludeType 
)
static

Definition at line 1860 of file TypePrinter.cpp.

◆ printTo()

template<typename TA >
static void printTo ( raw_ostream &  OS,
ArrayRef< TA >  Args,
const PrintingPolicy Policy,
const TemplateParameterList TPL,
bool  IsPack,
unsigned  ParmIndex 
)
static

Definition at line 2005 of file TypePrinter.cpp.

◆ skipTopLevelReferences()

static QualType skipTopLevelReferences ( QualType  T)
static

Definition at line 419 of file TypePrinter.cpp.

References clang::Type::getAs().

◆ splitAccordingToPolicy()

static SplitQualType splitAccordingToPolicy ( QualType  QT,
const PrintingPolicy Policy 
)
static
print
void print(llvm::raw_ostream &OS, const Pointer &P, ASTContext &Ctx, QualType Ty)
Definition: InterpFrame.cpp:62
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1490
clang::frontend::After
@ After
Like System, but searched after the system directories.
Definition: HeaderSearchOptions.h:61