llvm/clang/tools/libclang/CXType.cpp

//===- CXType.cpp - Implements 'CXTypes' aspect of libclang ---------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===--------------------------------------------------------------------===//
//
// This file implements the 'CXTypes' API hooks in the Clang-C library.
//
//===--------------------------------------------------------------------===//

#include "CXType.h"
#include "CIndexer.h"
#include "CXCursor.h"
#include "CXString.h"
#include "CXTranslationUnit.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/Type.h"
#include "clang/Basic/AddressSpaces.h"
#include "clang/Frontend/ASTUnit.h"
#include <optional>

usingnamespaceclang;

static CXTypeKind GetBuiltinTypeKind(const BuiltinType *BT) {}

static CXTypeKind GetTypeKind(QualType T) {}


CXType cxtype::MakeCXType(QualType T, CXTranslationUnit TU) {}

MakeCXType;

static inline QualType GetQualType(CXType CT) {}

static inline CXTranslationUnit GetTU(CXType CT) {}

static std::optional<ArrayRef<TemplateArgument>>
GetTemplateArguments(QualType Type) {}

static std::optional<QualType>
TemplateArgumentToQualType(const TemplateArgument &A) {}

static std::optional<QualType>
FindTemplateArgumentTypeAt(ArrayRef<TemplateArgument> TA, unsigned index) {}

CXType clang_getCursorType(CXCursor C) {}

CXString clang_getTypeSpelling(CXType CT) {}

CXType clang_getTypedefDeclUnderlyingType(CXCursor C) {}

CXType clang_getEnumDeclIntegerType(CXCursor C) {}

long long clang_getEnumConstantDeclValue(CXCursor C) {}

unsigned long long clang_getEnumConstantDeclUnsignedValue(CXCursor C) {}

int clang_getFieldDeclBitWidth(CXCursor C) {}

CXType clang_getCanonicalType(CXType CT) {}

unsigned clang_isConstQualifiedType(CXType CT) {}

unsigned clang_isVolatileQualifiedType(CXType CT) {}

unsigned clang_isRestrictQualifiedType(CXType CT) {}

unsigned clang_getAddressSpace(CXType CT) {}

CXString clang_getTypedefName(CXType CT) {}

CXType clang_getPointeeType(CXType CT) {}

CXType clang_getUnqualifiedType(CXType CT) {}

CXType clang_getNonReferenceType(CXType CT) {}

CXCursor clang_getTypeDeclaration(CXType CT) {}

CXString clang_getTypeKindSpelling(enum CXTypeKind K) {}

unsigned clang_equalTypes(CXType A, CXType B) {}

unsigned clang_isFunctionTypeVariadic(CXType X) {}

CXCallingConv clang_getFunctionTypeCallingConv(CXType X) {}

int clang_getNumArgTypes(CXType X) {}

CXType clang_getArgType(CXType X, unsigned i) {}

CXType clang_getResultType(CXType X) {}

CXType clang_getCursorResultType(CXCursor C) {}

// FIXME: We should expose the canThrow(...) result instead of the EST.
static CXCursor_ExceptionSpecificationKind
getExternalExceptionSpecificationKind(ExceptionSpecificationType EST) {}

int clang_getExceptionSpecificationType(CXType X) {}

int clang_getCursorExceptionSpecificationType(CXCursor C) {}

unsigned clang_isPODType(CXType X) {}

CXType clang_getElementType(CXType CT) {}

long long clang_getNumElements(CXType CT) {}

CXType clang_getArrayElementType(CXType CT) {}

long long clang_getArraySize(CXType CT) {}

static bool isIncompleteTypeWithAlignment(QualType QT) {}

long long clang_Type_getAlignOf(CXType T) {}

CXType clang_Type_getClassType(CXType CT) {}

long long clang_Type_getSizeOf(CXType T) {}

static bool isTypeIncompleteForLayout(QualType QT) {}

static long long visitRecordForValidation(const RecordDecl *RD) {}

static long long validateFieldParentType(CXCursor PC, CXType PT){}

long long clang_Type_getOffsetOf(CXType PT, const char *S) {}

CXType clang_Type_getModifiedType(CXType CT) {}

long long clang_Cursor_getOffsetOfField(CXCursor C) {}

enum CXRefQualifierKind clang_Type_getCXXRefQualifier(CXType T) {}

unsigned clang_Cursor_isBitField(CXCursor C) {}

CXString clang_getDeclObjCTypeEncoding(CXCursor C) {}

static unsigned GetTemplateArgumentArraySize(ArrayRef<TemplateArgument> TA) {}

int clang_Type_getNumTemplateArguments(CXType CT) {}

CXType clang_Type_getTemplateArgumentAsType(CXType CT, unsigned index) {}

CXType clang_Type_getObjCObjectBaseType(CXType CT) {}

unsigned clang_Type_getNumObjCProtocolRefs(CXType CT) {}

CXCursor clang_Type_getObjCProtocolDecl(CXType CT, unsigned i) {}

unsigned clang_Type_getNumObjCTypeArgs(CXType CT) {}

CXType clang_Type_getObjCTypeArg(CXType CT, unsigned i) {}

unsigned clang_Type_visitFields(CXType PT,
                                CXFieldVisitor visitor,
                                CXClientData client_data){}

unsigned clang_Cursor_isAnonymous(CXCursor C){}

unsigned clang_Cursor_isAnonymousRecordDecl(CXCursor C){}

unsigned clang_Cursor_isInlineNamespace(CXCursor C) {}

CXType clang_Type_getNamedType(CXType CT){}

unsigned clang_Type_isTransparentTagTypedef(CXType TT){}

enum CXTypeNullabilityKind clang_Type_getNullability(CXType CT) {}

CXType clang_Type_getValueType(CXType CT) {}