clang 20.0.0git
|
Go to the source code of this file.
Functions | |
static bool | getTypeString (SmallStringEnc &Enc, const Decl *D, const CodeGen::CodeGenModule &CGM, TypeStringCache &TSC) |
The XCore ABI includes a type information section that communicates symbol type information to the linker. | |
static bool | appendType (SmallStringEnc &Enc, QualType QType, const CodeGen::CodeGenModule &CGM, TypeStringCache &TSC) |
Handles the type's qualifier before dispatching a call to handle specific type encodings. | |
static bool | extractFieldType (SmallVectorImpl< FieldEncoding > &FE, const RecordDecl *RD, const CodeGen::CodeGenModule &CGM, TypeStringCache &TSC) |
Helper function for appendRecordType(). | |
static bool | appendRecordType (SmallStringEnc &Enc, const RecordType *RT, const CodeGen::CodeGenModule &CGM, TypeStringCache &TSC, const IdentifierInfo *ID) |
Appends structure and union types to Enc and adds encoding to cache. | |
static bool | appendEnumType (SmallStringEnc &Enc, const EnumType *ET, TypeStringCache &TSC, const IdentifierInfo *ID) |
Appends enum types to Enc and adds the encoding to the cache. | |
static void | appendQualifier (SmallStringEnc &Enc, QualType QT) |
Appends type's qualifier to Enc. | |
static bool | appendBuiltinType (SmallStringEnc &Enc, const BuiltinType *BT) |
Appends built-in types to Enc. | |
static bool | appendPointerType (SmallStringEnc &Enc, const PointerType *PT, const CodeGen::CodeGenModule &CGM, TypeStringCache &TSC) |
Appends a pointer encoding to Enc before calling appendType for the pointee. | |
static bool | appendArrayType (SmallStringEnc &Enc, QualType QT, const ArrayType *AT, const CodeGen::CodeGenModule &CGM, TypeStringCache &TSC, StringRef NoSizeEnc) |
Appends array encoding to Enc before calling appendType for the element. | |
static bool | appendFunctionType (SmallStringEnc &Enc, const FunctionType *FT, const CodeGen::CodeGenModule &CGM, TypeStringCache &TSC) |
Appends a function encoding to Enc, calling appendType for the return type and the arguments. | |
|
static |
Appends array encoding to Enc before calling appendType for the element.
Definition at line 542 of file XCore.cpp.
References appendQualifier(), appendType(), clang::ArrayType::getElementType(), and clang::ArrayType::getSizeModifier().
Referenced by appendType(), and getTypeString().
|
static |
Appends built-in types to Enc.
Definition at line 472 of file XCore.cpp.
References clang::BuiltinType::getKind().
Referenced by appendType().
|
static |
Appends enum types to Enc and adds the encoding to the cache.
Definition at line 414 of file XCore.cpp.
References E, clang::EnumType::getDecl(), and clang::EnumDecl::getDefinition().
Referenced by appendType().
|
static |
Appends a function encoding to Enc, calling appendType for the return type and the arguments.
Definition at line 564 of file XCore.cpp.
References appendType(), E, clang::Type::getAs(), and clang::FunctionType::getReturnType().
Referenced by appendType().
|
static |
Appends a pointer encoding to Enc before calling appendType for the pointee.
Definition at line 531 of file XCore.cpp.
References appendType(), and clang::PointerType::getPointeeType().
Referenced by appendType().
|
static |
Appends type's qualifier to Enc.
This is done prior to appending the type's encoding.
Definition at line 458 of file XCore.cpp.
References clang::QualType::isConstQualified(), clang::QualType::isRestrictQualified(), and clang::QualType::isVolatileQualified().
Referenced by appendArrayType(), and appendType().
|
static |
Appends structure and union types to Enc and adds encoding to cache.
Recursively calls appendType (via extractFieldType) for each field. Union types have their fields ordered according to the ABI.
Definition at line 362 of file XCore.cpp.
References E, extractFieldType(), clang::RecordDecl::field_empty(), clang::RecordType::getDecl(), clang::RecordDecl::getDefinition(), and clang::Type::isUnionType().
Referenced by appendType().
|
static |
Handles the type's qualifier before dispatching a call to handle specific type encodings.
Definition at line 598 of file XCore.cpp.
References appendArrayType(), appendBuiltinType(), appendEnumType(), appendFunctionType(), appendPointerType(), appendQualifier(), appendRecordType(), clang::Type::getAs(), clang::Type::getAsArrayTypeUnsafe(), clang::Type::getAsStructureType(), clang::Type::getAsUnionType(), clang::QualType::getBaseTypeIdentifier(), and clang::QualType::getCanonicalType().
Referenced by appendArrayType(), appendFunctionType(), appendPointerType(), extractFieldType(), and getTypeString().
|
static |
Helper function for appendRecordType().
Builds a SmallVector containing the encoded field types in declaration order.
Definition at line 334 of file XCore.cpp.
References appendType(), clang::RecordDecl::fields(), and clang::CodeGen::CodeGenModule::getContext().
Referenced by appendRecordType().
|
static |
The XCore ABI includes a type information section that communicates symbol type information to the linker.
The linker uses this information to verify safety/correctness of things such as array bound and pointers et al. The ABI only requires C (and XC) language modules to emit TypeStrings. This type information (TypeString) is emitted into meta data for all global symbols: definitions, declarations, functions & variables.
The TypeString carries type, qualifier, name, size & value details. Please see 'Tools Development Guide' section 2.16.2 for format details: https://www.xmos.com/download/public/Tools-Development-Guide%28X9114A%29.pdf The output is tested by test/CodeGen/xcore-stringtype.c.
Definition at line 632 of file XCore.cpp.
References appendArrayType(), appendType(), clang::CLanguageLinkage, D, and clang::Type::getAsArrayTypeUnsafe().