clang  13.0.0git
Macros | Functions
ItaniumMangle.cpp File Reference
#include "clang/AST/Mangle.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclOpenMP.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprConcepts.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/TypeLoc.h"
#include "clang/Basic/ABI.h"
#include "clang/Basic/Module.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "clang/AST/TypeNodes.inc"
#include "clang/AST/BuiltinTypes.def"
#include "clang/Basic/OpenCLImageTypes.def"
#include "clang/Basic/OpenCLExtensionTypes.def"
#include "clang/Basic/AArch64SVEACLETypes.def"
#include "clang/Basic/PPCTypes.def"
#include "clang/Basic/RISCVVTypes.def"
#include "clang/AST/StmtNodes.inc"
Include dependency graph for ItaniumMangle.cpp:

Go to the source code of this file.

Macros

#define ABSTRACT_TYPE(CLASS, PARENT)
 
#define NON_CANONICAL_TYPE(CLASS, PARENT)
 
#define TYPE(CLASS, PARENT)   void mangleType(const CLASS##Type *T);
 
#define ABSTRACT_TYPE(CLASS, PARENT)
 
#define NON_CANONICAL_TYPE(CLASS, PARENT)
 
#define TYPE(CLASS, PARENT)
 
#define BUILTIN_TYPE(Id, SingletonId)
 
#define PLACEHOLDER_TYPE(Id, SingletonId)   case BuiltinType::Id:
 
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)
 
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext)
 
#define SVE_VECTOR_TYPE(InternalName, MangledName, Id, SingletonId, NumEls, ElBits, IsSigned, IsFP, IsBF)
 
#define SVE_PREDICATE_TYPE(InternalName, MangledName, Id, SingletonId, NumEls)
 
#define PPC_VECTOR_TYPE(Name, Id, Size)
 
#define RVV_TYPE(Name, Id, SingletonId)
 
#define ABSTRACT_STMT(Type)
 
#define EXPR(Type, Base)
 
#define STMT(Type, Base)   case Expr::Type##Class:
 

Functions

static bool isInternalLinkageDecl (const NamedDecl *ND)
 
static const DeclContextIgnoreLinkageSpecDecls (const DeclContext *DC)
 
static bool isStd (const NamespaceDecl *NS)
 Return whether a given namespace is the 'std' namespace. More...
 
static bool isStdNamespace (const DeclContext *DC)
 
static const GlobalDecl isTemplate (GlobalDecl GD, const TemplateArgumentList *&TemplateArgs)
 
static TemplateName asTemplateName (GlobalDecl GD)
 
static GlobalDecl getParentOfLocalEntity (const DeclContext *DC)
 
static bool isTypeSubstitutable (Qualifiers Quals, const Type *Ty, ASTContext &Ctx)
 
static StringRef mangleAArch64VectorBase (const BuiltinType *EltType)
 
static bool isParenthesizedADLCallee (const CallExpr *call)
 Look at the callee of the given call expression and determine if it's a parenthesized id-expression which would have triggered ADL otherwise. More...
 
static bool isZeroInitialized (QualType T, const APValue &V)
 Determine whether a given value is equivalent to zero-initialization for the purpose of discarding a trailing portion of a 'tl' mangling. More...
 
static QualType getLValueType (ASTContext &Ctx, const APValue &LV)
 
static bool hasMangledSubstitutionQualifiers (QualType T)
 Determine whether the given type has any qualifiers that are relevant for substitutions. More...
 
static bool isCharType (QualType T)
 
static bool isCharSpecialization (QualType T, const char *Name)
 Returns whether a given type is a template specialization of a given name with a single argument of type char. More...
 
template<std::size_t StrLen>
static bool isStreamCharSpecialization (const ClassTemplateSpecializationDecl *SD, const char(&Str)[StrLen])
 

Macro Definition Documentation

◆ ABSTRACT_STMT

#define ABSTRACT_STMT (   Type)

◆ ABSTRACT_TYPE [1/2]

#define ABSTRACT_TYPE (   CLASS,
  PARENT 
)

Definition at line 557 of file ItaniumMangle.cpp.

◆ ABSTRACT_TYPE [2/2]

#define ABSTRACT_TYPE (   CLASS,
  PARENT 
)

Definition at line 557 of file ItaniumMangle.cpp.

◆ BUILTIN_TYPE

#define BUILTIN_TYPE (   Id,
  SingletonId 
)

◆ EXPR

#define EXPR (   Type,
  Base 
)

◆ EXT_OPAQUE_TYPE

#define EXT_OPAQUE_TYPE (   ExtType,
  Id,
  Ext 
)
Value:
type_name = "ocl_" #ExtType; \
Out << type_name.size() << type_name; \
break;

◆ IMAGE_TYPE

#define IMAGE_TYPE (   ImgType,
  Id,
  SingletonId,
  Access,
  Suffix 
)
Value:
type_name = "ocl_" #ImgType "_" #Suffix; \
Out << type_name.size() << type_name; \
break;

◆ NON_CANONICAL_TYPE [1/2]

#define NON_CANONICAL_TYPE (   CLASS,
  PARENT 
)

Definition at line 558 of file ItaniumMangle.cpp.

◆ NON_CANONICAL_TYPE [2/2]

#define NON_CANONICAL_TYPE (   CLASS,
  PARENT 
)
Value:
case Type::CLASS: \
llvm_unreachable("can't mangle non-canonical type " #CLASS "Type"); \
return;

Definition at line 558 of file ItaniumMangle.cpp.

◆ PLACEHOLDER_TYPE

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

◆ PPC_VECTOR_TYPE

#define PPC_VECTOR_TYPE (   Name,
  Id,
  Size 
)
Value:
type_name = #Name; \
Out << 'u' << type_name.size() << type_name; \
break;

◆ RVV_TYPE

#define RVV_TYPE (   Name,
  Id,
  SingletonId 
)
Value:
type_name = Name; \
Out << 'u' << type_name.size() << type_name; \
break;

◆ STMT

#define STMT (   Type,
  Base 
)    case Expr::Type##Class:

◆ SVE_PREDICATE_TYPE

#define SVE_PREDICATE_TYPE (   InternalName,
  MangledName,
  Id,
  SingletonId,
  NumEls 
)
Value:
type_name = MangledName; \
Out << (type_name == InternalName ? "u" : "") << type_name.size() \
<< type_name; \
break;

◆ SVE_VECTOR_TYPE

#define SVE_VECTOR_TYPE (   InternalName,
  MangledName,
  Id,
  SingletonId,
  NumEls,
  ElBits,
  IsSigned,
  IsFP,
  IsBF 
)
Value:
type_name = MangledName; \
Out << (type_name == InternalName ? "u" : "") << type_name.size() \
<< type_name; \
break;

◆ TYPE [1/2]

#define TYPE (   CLASS,
  PARENT 
)    void mangleType(const CLASS##Type *T);

Definition at line 559 of file ItaniumMangle.cpp.

◆ TYPE [2/2]

#define TYPE (   CLASS,
  PARENT 
)
Value:
case Type::CLASS: \
mangleType(static_cast<const CLASS##Type*>(ty)); \
break;

Definition at line 559 of file ItaniumMangle.cpp.

Function Documentation

◆ asTemplateName()

static TemplateName asTemplateName ( GlobalDecl  GD)
static

Definition at line 909 of file ItaniumMangle.cpp.

References clang::GlobalDecl::getDecl().

◆ getLValueType()

static QualType getLValueType ( ASTContext Ctx,
const APValue LV 
)
static

◆ getParentOfLocalEntity()

static GlobalDecl getParentOfLocalEntity ( const DeclContext DC)
static

Definition at line 1680 of file ItaniumMangle.cpp.

References clang::Ctor_Complete, and clang::Dtor_Complete.

◆ hasMangledSubstitutionQualifiers()

static bool hasMangledSubstitutionQualifiers ( QualType  T)
static

Determine whether the given type has any qualifiers that are relevant for substitutions.

Definition at line 5794 of file ItaniumMangle.cpp.

References clang::Qualifiers::getCVRQualifiers(), clang::QualType::getQualifiers(), clang::Qualifiers::hasAddressSpace(), and clang::Qualifiers::hasUnaligned().

◆ IgnoreLinkageSpecDecls()

static const DeclContext* IgnoreLinkageSpecDecls ( const DeclContext DC)
static

Definition at line 854 of file ItaniumMangle.cpp.

Referenced by isStd().

◆ isCharSpecialization()

static bool isCharSpecialization ( QualType  T,
const char *  Name 
)
static

Returns whether a given type is a template specialization of a given name with a single argument of type char.

Definition at line 5841 of file ItaniumMangle.cpp.

Referenced by isStreamCharSpecialization().

◆ isCharType()

static bool isCharType ( QualType  T)
static

◆ isInternalLinkageDecl()

static bool isInternalLinkageDecl ( const NamedDecl ND)
static

◆ isParenthesizedADLCallee()

static bool isParenthesizedADLCallee ( const CallExpr call)
static

Look at the callee of the given call expression and determine if it's a parenthesized id-expression which would have triggered ADL otherwise.

Definition at line 3929 of file ItaniumMangle.cpp.

References clang::OverloadExpr::decls_begin(), clang::CallExpr::getCallee(), clang::OverloadExpr::getNumDecls(), clang::OverloadExpr::getQualifier(), clang::Expr::IgnoreParens(), and clang::UnresolvedLookupExpr::requiresADL().

◆ isStd()

static bool isStd ( const NamespaceDecl NS)
static

Return whether a given namespace is the 'std' namespace.

Definition at line 863 of file ItaniumMangle.cpp.

References clang::NamedDecl::getIdentifier(), clang::NamespaceDecl::getOriginalNamespace(), IgnoreLinkageSpecDecls(), and clang::IdentifierInfo::isStr().

Referenced by isStdNamespace().

◆ isStdNamespace()

static bool isStdNamespace ( const DeclContext DC)
static

Definition at line 874 of file ItaniumMangle.cpp.

References clang::DeclContext::isNamespace(), and isStd().

◆ isStreamCharSpecialization()

template<std::size_t StrLen>
static bool isStreamCharSpecialization ( const ClassTemplateSpecializationDecl SD,
const char(&)  Str[StrLen] 
)
static

◆ isTemplate()

static const GlobalDecl isTemplate ( GlobalDecl  GD,
const TemplateArgumentList *&  TemplateArgs 
)
static

◆ isTypeSubstitutable()

static bool isTypeSubstitutable ( Qualifiers  Quals,
const Type Ty,
ASTContext Ctx 
)
static

◆ isZeroInitialized()

static bool isZeroInitialized ( QualType  T,
const APValue V 
)
static

◆ mangleAArch64VectorBase()

static StringRef mangleAArch64VectorBase ( const BuiltinType EltType)
static

Definition at line 3354 of file ItaniumMangle.cpp.

References clang::BuiltinType::getKind().

clang::Type
The base class of the type hierarchy.
Definition: Type.h:1478
Id
int Id
Definition: ASTDiff.cpp:191