clang: lib/AST/ItaniumMangle.cpp File Reference (original) (raw)
#include "[clang/AST/ASTContext.h](ASTContext%5F8h%5Fsource.html)"#include "[clang/AST/Attr.h](AST%5F2Attr%5F8h%5Fsource.html)"#include "[clang/AST/Decl.h](Decl%5F8h%5Fsource.html)"#include "[clang/AST/DeclCXX.h](DeclCXX%5F8h%5Fsource.html)"#include "[clang/AST/DeclObjC.h](DeclObjC%5F8h%5Fsource.html)"#include "[clang/AST/DeclOpenMP.h](DeclOpenMP%5F8h%5Fsource.html)"#include "[clang/AST/DeclTemplate.h](DeclTemplate%5F8h%5Fsource.html)"#include "[clang/AST/Expr.h](Expr%5F8h%5Fsource.html)"#include "[clang/AST/ExprCXX.h](ExprCXX%5F8h%5Fsource.html)"#include "[clang/AST/ExprConcepts.h](ExprConcepts%5F8h%5Fsource.html)"#include "[clang/AST/ExprObjC.h](ExprObjC%5F8h%5Fsource.html)"#include "[clang/AST/Mangle.h](Mangle%5F8h%5Fsource.html)"#include "[clang/AST/TypeLoc.h](TypeLoc%5F8h%5Fsource.html)"#include "[clang/Basic/ABI.h](ABI%5F8h%5Fsource.html)"#include "[clang/Basic/Module.h](Module%5F8h%5Fsource.html)"#include "[clang/Basic/TargetInfo.h](include%5F2clang%5F2Basic%5F2TargetInfo%5F8h%5Fsource.html)"#include "[clang/Basic/Thunk.h](Thunk%5F8h%5Fsource.html)"#include "llvm/ADT/StringExtras.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/raw_ostream.h"#include "llvm/TargetParser/RISCVTargetParser.h"#include <optional>#include "clang/AST/TypeNodes.inc"#include "clang/AST/BuiltinTypes.def"#include "clang/Basic/OpenCLImageTypes.def"#include "clang/Basic/OpenCLExtensionTypes.def"#include "clang/Basic/AArch64ACLETypes.def"#include "clang/Basic/PPCTypes.def"#include "clang/Basic/RISCVVTypes.def"#include "clang/Basic/WebAssemblyReferenceTypes.def"#include "clang/Basic/AMDGPUTypes.def"#include "clang/Basic/HLSLIntangibleTypes.def"#include "clang/Basic/TransformTypeTraits.def"#include "clang/AST/StmtNodes.inc"
Go to the source code of this file.
| Macros | |
|---|---|
| #define | ABSTRACT_TYPE(CLASS, PARENT) |
| #define | NON_CANONICAL_TYPE(CLASS, PARENT) |
| #define | TYPE(CLASS, PARENT) |
| #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) |
| #define | IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) |
| #define | EXT_OPAQUE_TYPE(ExtType, Id, Ext) |
| #define | SVE_VECTOR_TYPE(Name, MangledName, Id, SingletonId) |
| #define | SVE_PREDICATE_TYPE(Name, MangledName, Id, SingletonId) |
| #define | SVE_OPAQUE_TYPE(Name, MangledName, Id, SingletonId) |
| #define | SVE_SCALAR_TYPE(Name, MangledName, Id, SingletonId, Bits) |
| #define | PPC_VECTOR_TYPE(Name, Id, Size) |
| #define | RVV_TYPE(Name, Id, SingletonId) |
| #define | WASM_REF_TYPE(InternalName, MangledName, Id, SingletonId, AS) |
| #define | AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) |
| #define | HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) |
| #define | CC_VLS_CASE(ABI_VLEN) |
| #define | TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) |
| #define | ABSTRACT_STMT(Type) |
| #define | EXPR(Type, Base) |
| #define | STMT(Type, Base) |
| Enumerations | |
|---|---|
| enum class | AAPCSBitmaskSME : unsigned { ArmStreamingBit = 1 << 0 , ArmStreamingCompatibleBit = 1 << 1 , ArmAgnosticSMEZAStateBit = 1 << 2 , ZA_Shift = 3 , ZT0_Shift = 6 , NoState = 0b000 , ArmIn = 0b001 , ArmOut = 0b010 , ArmInOut = 0b011 , ArmPreserves = 0b100 } |
| Functions | |
|---|---|
| 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 AAPCSBitmaskSME | encodeAAPCSZAState (unsigned SMEAttrs) |
| 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. | |
| 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. | |
| static QualType | getLValueType (ASTContext &Ctx, const APValue &LV) |
| static IdentifierInfo * | getUnionInitName (SourceLocation UnionLoc, DiagnosticsEngine &Diags, const FieldDecl *FD) |
| static bool | hasMangledSubstitutionQualifiers (QualType T) |
| Determine whether the given type has any qualifiers that are relevant for substitutions. | |
| static void | mangleOverrideDiscrimination (CXXNameMangler &Mangler, ASTContext &Context, const ThunkInfo &Thunk) |
| Mangles the pointer authentication override attribute for classes that have explicit overrides for the vtable authentication schema. |
◆ ABSTRACT_STMT
| #define ABSTRACT_STMT | ( | Type | ) |
|---|
◆ ABSTRACT_TYPE [1/2]
| #define ABSTRACT_TYPE | ( | CLASS, |
|---|---|---|
| PARENT ) |
◆ ABSTRACT_TYPE [2/2]
| #define ABSTRACT_TYPE | ( | CLASS, |
|---|---|---|
| PARENT ) |
◆ AMDGPU_TYPE
| #define AMDGPU_TYPE | ( | Name, |
|---|---|---|
| Id, | ||
| SingletonId, | ||
| Width, | ||
| Align ) |
Value:
case BuiltinType::Id: \
mangleVendorType(Name); \
break;
◆ BUILTIN_TYPE
| #define BUILTIN_TYPE | ( | Id, |
|---|---|---|
| SingletonId ) |
◆ CC_VLS_CASE
| #define CC_VLS_CASE | ( | ABI_VLEN | ) |
|---|
◆ EXPR
| #define EXPR | ( | Type, |
|---|---|---|
| Base ) |
◆ EXT_OPAQUE_TYPE
| #define EXT_OPAQUE_TYPE | ( | ExtType, |
|---|---|---|
| Id, | ||
| Ext ) |
Value:
case BuiltinType::Id: \
type_name = "ocl_" #ExtType; \
Out << type_name.size() << type_name; \
break;
◆ HLSL_INTANGIBLE_TYPE
| #define HLSL_INTANGIBLE_TYPE | ( | Name, |
|---|---|---|
| Id, | ||
| SingletonId ) |
Value:
case BuiltinType::Id: \
mangleVendorType(#Name); \
break;
◆ IMAGE_TYPE
| #define IMAGE_TYPE | ( | ImgType, |
|---|---|---|
| Id, | ||
| SingletonId, | ||
| Access, | ||
| Suffix ) |
Value:
case BuiltinType::Id: \
type_name = "ocl_" #ImgType "_" #Suffix; \
Out << type_name.size() << type_name; \
break;
◆ NON_CANONICAL_TYPE [1/2]
| #define NON_CANONICAL_TYPE | ( | CLASS, |
|---|---|---|
| PARENT ) |
◆ 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 555 of file ItaniumMangle.cpp.
◆ PLACEHOLDER_TYPE
| #define PLACEHOLDER_TYPE | ( | Id, |
|---|---|---|
| SingletonId ) |
◆ PPC_VECTOR_TYPE
| #define PPC_VECTOR_TYPE | ( | Name, |
|---|---|---|
| Id, | ||
| Size ) |
Value:
case BuiltinType::Id: \
mangleVendorType(#Name); \
break;
◆ RVV_TYPE
| #define RVV_TYPE | ( | Name, |
|---|---|---|
| Id, | ||
| SingletonId ) |
Value:
case BuiltinType::Id: \
mangleVendorType(Name); \
break;
◆ STMT
| #define STMT | ( | Type, |
|---|---|---|
| Base ) |
◆ SVE_OPAQUE_TYPE
| #define SVE_OPAQUE_TYPE | ( | Name, |
|---|---|---|
| MangledName, | ||
| Id, | ||
| SingletonId ) |
Value:
case BuiltinType::Id: \
type_name = #MangledName; \
Out << (type_name == #Name ? "u" : "") << type_name.size() << type_name; \
break;
◆ SVE_PREDICATE_TYPE
| #define SVE_PREDICATE_TYPE | ( | Name, |
|---|---|---|
| MangledName, | ||
| Id, | ||
| SingletonId ) |
Value:
case BuiltinType::Id: \
type_name = #MangledName; \
Out << (type_name == #Name ? "u" : "") << type_name.size() << type_name; \
break;
◆ SVE_SCALAR_TYPE
| #define SVE_SCALAR_TYPE | ( | Name, |
|---|---|---|
| MangledName, | ||
| Id, | ||
| SingletonId, | ||
| Bits ) |
Value:
case BuiltinType::Id: \
type_name = #MangledName; \
Out << (type_name == #Name ? "u" : "") << type_name.size() << type_name; \
break;
◆ SVE_VECTOR_TYPE
| #define SVE_VECTOR_TYPE | ( | Name, |
|---|---|---|
| MangledName, | ||
| Id, | ||
| SingletonId ) |
Value:
case BuiltinType::Id: \
if (T->getKind() == BuiltinType::SveBFloat16 && \
isCompatibleWith(LangOptions::ClangABI::Ver17)) { \
\
mangleVendorType("__SVBFloat16_t"); \
} else { \
type_name = #MangledName; \
Out << (type_name == #Name ? "u" : "") << type_name.size() << type_name; \
} \
break;
const FunctionProtoType * T
◆ TRANSFORM_TYPE_TRAIT_DEF
| #define TRANSFORM_TYPE_TRAIT_DEF | ( | Enum, |
|---|---|---|
| Trait ) |
Value:
case UnaryTransformType::Enum: \
BuiltinName = "__" #Trait; \
break;
◆ TYPE [1/2]
| #define TYPE | ( | CLASS, |
|---|---|---|
| PARENT ) |
Value:
void mangleType(const CLASS##Type *T);
The base class of the type hierarchy.
Definition at line 556 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 556 of file ItaniumMangle.cpp.
◆ WASM_REF_TYPE
| #define WASM_REF_TYPE | ( | InternalName, |
|---|---|---|
| MangledName, | ||
| Id, | ||
| SingletonId, | ||
| AS ) |
Value:
case BuiltinType::Id: \
mangleVendorType(MangledName); \
break;
◆ AAPCSBitmaskSME
| Enumerator |
|---|
| ArmStreamingBit |
| ArmStreamingCompatibleBit |
| ArmAgnosticSMEZAStateBit |
| ZA_Shift |
| ZT0_Shift |
| NoState |
| ArmIn |
| ArmOut |
| ArmInOut |
| ArmPreserves |
Definition at line 3553 of file ItaniumMangle.cpp.
◆ asTemplateName()
◆ encodeAAPCSZAState()
◆ getLValueType()
◆ getParentOfLocalEntity()
◆ getUnionInitName()
◆ hasMangledSubstitutionQualifiers()
◆ isParenthesizedADLCallee()
| bool isParenthesizedADLCallee ( const CallExpr * call) | static |
|---|
◆ isTemplate()
◆ isTypeSubstitutable()
◆ isZeroInitialized()
Determine whether a given value is equivalent to zero-initialization for the purpose of discarding a trailing portion of a 'tl' mangling.
Note that this is not in general equivalent to determining whether the value has an all-zeroes bit pattern.
Definition at line 6393 of file ItaniumMangle.cpp.
References clang::APValue::AddrLabelDiff, clang::APValue::Array, clang::CXXRecordDecl::bases(), clang::APValue::ComplexFloat, clang::APValue::ComplexInt, clang::declaresSameEntity(), clang::RecordDecl::fields(), clang::APValue::FixedPoint, clang::APValue::Float, clang::VectorType::getElementType(), clang::ValueDecl::getType(), clang::APValue::Indeterminate, clang::APValue::Int, isZeroInitialized(), clang::APValue::LValue, clang::APValue::MemberPointer, clang::APValue::None, clang::APValue::Struct, clang::T, clang::APValue::Union, V, and clang::APValue::Vector.
Referenced by isZeroInitialized().
◆ mangleAArch64VectorBase()
| StringRef mangleAArch64VectorBase ( const BuiltinType * EltType) | static |
|---|
◆ mangleOverrideDiscrimination()
| void mangleOverrideDiscrimination ( CXXNameMangler & Mangler, ASTContext & Context, const ThunkInfo & Thunk ) | static |
|---|
Mangles the pointer authentication override attribute for classes that have explicit overrides for the vtable authentication schema.
The override is mangled as a parameterized vendor extension as follows
::= U "__vtptrauth" I E
The extra discriminator encodes the explicit value derived from the override schema, e.g. if the override has specified type based discrimination the encoded value will be the discriminator derived from the type name.
Definition at line 7281 of file ItaniumMangle.cpp.
References clang::Decl::getAttr(), clang::Type::getPointeeCXXRecordDecl(), and clang::ThunkInfo::ThisType.