clang API Documentation
#include "clang/Sema/SemaInternal.h"
#include "TypeLocBuilder.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/TypeLoc.h"
#include "clang/AST/TypeLocVisitor.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Parse/ParseDiagnostic.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/DelayedDiagnostic.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/Template.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/ErrorHandling.h"
Go to the source code of this file.
Defines | |
#define | OBJC_POINTER_TYPE_ATTRS_CASELIST |
#define | FUNCTION_TYPE_ATTRS_CASELIST |
#define | MS_TYPE_ATTRS_CASELIST |
Enumerations | |
enum | TypeDiagSelector { TDS_Function, TDS_Pointer, TDS_ObjCObjOrBlock } |
enum | TypeAttrLocation { TAL_DeclSpec, TAL_DeclChunk, TAL_DeclName } |
The location of a type attribute. More... | |
enum | QualifiedFunctionKind |
Functions | |
static bool | isOmittedBlockReturnType (const Declarator &D) |
static void | diagnoseBadTypeAttribute (Sema &S, const AttributeList &attr, QualType type) |
static void | spliceAttrIntoList (AttributeList &attr, AttributeList *&head) |
static void | spliceAttrOutOfList (AttributeList &attr, AttributeList *&head) |
static void | moveAttrFromListToList (AttributeList &attr, AttributeList *&fromList, AttributeList *&toList) |
static void | processTypeAttrs (TypeProcessingState &state, QualType &type, TypeAttrLocation TAL, AttributeList *attrs) |
static bool | handleFunctionTypeAttr (TypeProcessingState &state, AttributeList &attr, QualType &type) |
static bool | handleMSPointerTypeQualifierAttr (TypeProcessingState &state, AttributeList &attr, QualType &type) |
static bool | handleObjCGCTypeAttr (TypeProcessingState &state, AttributeList &attr, QualType &type) |
static bool | handleObjCOwnershipTypeAttr (TypeProcessingState &state, AttributeList &attr, QualType &type) |
static bool | handleObjCPointerTypeAttr (TypeProcessingState &state, AttributeList &attr, QualType &type) |
static DeclaratorChunk * | maybeMovePastReturnType (Declarator &declarator, unsigned i) |
static void | distributeObjCPointerTypeAttr (TypeProcessingState &state, AttributeList &attr, QualType type) |
static void | distributeObjCPointerTypeAttrFromDeclarator (TypeProcessingState &state, AttributeList &attr, QualType &declSpecType) |
static void | distributeFunctionTypeAttr (TypeProcessingState &state, AttributeList &attr, QualType type) |
static bool | distributeFunctionTypeAttrToInnermost (TypeProcessingState &state, AttributeList &attr, AttributeList *&attrList, QualType &declSpecType) |
static void | distributeFunctionTypeAttrFromDeclSpec (TypeProcessingState &state, AttributeList &attr, QualType &declSpecType) |
static void | distributeFunctionTypeAttrFromDeclarator (TypeProcessingState &state, AttributeList &attr, QualType &declSpecType) |
static void | distributeTypeAttrsFromDeclarator (TypeProcessingState &state, QualType &declSpecType) |
Given that there are attributes written on the declarator itself, try to distribute any type attributes to the appropriate declarator chunk. | |
static void | maybeSynthesizeBlockSignature (TypeProcessingState &state, QualType declSpecType) |
static QualType | ConvertDeclSpecToType (TypeProcessingState &state) |
Convert the specified declspec to the appropriate type object. | |
static std::string | getPrintableNameForEntity (DeclarationName Entity) |
static QualType | inferARCLifetimeForPointee (Sema &S, QualType type, SourceLocation loc, bool isReference) |
Given that we're building a pointer or reference to the given. | |
static std::string | getFunctionQualifiersAsString (const FunctionProtoType *FnTy) |
static bool | checkQualifiedFunction (Sema &S, QualType T, SourceLocation Loc, QualifiedFunctionKind QFK) |
static bool | isArraySizeVLA (Sema &S, Expr *ArraySize, llvm::APSInt &SizeVal) |
static void | transferARCOwnershipToDeclaratorChunk (TypeProcessingState &state, Qualifiers::ObjCLifetime ownership, unsigned chunkIndex) |
static void | inferARCWriteback (TypeProcessingState &state, QualType &declSpecType) |
static void | diagnoseRedundantReturnTypeQualifiers (Sema &S, QualType RetTy, Declarator &D, unsigned FunctionChunkIndex) |
static QualType | GetDeclSpecTypeForDeclarator (TypeProcessingState &state, TypeSourceInfo *&ReturnTypeInfo) |
static void | warnAboutAmbiguousFunction (Sema &S, Declarator &D, DeclaratorChunk &DeclType, QualType RT) |
static CallingConv | getCCForDeclaratorChunk (Sema &S, Declarator &D, const DeclaratorChunk::FunctionTypeInfo &FTI, unsigned ChunkIndex) |
static TypeSourceInfo * | GetFullTypeForDeclarator (TypeProcessingState &state, QualType declSpecType, TypeSourceInfo *TInfo) |
static void | transferARCOwnershipToDeclSpec (Sema &S, QualType &declSpecTy, Qualifiers::ObjCLifetime ownership) |
static void | transferARCOwnership (TypeProcessingState &state, QualType &declSpecTy, Qualifiers::ObjCLifetime ownership) |
Used for transferring ownership in casts resulting in l-values. | |
static AttributeList::Kind | getAttrListKind (AttributedType::Kind kind) |
Map an AttributedType::Kind to an AttributeList::Kind. | |
static void | fillAttributedTypeLoc (AttributedTypeLoc TL, const AttributeList *attrs) |
static void | fillAtomicQualLoc (AtomicTypeLoc ATL, const DeclaratorChunk &Chunk) |
static void | HandleAddressSpaceTypeAttribute (QualType &Type, const AttributeList &Attr, Sema &S) |
static bool | hasDirectOwnershipQualifier (QualType type) |
static AttributedType::Kind | getCCTypeAttrKind (AttributeList &Attr) |
static void | HandleVectorSizeAttr (QualType &CurType, const AttributeList &Attr, Sema &S) |
static void | HandleExtVectorTypeAttr (QualType &CurType, const AttributeList &Attr, Sema &S) |
Process the OpenCL-like ext_vector_type attribute when it occurs on a type. | |
static bool | isPermittedNeonBaseType (QualType &Ty, VectorType::VectorKind VecKind, Sema &S) |
static void | HandleNeonVectorTypeAttr (QualType &CurType, const AttributeList &Attr, Sema &S, VectorType::VectorKind VecKind) |
static bool | hasVisibleDefinition (Sema &S, NamedDecl *D, NamedDecl **Suggested) |
Determine whether there is any declaration of D that was ever a definition (perhaps before module merging) and is currently visible. | |
static void | assignInheritanceModel (Sema &S, CXXRecordDecl *RD) |
Locks in the inheritance model for the given class and all of its bases. | |
static unsigned | getLiteralDiagFromTagKind (TagTypeKind Tag) |
Get diagnostic select index for tag kind for literal type diagnostic message. WARNING: Indexes apply to particular diagnostics only! | |
static QualType | getDecltypeForExpr (Sema &S, Expr *E) |
#define FUNCTION_TYPE_ATTRS_CASELIST |
case AttributeList::AT_NoReturn: \
case AttributeList::AT_CDecl: \
case AttributeList::AT_FastCall: \
case AttributeList::AT_StdCall: \
case AttributeList::AT_ThisCall: \
case AttributeList::AT_Pascal: \
case AttributeList::AT_VectorCall: \
case AttributeList::AT_MSABI: \
case AttributeList::AT_SysVABI: \
case AttributeList::AT_Regparm: \
case AttributeList::AT_Pcs: \
case AttributeList::AT_PnaclCall: \
case AttributeList::AT_IntelOclBicc
Definition at line 103 of file SemaType.cpp.
Referenced by distributeTypeAttrsFromDeclarator(), and processTypeAttrs().
#define MS_TYPE_ATTRS_CASELIST |
case AttributeList::AT_Ptr32: \
case AttributeList::AT_Ptr64: \
case AttributeList::AT_SPtr: \
case AttributeList::AT_UPtr
Definition at line 119 of file SemaType.cpp.
Referenced by distributeTypeAttrsFromDeclarator(), and processTypeAttrs().
#define OBJC_POINTER_TYPE_ATTRS_CASELIST |
case AttributeList::AT_ObjCGC: \
case AttributeList::AT_ObjCOwnership
Definition at line 98 of file SemaType.cpp.
Referenced by distributeTypeAttrsFromDeclarator(), and processTypeAttrs().
Kinds of declarator that cannot contain a qualified function type.
C++98 [dcl.fct]p4 / C++11 [dcl.fct]p6: a function type with a cv-qualifier or a ref-qualifier can only appear at the topmost level of a type.
Parens and member pointers are permitted. We don't diagnose array and function declarators, because they don't allow function types at all.
The values of this enum are used in diagnostics.
Definition at line 1352 of file SemaType.cpp.
enum TypeAttrLocation |
The location of a type attribute.
TAL_DeclSpec |
The attribute is in the decl-specifier-seq. |
TAL_DeclChunk |
The attribute is part of a DeclaratorChunk. |
TAL_DeclName |
The attribute is immediately after the declaration's name. |
Definition at line 270 of file SemaType.cpp.
enum TypeDiagSelector |
Definition at line 39 of file SemaType.cpp.
static void assignInheritanceModel | ( | Sema & | S, |
CXXRecordDecl * | RD | ||
) | [static] |
Locks in the inheritance model for the given class and all of its bases.
Definition at line 5124 of file SemaType.cpp.
References clang::Decl::addAttr(), clang::CXXRecordDecl::calculateInheritanceModel(), clang::Sema::getASTContext(), clang::CXXRecordDecl::getMostRecentDecl(), clang::TagDecl::getSourceRange(), clang::Decl::hasAttr(), clang::Sema::ImplicitMSInheritanceAttrLoc, clang::SourceLocation::isValid(), clang::Sema::MSPointerToMemberRepresentationMethod, clang::LangOptions::PPTMK_BestCase, clang::LangOptions::PPTMK_FullGeneralityMultipleInheritance, clang::LangOptions::PPTMK_FullGeneralitySingleInheritance, and clang::LangOptions::PPTMK_FullGeneralityVirtualInheritance.
static bool checkQualifiedFunction | ( | Sema & | S, |
QualType | T, | ||
SourceLocation | Loc, | ||
QualifiedFunctionKind | QFK | ||
) | [static] |
Check whether the type T is a qualified function type, and if it is, diagnose that it cannot be contained within the given kind of declarator.
Definition at line 1357 of file SemaType.cpp.
References clang::Sema::Diag(), clang::Type::getAs(), getFunctionQualifiersAsString(), clang::FunctionProtoType::getRefQualifier(), clang::FunctionProtoType::getTypeQuals(), clang::QualType::IgnoreParens(), and clang::RQ_None.
Referenced by clang::Sema::BuildBlockPointerType(), clang::Sema::BuildPointerType(), and clang::Sema::BuildReferenceType().
static QualType ConvertDeclSpecToType | ( | TypeProcessingState & | state | ) | [static] |
Convert the specified declspec to the appropriate type object.
state | Specifies the declarator containing the declaration specifier to be converted, along with other associated processing state. |
Definition at line 698 of file SemaType.cpp.
References clang::sema::LambdaScopeInfo::AutoTemplateParameterDepth, clang::sema::LambdaScopeInfo::AutoTemplateParams, clang::ASTContext::BoolTy, clang::Sema::BuildAtomicType(), clang::Sema::BuildDecltypeType(), clang::Sema::BuildTypeofExprType(), clang::Sema::BuildUnaryTransformType(), clang::ASTContext::Char16Ty, clang::ASTContext::Char32Ty, clang::ASTContext::CharTy, clang::Sema::Context, Context, clang::TemplateTypeParmDecl::Create(), clang::FixItHint::CreateInsertion(), clang::ASTContext::DependentTy, clang::Sema::Diag(), clang::Sema::DiagnoseUseOfDecl(), clang::ASTContext::DoubleTy, clang::UnaryTransformType::EnumUnderlyingType, clang::ASTContext::FloatTy, clang::IdentifierTable::get(), clang::Type::getAs(), clang::ASTContext::getAutoDeductType(), clang::ASTContext::getAutoType(), clang::Declarator::getContext(), clang::Sema::getCurLambda(), clang::Declarator::getDeclSpec(), clang::Sema::getElaboratedType(), clang::Declarator::getIdentifierLoc(), clang::TypeWithKeyword::getKeywordForTypeSpec(), clang::Sema::getLangOpts(), clang::DeclSpec::getLocStart(), clang::Declarator::getLocStart(), clang::DeclSpec::getNumProtocolQualifiers(), clang::ASTContext::getObjCObjectPointerType(), clang::ASTContext::getObjCObjectType(), clang::Sema::getOpenCLOptions(), clang::ASTContext::getPrintingPolicy(), clang::DeclSpec::getProtocolQualifiers(), clang::DeclSpec::getRepAsDecl(), clang::DeclSpec::getRepAsExpr(), clang::DeclSpec::getRepAsType(), clang::ASTContext::getSignedWCharType(), clang::DeclSpec::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTContext::getTypeDeclType(), clang::TypeDecl::getTypeForDecl(), clang::Sema::GetTypeFromParser(), clang::ASTContext::getTypeOfType(), clang::DeclSpec::getTypeSpecComplex(), clang::DeclSpec::getTypeSpecScope(), clang::DeclSpec::getTypeSpecSign(), clang::DeclSpec::getTypeSpecSignLoc(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::DeclSpec::getTypeSpecTypeNameLoc(), clang::DeclSpec::getTypeSpecWidth(), clang::DeclSpec::getTypeSpecWidthLoc(), clang::ASTContext::getUnsignedWCharType(), clang::ASTContext::HalfTy, clang::Declarator::hasEllipsis(), clang::TargetInfo::hasInt128Type(), clang::DeclSpec::hasTypeSpecifier(), clang::ASTContext::Idents, clang::ASTContext::Int128Ty, clang::ASTContext::IntTy, clang::DeclSpec::isEmpty(), clang::SourceLocation::isInvalid(), isOmittedBlockReturnType(), clang::Declarator::LambdaExprContext, clang::Declarator::LambdaExprParameterContext, clang::ASTContext::LongDoubleTy, clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, clang::ASTContext::ObjCBuiltinClassTy, clang::ASTContext::ObjCBuiltinIdTy, S, clang::Declarator::setInvalidType(), clang::ASTContext::ShortTy, clang::ASTContext::SignedCharTy, clang::DeclSpec::TSS_signed, clang::DeclSpec::TSS_unsigned, clang::DeclSpec::TSS_unspecified, clang::DeclSpec::TST_atomic, clang::DeclSpec::TST_auto, clang::DeclSpec::TST_bool, clang::DeclSpec::TST_char, clang::DeclSpec::TST_char16, clang::DeclSpec::TST_char32, clang::DeclSpec::TST_class, clang::DeclSpec::TST_decimal128, clang::DeclSpec::TST_decimal32, clang::DeclSpec::TST_decimal64, clang::DeclSpec::TST_decltype, clang::DeclSpec::TST_decltype_auto, clang::DeclSpec::TST_double, clang::DeclSpec::TST_enum, clang::DeclSpec::TST_error, clang::DeclSpec::TST_float, clang::DeclSpec::TST_half, clang::DeclSpec::TST_int, clang::DeclSpec::TST_int128, clang::DeclSpec::TST_interface, clang::DeclSpec::TST_struct, clang::DeclSpec::TST_typename, clang::DeclSpec::TST_typeofExpr, clang::DeclSpec::TST_typeofType, clang::DeclSpec::TST_underlyingType, clang::DeclSpec::TST_union, clang::DeclSpec::TST_unknown_anytype, clang::DeclSpec::TST_unspecified, clang::DeclSpec::TST_void, clang::DeclSpec::TST_wchar, clang::DeclSpec::TSW_long, clang::DeclSpec::TSW_longlong, clang::DeclSpec::TSW_short, clang::DeclSpec::TSW_unspecified, clang::ASTContext::UnknownAnyTy, clang::ASTContext::UnsignedCharTy, clang::ASTContext::UnsignedInt128Ty, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongLongTy, clang::ASTContext::UnsignedLongTy, clang::ASTContext::UnsignedShortTy, clang::ASTContext::VoidTy, and clang::ASTContext::WCharTy.
Referenced by GetDeclSpecTypeForDeclarator().
static void diagnoseBadTypeAttribute | ( | Sema & | S, |
const AttributeList & | attr, | ||
QualType | type | ||
) | [static] |
diagnoseBadTypeAttribute - Diagnoses a type attribute which doesn't apply to the given type.
Definition at line 64 of file SemaType.cpp.
References clang::Sema::Diag(), clang::Sema::findMacroSpelling(), clang::AttributeList::getArgAsIdent(), clang::AttributeList::getKind(), clang::AttributeList::getLoc(), clang::IdentifierInfo::getName(), clang::AttributeList::getName(), clang::IdentifierLoc::Ident, clang::AttributeList::isArgIdent(), clang::SourceLocation::isMacroID(), clang::IdentifierInfo::isStr(), TDS_Function, TDS_ObjCObjOrBlock, TDS_Pointer, and clang::ast_matchers::type.
Referenced by distributeFunctionTypeAttr(), and distributeObjCPointerTypeAttr().
static void diagnoseRedundantReturnTypeQualifiers | ( | Sema & | S, |
QualType | RetTy, | ||
Declarator & | D, | ||
unsigned | FunctionChunkIndex | ||
) | [static] |
Definition at line 2043 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::PointerTypeInfo::AtomicQualLoc, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::PointerTypeInfo::ConstQualLoc, clang::Sema::diagnoseIgnoredQualifiers(), clang::DeclaratorChunk::Fun, clang::DeclaratorChunk::Function, clang::DeclSpec::getAtomicSpecLoc(), clang::DeclSpec::getConstSpecLoc(), clang::QualType::getCVRQualifiers(), clang::Declarator::getDeclSpec(), clang::SourceLocation::getFromRawEncoding(), clang::Declarator::getIdentifierLoc(), clang::UnqualifiedId::getKind(), clang::QualType::getLocalCVRQualifiers(), clang::Declarator::getName(), clang::Declarator::getNumTypeObjects(), clang::DeclSpec::getRestrictSpecLoc(), clang::Declarator::getTypeObject(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getVolatileSpecLoc(), clang::DeclaratorChunk::FunctionTypeInfo::hasTrailingReturnType(), clang::UnqualifiedId::IK_ConversionFunctionId, clang::Type::isAtomicType(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Ptr, clang::DeclaratorChunk::Reference, clang::DeclaratorChunk::PointerTypeInfo::RestrictQualLoc, clang::DeclSpec::TQ_atomic, clang::DeclaratorChunk::PointerTypeInfo::TypeQuals, and clang::DeclaratorChunk::PointerTypeInfo::VolatileQualLoc.
Referenced by GetFullTypeForDeclarator().
static void distributeFunctionTypeAttr | ( | TypeProcessingState & | state, |
AttributeList & | attr, | ||
QualType | type | ||
) | [static] |
A function type attribute was written somewhere in a declaration other* than on the declarator itself or in the decl spec. Given that it didn't apply in whatever position it was written in, try to move it to a more appropriate position.
Definition at line 485 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, diagnoseBadTypeAttribute(), clang::DeclaratorChunk::Function, clang::DeclaratorChunk::getAttrListRef(), clang::Declarator::getTypeObject(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, moveAttrFromListToList(), clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, and clang::ast_matchers::type.
Referenced by processTypeAttrs().
static void distributeFunctionTypeAttrFromDeclarator | ( | TypeProcessingState & | state, |
AttributeList & | attr, | ||
QualType & | declSpecType | ||
) | [static] |
A function type attribute was written on the declarator. Try to apply it somewhere.
Definition at line 566 of file SemaType.cpp.
References distributeFunctionTypeAttrToInnermost(), clang::Declarator::getAttrListRef(), and spliceAttrOutOfList().
Referenced by distributeTypeAttrsFromDeclarator().
static void distributeFunctionTypeAttrFromDeclSpec | ( | TypeProcessingState & | state, |
AttributeList & | attr, | ||
QualType & | declSpecType | ||
) | [static] |
A function type attribute was written in the decl spec. Try to apply it somewhere.
Definition at line 538 of file SemaType.cpp.
References distributeFunctionTypeAttrToInnermost(), clang::AttributeList::isCXX11Attribute(), and moveAttrFromListToList().
Referenced by processTypeAttrs().
static bool distributeFunctionTypeAttrToInnermost | ( | TypeProcessingState & | state, |
AttributeList & | attr, | ||
AttributeList *& | attrList, | ||
QualType & | declSpecType | ||
) | [static] |
Try to distribute a function type attribute to the innermost function chunk or type. Returns true if the attribute was distributed, false if no location was found.
Definition at line 517 of file SemaType.cpp.
References clang::DeclaratorChunk::Function, clang::DeclaratorChunk::getAttrListRef(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), handleFunctionTypeAttr(), clang::DeclaratorChunk::Kind, and moveAttrFromListToList().
Referenced by distributeFunctionTypeAttrFromDeclarator(), and distributeFunctionTypeAttrFromDeclSpec().
static void distributeObjCPointerTypeAttr | ( | TypeProcessingState & | state, |
AttributeList & | attr, | ||
QualType | type | ||
) | [static] |
Given that an objc_gc attribute was written somewhere on a declaration *other* than on the declarator itself (for which, use distributeObjCPointerTypeAttrFromDeclarator), and given that it didn't apply in whatever position it was written in, try to move it to a more appropriate position.
Definition at line 370 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, diagnoseBadTypeAttribute(), clang::DeclaratorChunk::Function, clang::DeclaratorChunk::getAttrListRef(), clang::AttributeList::getKind(), clang::Declarator::getTypeObject(), clang::DeclaratorChunk::Kind, maybeMovePastReturnType(), clang::DeclaratorChunk::MemberPointer, moveAttrFromListToList(), clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, and clang::ast_matchers::type.
Referenced by processTypeAttrs().
static void distributeObjCPointerTypeAttrFromDeclarator | ( | TypeProcessingState & | state, |
AttributeList & | attr, | ||
QualType & | declSpecType | ||
) | [static] |
Distribute an objc_gc type attribute that was written on the declarator.
Definition at line 424 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::DeclSpec::getAttributes(), clang::DeclaratorChunk::getAttrListRef(), clang::Declarator::getAttrListRef(), clang::ParsedAttributes::getListRef(), clang::Declarator::getMutableDeclSpec(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), handleObjCPointerTypeAttr(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, moveAttrFromListToList(), clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, and spliceAttrOutOfList().
Referenced by distributeTypeAttrsFromDeclarator().
static void distributeTypeAttrsFromDeclarator | ( | TypeProcessingState & | state, |
QualType & | declSpecType | ||
) | [static] |
Given that there are attributes written on the declarator itself, try to distribute any type attributes to the appropriate declarator chunk.
These are attributes like the following: int f ATTR; int (f ATTR)(); but not necessarily this: int f() ATTR;
Definition at line 592 of file SemaType.cpp.
References distributeFunctionTypeAttrFromDeclarator(), distributeObjCPointerTypeAttrFromDeclarator(), FUNCTION_TYPE_ATTRS_CASELIST, clang::AttributeList::getNext(), MS_TYPE_ATTRS_CASELIST, and OBJC_POINTER_TYPE_ATTRS_CASELIST.
Referenced by GetDeclSpecTypeForDeclarator().
static void fillAtomicQualLoc | ( | AtomicTypeLoc | ATL, |
const DeclaratorChunk & | Chunk | ||
) | [static] |
Definition at line 3776 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::PointerTypeInfo::AtomicQualLoc, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::SourceLocation::getFromRawEncoding(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Ptr, clang::DeclaratorChunk::Reference, clang::AtomicTypeLoc::setKWLoc(), and clang::AtomicTypeLoc::setParensRange().
Referenced by clang::Sema::GetTypeSourceInfoForDeclarator().
static void fillAttributedTypeLoc | ( | AttributedTypeLoc | TL, |
const AttributeList * | attrs | ||
) | [static] |
Definition at line 3448 of file SemaType.cpp.
References clang::AttributeList::getArgAsExpr(), clang::AttributeList::getArgAsIdent(), clang::AttributedTypeLoc::getAttrKind(), getAttrListKind(), clang::Expr::getExprLoc(), clang::AttributeList::getKind(), clang::AttributeList::getLoc(), clang::AttributeList::getNext(), clang::AttributedTypeLoc::hasAttrEnumOperand(), clang::AttributedTypeLoc::hasAttrExprOperand(), clang::AttributedTypeLoc::hasAttrOperand(), clang::AttributeList::isArgExpr(), clang::AttributeList::isArgIdent(), clang::IdentifierLoc::Loc, clang::AttributedTypeLoc::setAttrEnumOperandLoc(), clang::AttributedTypeLoc::setAttrExprOperand(), clang::AttributedTypeLoc::setAttrNameLoc(), and clang::AttributedTypeLoc::setAttrOperandParensRange().
Referenced by clang::Sema::GetTypeSourceInfoForDeclarator().
static AttributeList::Kind getAttrListKind | ( | AttributedType::Kind | kind | ) | [static] |
Map an AttributedType::Kind to an AttributeList::Kind.
Definition at line 3395 of file SemaType.cpp.
References clang::AttributedType::attr_address_space, clang::AttributedType::attr_cdecl, clang::AttributedType::attr_fastcall, clang::AttributedType::attr_inteloclbicc, clang::AttributedType::attr_ms_abi, clang::AttributedType::attr_neon_polyvector_type, clang::AttributedType::attr_neon_vector_type, clang::AttributedType::attr_noreturn, clang::AttributedType::attr_objc_gc, clang::AttributedType::attr_objc_ownership, clang::AttributedType::attr_pascal, clang::AttributedType::attr_pcs, clang::AttributedType::attr_pcs_vfp, clang::AttributedType::attr_pnaclcall, clang::AttributedType::attr_ptr32, clang::AttributedType::attr_ptr64, clang::AttributedType::attr_regparm, clang::AttributedType::attr_sptr, clang::AttributedType::attr_stdcall, clang::AttributedType::attr_sysv_abi, clang::AttributedType::attr_thiscall, clang::AttributedType::attr_uptr, clang::AttributedType::attr_vector_size, and clang::AttributedType::attr_vectorcall.
Referenced by fillAttributedTypeLoc(), and handleMSPointerTypeQualifierAttr().
static CallingConv getCCForDeclaratorChunk | ( | Sema & | S, |
Declarator & | D, | ||
const DeclaratorChunk::FunctionTypeInfo & | FTI, | ||
unsigned | ChunkIndex | ||
) | [static] |
Helper for figuring out the default CC for a function declarator type. If this is the outermost chunk, then we can determine the CC from the declarator context. If not, then this could be either a member function type or normal function type.
Definition at line 2442 of file SemaType.cpp.
References clang::Sema::Context, clang::DeclaratorChunk::Function, clang::Declarator::getDeclSpec(), clang::ASTContext::getDefaultCallingConvention(), clang::Sema::getLangOpts(), clang::DeclSpec::getStorageClassSpec(), clang::Declarator::getTypeObject(), clang::Declarator::isFirstDeclarationOfMember(), clang::Declarator::isFunctionDeclarator(), clang::Declarator::isStaticMember(), clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, and clang::DeclSpec::SCS_typedef.
Referenced by GetFullTypeForDeclarator().
static AttributedType::Kind getCCTypeAttrKind | ( | AttributeList & | Attr | ) | [static] |
Definition at line 4426 of file SemaType.cpp.
References clang::AttributedType::attr_cdecl, clang::AttributedType::attr_fastcall, clang::AttributedType::attr_inteloclbicc, clang::AttributedType::attr_ms_abi, clang::AttributedType::attr_pascal, clang::AttributedType::attr_pcs, clang::AttributedType::attr_pcs_vfp, clang::AttributedType::attr_pnaclcall, clang::AttributedType::attr_stdcall, clang::AttributedType::attr_sysv_abi, clang::AttributedType::attr_thiscall, clang::AttributedType::attr_vectorcall, clang::AttributeList::getArgAsExpr(), clang::AttributeList::getArgAsIdent(), clang::AttributeList::getKind(), clang::IdentifierInfo::getName(), clang::IdentifierLoc::Ident, clang::AttributeList::isArgExpr(), and clang::AttributeList::isInvalid().
Referenced by handleFunctionTypeAttr().
static QualType GetDeclSpecTypeForDeclarator | ( | TypeProcessingState & | state, |
TypeSourceInfo *& | ReturnTypeInfo | ||
) | [static] |
Definition at line 2110 of file SemaType.cpp.
References clang::Declarator::AliasDeclContext, clang::Declarator::AliasTemplateContext, clang::Declarator::BlockContext, clang::Declarator::BlockLiteralContext, clang::Declarator::ConditionContext, clang::DeclSpec::containsPlaceholderType(), clang::Sema::Context, clang::UnqualifiedId::ConversionFunctionId, clang::Declarator::ConversionIdContext, ConvertDeclSpecToType(), clang::Sema::CurContext, clang::Declarator::CXXCatchContext, clang::Declarator::CXXNewContext, clang::Sema::Diag(), distributeTypeAttrsFromDeclarator(), clang::diag::Error, clang::Declarator::FileContext, clang::Declarator::ForContext, clang::DeclaratorChunk::Fun, clang::DeclaratorChunk::Function, clang::DeclSpec::getAttributes(), clang::Declarator::getAttributes(), clang::SourceRange::getBegin(), clang::Type::getContainedAutoType(), clang::Declarator::getContext(), clang::Declarator::getDeclSpec(), clang::UnqualifiedId::getKind(), clang::Sema::getLangOpts(), clang::ParsedAttributes::getList(), clang::Decl::getLocation(), clang::Declarator::getName(), clang::Declarator::getNumTypeObjects(), clang::DeclSpec::getRepAsDecl(), clang::UnqualifiedId::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::ASTContext::getTypeDeclType(), clang::Sema::GetTypeFromParser(), clang::Declarator::getTypeObject(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::DeclaratorChunk::FunctionTypeInfo::hasTrailingReturnType(), clang::UnqualifiedId::IK_ConstructorName, clang::UnqualifiedId::IK_ConstructorTemplateId, clang::UnqualifiedId::IK_ConversionFunctionId, clang::UnqualifiedId::IK_DestructorName, clang::UnqualifiedId::IK_Identifier, clang::UnqualifiedId::IK_ImplicitSelfParam, clang::UnqualifiedId::IK_LiteralOperatorId, clang::UnqualifiedId::IK_OperatorFunctionId, clang::UnqualifiedId::IK_TemplateId, clang::ASTContext::IntTy, clang::TagDecl::isCompleteDefinition(), clang::Declarator::isFunctionDeclarator(), clang::Declarator::isInvalidType(), clang::DeclSpec::isTypeSpecOwned(), clang::DeclaratorChunk::Kind, clang::Declarator::KNRTypeListContext, clang::Declarator::LambdaExprContext, clang::Declarator::LambdaExprParameterContext, clang::Declarator::MemberContext, clang::Declarator::ObjCCatchContext, clang::Declarator::ObjCParameterContext, clang::Declarator::ObjCResultContext, processTypeAttrs(), clang::Declarator::PrototypeContext, clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, clang::TagDecl::setEmbeddedInDeclarator(), clang::Declarator::setInvalidType(), TAL_DeclSpec, clang::Declarator::TemplateParamContext, clang::Declarator::TemplateTypeArgContext, clang::Declarator::TrailingReturnContext, clang::DeclSpec::TST_auto, clang::DeclSpec::TST_decltype_auto, clang::TTK_Class, clang::TTK_Enum, clang::TTK_Interface, clang::TTK_Struct, clang::TTK_Union, clang::Declarator::TypeNameContext, and clang::ASTContext::VoidTy.
Referenced by clang::Sema::GetTypeForDeclarator(), and clang::Sema::GetTypeForDeclaratorCast().
static QualType getDecltypeForExpr | ( | Sema & | S, |
Expr * | E | ||
) | [static] |
getDecltypeForExpr - Given an expr, will return the decltype for that expression, according to the rules in C++11 [dcl.type.simple]p4 and C++11 [expr.lambda.prim]p18.
Definition at line 5452 of file SemaType.cpp.
References clang::Sema::Context, clang::ASTContext::DependentTy, clang::Sema::getCapturedDeclRefType(), clang::Sema::getCurLambda(), clang::ASTContext::getLValueReferenceType(), clang::ASTContext::getRValueReferenceType(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::Expr::IgnoreParens(), clang::QualType::isNull(), clang::Expr::isTypeDependent(), clang::VK_LValue, clang::VK_RValue, and clang::VK_XValue.
Referenced by clang::Sema::BuildDecltypeType().
static TypeSourceInfo* GetFullTypeForDeclarator | ( | TypeProcessingState & | state, |
QualType | declSpecType, | ||
TypeSourceInfo * | TInfo | ||
) | [static] |
Definition at line 2483 of file SemaType.cpp.
References clang::QualType::addConst(), clang::Declarator::AliasDeclContext, clang::Declarator::AliasTemplateContext, clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, clang::Declarator::BlockContext, clang::Declarator::BlockLiteralContext, clang::DeclaratorChunk::BlockPointer, clang::Sema::BuildArrayType(), clang::Sema::BuildBlockPointerType(), clang::Sema::BuildMemberPointerType(), clang::Sema::BuildParenType(), clang::Sema::BuildPointerType(), clang::Sema::BuildQualifiedType(), clang::Sema::BuildReferenceType(), clang::Type::castAs(), clang::Sema::CheckDistantExceptionSpec(), clang::Sema::checkExceptionSpecification(), clang::DeclaratorChunk::Cls, clang::Sema::computeDeclContext(), clang::Declarator::ConditionContext, clang::Qualifiers::Const, clang::FunctionProtoType::ExtProtoInfo::ConsumedParameters, clang::DeclSpec::containsPlaceholderType(), clang::Type::containsUnexpandedParameterPack(), clang::Sema::Context, Context, clang::Declarator::ConversionIdContext, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::Declarator::CXXCatchContext, clang::Declarator::CXXNewContext, clang::Sema::Diag(), diagnoseRedundantReturnTypeQualifiers(), clang::ASTContext::DoubleTy, clang::DeclaratorChunk::EndLoc, clang::EST_ComputedNoexcept, clang::EST_Dynamic, clang::ETK_None, clang::DeclaratorChunk::FunctionTypeInfo::Exceptions, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::Declarator::FileContext, clang::Declarator::ForContext, clang::DeclaratorChunk::Fun, clang::DeclaratorChunk::Function, clang::Type::getAs(), clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsType(), clang::DeclSpec::getAttributes(), clang::Declarator::getAttributes(), clang::DeclaratorChunk::getAttrs(), clang::CXXScopeSpec::getBeginLoc(), getCCForDeclaratorChunk(), clang::DeclaratorChunk::FunctionTypeInfo::getConstQualifierLoc(), clang::Type::getContainedAutoType(), clang::Declarator::getContext(), clang::QualType::getCVRQualifiers(), clang::Declarator::getCXXScopeSpec(), clang::Declarator::getDeclSpec(), clang::ASTContext::getDependentNameType(), clang::ASTContext::getElaboratedType(), clang::DeclaratorChunk::FunctionTypeInfo::getEllipsisLoc(), clang::Declarator::getEllipsisLoc(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecLoc(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecType(), clang::FunctionProtoType::getExtProtoInfo(), clang::ASTContext::getFunctionNoProtoType(), getFunctionQualifiersAsString(), clang::ASTContext::getFunctionType(), clang::Declarator::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::SourceManager::getImmediateExpansionRange(), clang::Attr::getKind(), clang::NestedNameSpecifier::getKind(), clang::UnqualifiedId::getKind(), clang::Sema::getLangOpts(), clang::ParsedAttributes::getList(), clang::Decl::getLocation(), clang::TypeLoc::getLocEnd(), clang::DeclSpec::getLocEnd(), clang::Sema::getLocForEndOfToken(), clang::TypeLoc::getLocStart(), clang::Declarator::getLocStart(), clang::IdentifierInfo::getName(), clang::Declarator::getName(), clang::AttributeList::getNext(), clang::ASTContext::getNullTypeSourceInfo(), clang::Declarator::getNumTypeObjects(), clang::Qualifiers::getObjCLifetime(), clang::ASTContext::getObjCObjectPointerType(), clang::Sema::getOpenCLOptions(), clang::ASTContext::getPackExpansionType(), clang::FunctionProtoType::getParamTypes(), clang::NestedNameSpecifier::getPrefix(), getPrintableNameForEntity(), clang::ASTContext::getPromotedIntegerType(), clang::QualType::getQualifiers(), clang::CXXScopeSpec::getRange(), clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc(), clang::DeclSpec::getRepAsDecl(), clang::DeclaratorChunk::FunctionTypeInfo::getRestrictQualifierLoc(), clang::FunctionType::getReturnType(), clang::CXXScopeSpec::getScopeRep(), clang::Sema::getSourceManager(), clang::DeclSpec::getSourceRange(), clang::Declarator::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnType(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ValueDecl::getType(), clang::ASTContext::getTypeDeclType(), clang::Sema::GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::Declarator::getTypeObject(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::Sema::GetTypeSourceInfoForDeclarator(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::DeclaratorChunk::FunctionTypeInfo::getVolatileQualifierLoc(), clang::NestedNameSpecifier::Global, clang::Decl::hasAttr(), clang::Declarator::hasEllipsis(), clang::Qualifiers::hasObjCLifetime(), clang::DeclaratorChunk::FunctionTypeInfo::hasPrototype, clang::QualType::hasQualifiers(), clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier(), clang::DeclaratorChunk::ReferenceTypeInfo::HasRestrict, clang::DeclaratorChunk::ArrayTypeInfo::hasStatic, clang::DeclSpec::hasTagDefinition(), clang::FunctionProtoType::ExtProtoInfo::HasTrailingReturn, clang::DeclaratorChunk::FunctionTypeInfo::hasTrailingReturnType(), clang::DeclaratorChunk::ParamInfo::Ident, clang::NestedNameSpecifier::Identifier, clang::DeclaratorChunk::ParamInfo::IdentLoc, clang::UnqualifiedId::IK_ConversionFunctionId, clang::ASTContext::IntTy, clang::DeclaratorChunk::FunctionTypeInfo::isAmbiguous, clang::Type::isArrayType(), clang::Type::isAtomicType(), clang::DeclSpec::isConstexprSpecified(), clang::AutoType::isDecltypeAuto(), clang::Sema::isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::DeclSpec::isFriendSpecified(), clang::Declarator::isFunctionDeclarationContext(), clang::Declarator::isFunctionDeclarator(), clang::Type::isFunctionProtoType(), clang::Type::isFunctionType(), clang::Type::isHalfType(), clang::SourceLocation::isInvalid(), clang::CXXScopeSpec::isInvalid(), clang::Declarator::isInvalidType(), clang::SourceLocation::isMacroID(), clang::QualType::isNull(), clang::Type::isObjCObjectType(), clang::Type::isObjectType(), clang::Declarator::isPrototypeContext(), clang::DeclContext::isRecord(), clang::Type::isRecordType(), clang::CXXScopeSpec::isSet(), clang::DeclaratorChunk::ArrayTypeInfo::isStar, clang::SourceLocation::isValid(), clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, clang::DeclaratorChunk::Kind, clang::Declarator::KNRTypeListContext, clang::Declarator::LambdaExprContext, clang::Declarator::LambdaExprParameterContext, clang::DeclaratorChunk::Loc, clang::DeclaratorChunk::ReferenceTypeInfo::LValueRef, clang::DeclaratorChunk::Mem, clang::Declarator::MemberContext, clang::DeclaratorChunk::MemberPointer, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::DeclaratorChunk::FunctionTypeInfo::NoexceptExpr, clang::ArrayType::Normal, clang::DeclaratorChunk::ArrayTypeInfo::NumElts, clang::DeclaratorChunk::FunctionTypeInfo::NumExceptions, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::Declarator::ObjCCatchContext, clang::Declarator::ObjCParameterContext, clang::Declarator::ObjCResultContext, clang::DeclaratorChunk::ParamInfo::Param, clang::DeclaratorChunk::FunctionTypeInfo::Params, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pointer, processTypeAttrs(), clang::Declarator::PrototypeContext, clang::DeclaratorChunk::Ptr, clang::TypeLocBuilder::push(), clang::TypeLocBuilder::pushFullCopy(), clang::DeclaratorChunk::TypeAndRange::Range, clang::DeclaratorChunk::Ref, clang::DeclaratorChunk::Reference, clang::FunctionProtoType::ExtProtoInfo::RefQualifier, clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef, clang::Qualifiers::Restrict, clang::RQ_LValue, clang::RQ_None, clang::RQ_RValue, S, clang::DeclaratorChunk::MemberPointerTypeInfo::Scope(), clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, clang::Declarator::setEllipsisLoc(), clang::Decl::setInvalidDecl(), clang::Declarator::setInvalidType(), clang::ParmVarDecl::setKNRPromoted(), clang::ObjCObjectPointerTypeLoc::setStarLoc(), clang::ValueDecl::setType(), clang::Sema::SourceMgr, clang::ArrayType::Star, clang::ArrayType::Static, clang::NestedNameSpecifier::Super, TAL_DeclChunk, TAL_DeclName, clang::Declarator::TemplateParamContext, clang::Declarator::TemplateTypeArgContext, clang::Declarator::TrailingReturnContext, clang::DeclSpec::TST_auto, clang::DeclaratorChunk::TypeAndRange::Ty, clang::Declarator::TypeNameContext, clang::DeclaratorChunk::PointerTypeInfo::TypeQuals, clang::DeclaratorChunk::ArrayTypeInfo::TypeQuals, clang::DeclaratorChunk::FunctionTypeInfo::TypeQuals, clang::DeclaratorChunk::BlockPointerTypeInfo::TypeQuals, clang::DeclaratorChunk::MemberPointerTypeInfo::TypeQuals, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, clang::NestedNameSpecifier::TypeSpec, clang::NestedNameSpecifier::TypeSpecWithTemplate, clang::FunctionProtoType::ExtProtoInfo::Variadic, clang::Qualifiers::Volatile, and warnAboutAmbiguousFunction().
Referenced by clang::Sema::GetTypeForDeclarator(), and clang::Sema::GetTypeForDeclaratorCast().
static std::string getFunctionQualifiersAsString | ( | const FunctionProtoType * | FnTy | ) | [static] |
Definition at line 1317 of file SemaType.cpp.
References clang::Qualifiers::fromCVRMask(), clang::FunctionProtoType::getRefQualifier(), clang::FunctionProtoType::getTypeQuals(), clang::RQ_LValue, clang::RQ_None, and clang::RQ_RValue.
Referenced by checkQualifiedFunction(), and GetFullTypeForDeclarator().
static unsigned getLiteralDiagFromTagKind | ( | TagTypeKind | Tag | ) | [static] |
Get diagnostic select index for tag kind for literal type diagnostic message. WARNING: Indexes apply to particular diagnostics only!
Definition at line 5306 of file SemaType.cpp.
References clang::TTK_Class, clang::TTK_Interface, and clang::TTK_Struct.
Referenced by clang::Sema::RequireLiteralType().
static std::string getPrintableNameForEntity | ( | DeclarationName | Entity | ) | [static] |
Definition at line 1182 of file SemaType.cpp.
References clang::DeclarationName::getAsString().
Referenced by clang::Sema::BuildArrayType(), clang::Sema::BuildMemberPointerType(), clang::Sema::BuildPointerType(), and GetFullTypeForDeclarator().
static void HandleAddressSpaceTypeAttribute | ( | QualType & | Type, |
const AttributeList & | Attr, | ||
Sema & | S | ||
) | [static] |
HandleAddressSpaceTypeAttribute - Process an address_space attribute on the specified type. The attribute contains 1 argument, the id of the address space for the type.
Definition at line 3916 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, clang::Sema::Context, clang::Sema::Diag(), clang::QualType::getAddressSpace(), clang::ASTContext::getAddrSpaceQualType(), clang::AttributeList::getArgAsExpr(), clang::AttributeList::getKind(), clang::AttributeList::getLoc(), clang::AttributeList::getName(), clang::AttributeList::getNumArgs(), clang::Stmt::getSourceRange(), clang::Type::isFunctionType(), clang::Expr::isIntegerConstantExpr(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Qualifiers::MaxAddressSpace, clang::LangAS::opencl_constant, clang::LangAS::opencl_global, clang::LangAS::opencl_local, and clang::AttributeList::setInvalid().
Referenced by processTypeAttrs().
static void HandleExtVectorTypeAttr | ( | QualType & | CurType, |
const AttributeList & | Attr, | ||
Sema & | S | ||
) | [static] |
Process the OpenCL-like ext_vector_type attribute when it occurs on a type.
Definition at line 4693 of file SemaType.cpp.
References clang::Sema::ActOnIdExpression(), clang::Sema::BuildExtVectorType(), clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::AttributeList::getArgAsExpr(), clang::AttributeList::getArgAsIdent(), clang::Sema::getCurScope(), clang::AttributeList::getLoc(), clang::AttributeList::getName(), clang::AttributeList::getNumArgs(), clang::ast_matchers::id(), clang::IdentifierLoc::Ident, clang::AttributeList::isArgIdent(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), and clang::QualType::isNull().
Referenced by processTypeAttrs().
static bool handleFunctionTypeAttr | ( | TypeProcessingState & | state, |
AttributeList & | attr, | ||
QualType & | type | ||
) | [static] |
Process an individual function attribute. Returns true to indicate that the attribute was handled, false if it wasn't.
Definition at line 4470 of file SemaType.cpp.
References clang::ASTContext::adjustFunctionType(), clang::CC_X86FastCall, clang::CC_X86StdCall, clang::Sema::CheckCallingConvAttr(), clang::Sema::CheckNoReturnAttr(), clang::Sema::CheckRegparmAttr(), clang::Sema::Context, clang::Sema::Diag(), clang::ASTContext::getAttributedType(), clang::AttributedType::getAttrKind(), clang::FunctionType::getCallConv(), clang::Sema::getCallingConvAttributedType(), getCCTypeAttrKind(), clang::FunctionType::getHasRegParm(), clang::AttributeList::getKind(), clang::Sema::getLangOpts(), clang::AttributeList::getLoc(), clang::FunctionType::getNameForCallConv(), clang::AttributeList::getNumArgs(), clang::FunctionProtoType::isVariadic(), clang::AttributeList::setInvalid(), and clang::supportsVariadicCall().
Referenced by distributeFunctionTypeAttrToInnermost(), and processTypeAttrs().
static bool handleMSPointerTypeQualifierAttr | ( | TypeProcessingState & | state, |
AttributeList & | attr, | ||
QualType & | type | ||
) | [static] |
Definition at line 4363 of file SemaType.cpp.
References clang::AttributedType::attr_ptr32, clang::AttributedType::attr_ptr64, clang::AttributedType::attr_sptr, clang::AttributedType::attr_uptr, clang::Sema::Context, clang::Sema::Diag(), clang::ASTContext::getAttributedType(), clang::AttributedType::getAttrKind(), getAttrListKind(), clang::AttributedType::getEquivalentType(), clang::AttributeList::getKind(), clang::AttributeList::getLoc(), clang::AttributeList::getName(), and clang::Type::isMemberPointerType().
Referenced by processTypeAttrs().
static void HandleNeonVectorTypeAttr | ( | QualType & | CurType, |
const AttributeList & | Attr, | ||
Sema & | S, | ||
VectorType::VectorKind | VecKind | ||
) | [static] |
HandleNeonVectorTypeAttr - The "neon_vector_type" and "neon_polyvector_type" attributes are used to create vector types that are mangled according to ARM's ABI. Otherwise, these types are identical to those created with the "vector_size" attribute. Unlike "vector_size" the argument to these Neon attributes is the number of vector elements, not the vector size in bytes. The vector width and element type must match one of the standard Neon vector types.
Definition at line 4783 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, clang::Sema::Context, clang::Sema::Diag(), clang::AttributeList::getArgAsExpr(), clang::AttributeList::getLoc(), clang::AttributeList::getName(), clang::AttributeList::getNumArgs(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVectorType(), clang::TargetInfo::hasFeature(), clang::Expr::isIntegerConstantExpr(), isPermittedNeonBaseType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::AttributeList::setInvalid().
Referenced by processTypeAttrs().
static bool handleObjCGCTypeAttr | ( | TypeProcessingState & | state, |
AttributeList & | attr, | ||
QualType & | type | ||
) | [static] |
handleObjCGCTypeAttr - Process the __attribute__((objc_gc)) type attribute on the specified type. Returns true to indicate that the attribute was handled, false to indicate that the type does not permit the attribute.
Definition at line 4178 of file SemaType.cpp.
References clang::AANT_ArgumentString, clang::AttributedType::attr_objc_gc, clang::Sema::Context, clang::Sema::Diag(), clang::Qualifiers::GCNone, clang::AttributeList::getArgAsIdent(), clang::ASTContext::getAttributedType(), clang::AttributeList::getLoc(), clang::AttributeList::getName(), clang::AttributeList::getNumArgs(), clang::QualType::getObjCGCAttr(), clang::ASTContext::getObjCGCQualType(), clang::IdentifierLoc::Ident, clang::AttributeList::isArgIdent(), clang::Type::isBlockPointerType(), clang::Type::isObjCObjectPointerType(), clang::Type::isPointerType(), clang::IdentifierInfo::isStr(), clang::SourceLocation::isValid(), S, clang::AttributeList::setInvalid(), clang::Qualifiers::Strong, clang::ast_matchers::type, and clang::Qualifiers::Weak.
Referenced by handleObjCPointerTypeAttr().
static bool handleObjCOwnershipTypeAttr | ( | TypeProcessingState & | state, |
AttributeList & | attr, | ||
QualType & | type | ||
) | [static] |
handleObjCOwnershipTypeAttr - Process an objc_ownership attribute on the specified type.
Returns 'true' if the attribute was handled.
Definition at line 4027 of file SemaType.cpp.
References clang::AANT_ArgumentString, clang::Sema::DelayedDiagnostics::add(), clang::Qualifiers::addObjCLifetime(), clang::AttributedType::attr_objc_ownership, clang::Sema::Context, clang::Sema::DelayedDiagnostics, clang::Sema::Diag(), clang::AttributeList::getArgAsIdent(), clang::Type::getAs(), clang::ASTContext::getAttributedType(), clang::SourceManager::getExpansionLoc(), clang::SourceManager::getImmediateExpansionRange(), clang::Sema::getLangOpts(), clang::AttributeList::getLoc(), clang::IdentifierInfo::getName(), clang::AttributeList::getName(), clang::Declarator::getNumTypeObjects(), clang::Qualifiers::getObjCLifetime(), clang::Type::getPointeeType(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::SplitQualType::getSingleStepDesugaredType(), clang::Sema::getSourceManager(), hasDirectOwnershipQualifier(), clang::Qualifiers::hasObjCLifetime(), clang::IdentifierLoc::Ident, clang::AttributeList::isArgIdent(), clang::Type::isDependentType(), clang::SourceLocation::isMacroID(), clang::Type::isObjCRetainableType(), clang::Type::isPointerType(), clang::IdentifierInfo::isStr(), clang::Type::isUndeducedType(), clang::SourceLocation::isValid(), clang::sema::DelayedDiagnostic::makeForbiddenType(), maybeMovePastReturnType(), clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, clang::SplitQualType::Quals, clang::Qualifiers::removeObjCLifetime(), S, clang::AttributeList::setInvalid(), clang::Sema::DelayedDiagnostics::shouldDelayDiagnostics(), clang::QualType::split(), TDS_ObjCObjOrBlock, and clang::ast_matchers::type.
Referenced by handleObjCPointerTypeAttr().
static bool handleObjCPointerTypeAttr | ( | TypeProcessingState & | state, |
AttributeList & | attr, | ||
QualType & | type | ||
) | [static] |
Definition at line 297 of file SemaType.cpp.
References clang::AttributeList::getKind(), handleObjCGCTypeAttr(), and handleObjCOwnershipTypeAttr().
Referenced by distributeObjCPointerTypeAttrFromDeclarator(), and processTypeAttrs().
static void HandleVectorSizeAttr | ( | QualType & | CurType, |
const AttributeList & | Attr, | ||
Sema & | S | ||
) | [static] |
HandleVectorSizeAttribute - this attribute is only applicable to integral and float scalars, although arrays, pointers, and function return values are allowed in conjunction with this construct. Aggregates with this attribute are invalid, even if they are of the same size as a corresponding scalar. The raw attribute should contain precisely 1 argument, the vector size for the variable, measured in bytes. If curType and rawAttr are well formed, this routine will return a new vector type.
Definition at line 4634 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, clang::Sema::Context, clang::Sema::Diag(), clang::VectorType::GenericVector, clang::AttributeList::getArgAsExpr(), clang::AttributeList::getLoc(), clang::AttributeList::getName(), clang::AttributeList::getNumArgs(), clang::Stmt::getSourceRange(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVectorType(), clang::Type::isBooleanType(), clang::Type::isBuiltinType(), clang::Expr::isIntegerConstantExpr(), clang::Type::isIntegerType(), clang::Type::isRealFloatingType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::VectorType::isVectorSizeTooLarge(), and clang::AttributeList::setInvalid().
Referenced by processTypeAttrs().
static bool hasDirectOwnershipQualifier | ( | QualType | type | ) | [static] |
Does this type have a "direct" ownership qualifier? That is, is it written like "__strong id", as opposed to something like "typeof(foo)", where that happens to be strong?
Definition at line 3996 of file SemaType.cpp.
References clang::AttributedType::attr_objc_ownership, clang::QualType::getQualifiers(), and clang::Qualifiers::hasObjCLifetime().
Referenced by handleObjCOwnershipTypeAttr().
static bool hasVisibleDefinition | ( | Sema & | S, |
NamedDecl * | D, | ||
NamedDecl ** | Suggested | ||
) | [static] |
Determine whether there is any declaration of D
that was ever a definition (perhaps before module merging) and is currently visible.
D | The definition of the entity. |
Suggested | Filled in with the declaration that should be made visible in order to provide a definition of this entity. |
Definition at line 5087 of file SemaType.cpp.
References clang::Sema::getLangOpts(), and clang::LookupResult::isVisible().
static QualType inferARCLifetimeForPointee | ( | Sema & | S, |
QualType | type, | ||
SourceLocation | loc, | ||
bool | isReference | ||
) | [static] |
Given that we're building a pointer or reference to the given.
Definition at line 1266 of file SemaType.cpp.
References clang::Sema::DelayedDiagnostics::add(), clang::Qualifiers::addObjCLifetime(), clang::Sema::Context, clang::Sema::DelayedDiagnostics, clang::Sema::Diag(), clang::QualType::getObjCLifetime(), clang::ASTContext::getQualifiedType(), clang::QualType::isConstQualified(), clang::Type::isObjCARCImplicitlyUnretainedType(), clang::Type::isObjCLifetimeType(), clang::Sema::isUnevaluatedContext(), clang::sema::DelayedDiagnostic::makeForbiddenType(), clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Sema::DelayedDiagnostics::shouldDelayDiagnostics(), and clang::ast_matchers::type.
Referenced by clang::Sema::BuildPointerType(), and clang::Sema::BuildReferenceType().
static void inferARCWriteback | ( | TypeProcessingState & | state, |
QualType & | declSpecType | ||
) | [static] |
Given that this is the declaration of a parameter under ARC, attempt to infer attributes and such for pointer-to-whatever types.
Definition at line 1898 of file SemaType.cpp.
References clang::Qualifiers::addObjCLifetime(), clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::Sema::Context, clang::DeclaratorChunk::Function, clang::DeclaratorChunk::getAttrs(), clang::AttributeList::getNext(), clang::Declarator::getNumTypeObjects(), clang::QualType::getObjCLifetime(), clang::ASTContext::getQualifiedType(), clang::Declarator::getTypeObject(), clang::Type::isObjCARCImplicitlyUnretainedType(), clang::Type::isObjCObjectType(), clang::Type::isObjCRetainableType(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, S, and transferARCOwnershipToDeclaratorChunk().
Referenced by clang::Sema::GetTypeForDeclarator().
static bool isArraySizeVLA | ( | Sema & | S, |
Expr * | ArraySize, | ||
llvm::APSInt & | SizeVal | ||
) | [static] |
Check whether the specified array size makes the array type a VLA. If so, return true, if not, return the size of the array in SizeVal.
Definition at line 1469 of file SemaType.cpp.
References clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Sema::LangOpts, and clang::Sema::VerifyIntegerConstantExpression().
Referenced by clang::Sema::BuildArrayType().
static bool isOmittedBlockReturnType | ( | const Declarator & | D | ) | [static] |
isOmittedBlockReturnType - Return true if this declarator is missing a return type because this is a omitted return type on a block literal.
Definition at line 47 of file SemaType.cpp.
References clang::Declarator::BlockLiteralContext, clang::DeclaratorChunk::Function, clang::Declarator::getContext(), clang::Declarator::getDeclSpec(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), clang::DeclSpec::hasTypeSpecifier(), and clang::DeclaratorChunk::Kind.
Referenced by ConvertDeclSpecToType().
static bool isPermittedNeonBaseType | ( | QualType & | Ty, |
VectorType::VectorKind | VecKind, | ||
Sema & | S | ||
) | [static] |
Definition at line 4728 of file SemaType.cpp.
References clang::Sema::Context, clang::Type::getAs(), clang::BuiltinType::getKind(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), and clang::VectorType::NeonPolyVector.
Referenced by HandleNeonVectorTypeAttr().
static DeclaratorChunk* maybeMovePastReturnType | ( | Declarator & | declarator, |
unsigned | i | ||
) | [static] |
Given the index of a declarator chunk, check whether that chunk directly specifies the return type of a function and, if so, find an appropriate place for it.
i | - a notional index which the search will start immediately inside |
Definition at line 311 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pointer, and clang::DeclaratorChunk::Reference.
Referenced by distributeObjCPointerTypeAttr(), and handleObjCOwnershipTypeAttr().
static void maybeSynthesizeBlockSignature | ( | TypeProcessingState & | state, |
QualType | declSpecType | ||
) | [static] |
Add a synthetic '()' to a block-literal declarator if it is required, given the return type.
Definition at line 632 of file SemaType.cpp.
References clang::Declarator::AddInnermostTypeInfo(), clang::EST_None, clang::DeclaratorChunk::getFunction(), clang::Declarator::getFunctionTypeInfo(), clang::Declarator::getLocStart(), clang::Declarator::getNumTypeObjects(), clang::DeclaratorChunk::FunctionTypeInfo::hasPrototype, clang::Declarator::isFunctionDeclarator(), and clang::Type::isFunctionType().
static void moveAttrFromListToList | ( | AttributeList & | attr, |
AttributeList *& | fromList, | ||
AttributeList *& | toList | ||
) | [static] |
Definition at line 262 of file SemaType.cpp.
References spliceAttrIntoList(), and spliceAttrOutOfList().
Referenced by distributeFunctionTypeAttr(), distributeFunctionTypeAttrFromDeclSpec(), distributeFunctionTypeAttrToInnermost(), distributeObjCPointerTypeAttr(), and distributeObjCPointerTypeAttrFromDeclarator().
static void processTypeAttrs | ( | TypeProcessingState & | state, |
QualType & | type, | ||
TypeAttrLocation | TAL, | ||
AttributeList * | attrs | ||
) | [static] |
Definition at line 4830 of file SemaType.cpp.
References distributeFunctionTypeAttr(), distributeFunctionTypeAttrFromDeclSpec(), distributeObjCPointerTypeAttr(), FUNCTION_TYPE_ATTRS_CASELIST, clang::AttributeList::getKind(), clang::AttributeList::getLoc(), clang::AttributeList::getName(), clang::AttributeList::getNext(), clang::AttributeList::getScopeName(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), handleFunctionTypeAttr(), handleMSPointerTypeQualifierAttr(), HandleNeonVectorTypeAttr(), handleObjCPointerTypeAttr(), HandleVectorSizeAttr(), clang::AttributeList::isCXX11Attribute(), clang::AttributeList::isInvalid(), clang::IdentifierInfo::isStr(), MS_TYPE_ATTRS_CASELIST, clang::VectorType::NeonPolyVector, clang::VectorType::NeonVector, OBJC_POINTER_TYPE_ATTRS_CASELIST, clang::AttributeList::setUsedAsTypeAttr(), TAL_DeclChunk, and TAL_DeclSpec.
Referenced by GetDeclSpecTypeForDeclarator(), and GetFullTypeForDeclarator().
static void spliceAttrIntoList | ( | AttributeList & | attr, |
AttributeList *& | head | ||
) | [static] |
Definition at line 240 of file SemaType.cpp.
References clang::AttributeList::setNext().
Referenced by moveAttrFromListToList(), and transferARCOwnershipToDeclaratorChunk().
static void spliceAttrOutOfList | ( | AttributeList & | attr, |
AttributeList *& | head | ||
) | [static] |
Definition at line 245 of file SemaType.cpp.
References clang::AttributeList::getNext(), and clang::AttributeList::setNext().
Referenced by distributeFunctionTypeAttrFromDeclarator(), distributeObjCPointerTypeAttrFromDeclarator(), and moveAttrFromListToList().
static void transferARCOwnership | ( | TypeProcessingState & | state, |
QualType & | declSpecTy, | ||
Qualifiers::ObjCLifetime | ownership | ||
) | [static] |
Used for transferring ownership in casts resulting in l-values.
Definition at line 3327 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), clang::Type::isObjCObjectType(), clang::Type::isObjCRetainableType(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, S, transferARCOwnershipToDeclaratorChunk(), and transferARCOwnershipToDeclSpec().
Referenced by clang::Sema::GetTypeForDeclaratorCast().
static void transferARCOwnershipToDeclaratorChunk | ( | TypeProcessingState & | state, |
Qualifiers::ObjCLifetime | ownership, | ||
unsigned | chunkIndex | ||
) | [static] |
Definition at line 3287 of file SemaType.cpp.
References clang::AttributeList::AS_GNU, clang::Sema::Context, clang::AttributePool::create(), clang::IdentifierTable::get(), clang::Declarator::getAttributePool(), clang::DeclaratorChunk::getAttrListRef(), clang::DeclaratorChunk::getAttrs(), clang::AttributeList::getNext(), clang::Declarator::getTypeObject(), clang::IdentifierLoc::Ident, clang::ASTContext::Idents, clang::IdentifierLoc::Loc, clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, S, and spliceAttrIntoList().
Referenced by inferARCWriteback(), and transferARCOwnership().
static void transferARCOwnershipToDeclSpec | ( | Sema & | S, |
QualType & | declSpecTy, | ||
Qualifiers::ObjCLifetime | ownership | ||
) | [static] |
Definition at line 3276 of file SemaType.cpp.
References clang::Qualifiers::addObjCLifetime(), clang::Sema::Context, clang::QualType::getObjCLifetime(), clang::ASTContext::getQualifiedType(), clang::Type::isObjCRetainableType(), and clang::Qualifiers::OCL_None.
Referenced by transferARCOwnership().
static void warnAboutAmbiguousFunction | ( | Sema & | S, |
Declarator & | D, | ||
DeclaratorChunk & | DeclType, | ||
QualType | RT | ||
) | [static] |
Produce an appropriate diagnostic for an ambiguity between a function declarator and a C++ direct-initializer.
Definition at line 2342 of file SemaType.cpp.
References clang::prec::Comma, clang::Declarator::ConditionContext, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), clang::Sema::CurContext, clang::Sema::Diag(), clang::DeclaratorChunk::EndLoc, clang::FDK_Declaration, clang::DeclaratorChunk::Fun, clang::Type::getAsCXXRecordDecl(), clang::SourceRange::getBegin(), clang::Declarator::getCommaLoc(), clang::Declarator::getContext(), clang::Sema::getCurScope(), clang::Declarator::getDeclSpec(), clang::SourceRange::getEnd(), clang::Sema::getFixItZeroInitializerForType(), clang::Declarator::getFunctionDefinitionKind(), clang::Declarator::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::Sema::getLocForEndOfToken(), clang::Decl::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::CXXRecordDecl::hasDefinition(), clang::CXXRecordDecl::hasUserProvidedDefaultConstructor(), clang::DeclaratorChunk::FunctionTypeInfo::isAmbiguous, clang::CXXRecordDecl::isEmpty(), clang::Declarator::isFirstDeclarator(), clang::Declarator::isFunctionDeclarator(), clang::DeclContext::isFunctionOrMethod(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Type::isVoidType(), clang::Sema::LangOpts, clang::DeclaratorChunk::Loc, clang::Sema::LookupName(), clang::Sema::LookupOrdinaryName, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::DeclaratorChunk::ParamInfo::Param, clang::DeclaratorChunk::FunctionTypeInfo::Params, clang::DeclSpec::SCS_unspecified, and clang::Sema::SourceMgr.
Referenced by GetFullTypeForDeclarator().