;
42classTypeLocRanger :
public TypeLocVisitor<TypeLocRanger, SourceRange> {
44#define ABSTRACT_TYPELOC(CLASS, PARENT) 45#define TYPELOC(CLASS, PARENT) \ 46 SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ 47 return TyLoc.getLocalSourceRange(); \ 49#include "clang/AST/TypeLocNodes.def" 56 returnTypeLocRanger().Visit(TL);
63#define ABSTRACT_TYPELOC(CLASS, PARENT) 64#define TYPELOC(CLASS, PARENT) \ 65 unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ 66 return TyLoc.getLocalDataAlignment(); \ 68#include "clang/AST/TypeLocNodes.def" 75 if(
Ty.isNull())
return1;
76 returnTypeAligner().Visit(
TypeLoc(
Ty,
nullptr));
83#define ABSTRACT_TYPELOC(CLASS, PARENT) 84#define TYPELOC(CLASS, PARENT) \ 85 unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ 86 return TyLoc.getLocalDataSize(); \ 88#include "clang/AST/TypeLocNodes.def" 97 unsignedMaxAlign = 1;
98 while(!TyLoc.
isNull()) {
100MaxAlign = std::max(Align, MaxAlign);
101Total = llvm::alignTo(Total, Align);
102Total += TypeSizer().Visit(TyLoc);
105Total = llvm::alignTo(Total, MaxAlign);
113#define ABSTRACT_TYPELOC(CLASS, PARENT) 114#define TYPELOC(CLASS, PARENT) \ 115 TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ 116 return TyLoc.getNextTypeLoc(); \ 118#include "clang/AST/TypeLocNodes.def" 126 returnNextLoc().Visit(TL);
136#define ABSTRACT_TYPELOC(CLASS, PARENT) 137#define TYPELOC(CLASS, PARENT) \ 139 CLASS##TypeLoc TLCasted = TL.castAs<CLASS##TypeLoc>(); \ 140 TLCasted.initializeLocal(Context, Loc); \ 141 TL = TLCasted.getNextTypeLoc(); \ 145#include "clang/AST/TypeLocNodes.def" 156TypeLocCopier(
TypeLocsource) : Source(source) {}
158#define ABSTRACT_TYPELOC(CLASS, PARENT) 159#define TYPELOC(CLASS, PARENT) \ 160 void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ 161 dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ 163#include "clang/AST/TypeLocNodes.def" 187TypeLocCopier(other).Visit(TL);
213 caseFunctionNoProto:
215 caseDependentSizedArray:
216 caseIncompleteArray:
243 return Last.getLocalSourceRange().getEnd();
246 caseDependentSizedArray:
247 caseIncompleteArray:
249 caseFunctionNoProto:
260 caseObjCObjectPointer:
268 caseLValueReference:
269 caseRValueReference:
289 static boolisTypeSpec(
TypeLoc_) {
return false; }
291#define ABSTRACT_TYPELOC(CLASS, PARENT) 292#define TYPELOC(CLASS, PARENT) \ 293 bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ 294 return isTypeSpec(TyLoc); \ 296#include "clang/AST/TypeLocNodes.def" 309boolTypeSpecTypeLoc::isKind(
const TypeLoc&TL) {
311 returnTSTChecker().
Visit(TL);
316 return D->isCompleteDefinition() &&
336 caseBuiltinType::Void:
338 caseBuiltinType::Bool:
340 caseBuiltinType::Char_U:
341 caseBuiltinType::Char_S:
343 caseBuiltinType::Char8:
345 caseBuiltinType::Char16:
347 caseBuiltinType::Char32:
349 caseBuiltinType::WChar_S:
350 caseBuiltinType::WChar_U:
352 caseBuiltinType::UChar:
353 caseBuiltinType::UShort:
354 caseBuiltinType::UInt:
355 caseBuiltinType::ULong:
356 caseBuiltinType::ULongLong:
357 caseBuiltinType::UInt128:
358 caseBuiltinType::SChar:
359 caseBuiltinType::Short:
360 caseBuiltinType::Int:
361 caseBuiltinType::Long:
362 caseBuiltinType::LongLong:
363 caseBuiltinType::Int128:
364 caseBuiltinType::Half:
365 caseBuiltinType::Float:
366 caseBuiltinType::Double:
367 caseBuiltinType::LongDouble:
368 caseBuiltinType::Float16:
369 caseBuiltinType::Float128:
370 caseBuiltinType::Ibm128:
371 caseBuiltinType::ShortAccum:
372 caseBuiltinType::Accum:
373 caseBuiltinType::LongAccum:
374 caseBuiltinType::UShortAccum:
375 caseBuiltinType::UAccum:
376 caseBuiltinType::ULongAccum:
377 caseBuiltinType::ShortFract:
378 caseBuiltinType::Fract:
379 caseBuiltinType::LongFract:
380 caseBuiltinType::UShortFract:
381 caseBuiltinType::UFract:
382 caseBuiltinType::ULongFract:
383 caseBuiltinType::SatShortAccum:
384 caseBuiltinType::SatAccum:
385 caseBuiltinType::SatLongAccum:
386 caseBuiltinType::SatUShortAccum:
387 caseBuiltinType::SatUAccum:
388 caseBuiltinType::SatULongAccum:
389 caseBuiltinType::SatShortFract:
390 caseBuiltinType::SatFract:
391 caseBuiltinType::SatLongFract:
392 caseBuiltinType::SatUShortFract:
393 caseBuiltinType::SatUFract:
394 caseBuiltinType::SatULongFract:
395 caseBuiltinType::BFloat16:
396llvm_unreachable(
"Builtin type needs extra local data!");
399 caseBuiltinType::NullPtr:
400 caseBuiltinType::Overload:
401 caseBuiltinType::Dependent:
402 caseBuiltinType::UnresolvedTemplate:
403 caseBuiltinType::BoundMember:
404 caseBuiltinType::UnknownAny:
405 caseBuiltinType::ARCUnbridgedCast:
406 caseBuiltinType::PseudoObject:
407 caseBuiltinType::ObjCId:
408 caseBuiltinType::ObjCClass:
409 caseBuiltinType::ObjCSel:
410#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ 411 case BuiltinType::Id: 412#include "clang/Basic/OpenCLImageTypes.def" 413#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \ 414 case BuiltinType::Id: 415#include "clang/Basic/OpenCLExtensionTypes.def" 416 caseBuiltinType::OCLSampler:
417 caseBuiltinType::OCLEvent:
418 caseBuiltinType::OCLClkEvent:
419 caseBuiltinType::OCLQueue:
420 caseBuiltinType::OCLReserveID:
421#define SVE_TYPE(Name, Id, SingletonId) \ 422 case BuiltinType::Id: 423#include "clang/Basic/AArch64SVEACLETypes.def" 424#define PPC_VECTOR_TYPE(Name, Id, Size) \ 425 case BuiltinType::Id: 426#include "clang/Basic/PPCTypes.def" 427#define RVV_TYPE(Name, Id, SingletonId) case BuiltinType::Id: 428#include "clang/Basic/RISCVVTypes.def" 429#define WASM_TYPE(Name, Id, SingletonId) case BuiltinType::Id: 430#include "clang/Basic/WebAssemblyReferenceTypes.def" 431#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) case BuiltinType::Id: 432#include "clang/Basic/AMDGPUTypes.def" 433#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) case BuiltinType::Id: 434#include "clang/Basic/HLSLIntangibleTypes.def" 435 caseBuiltinType::BuiltinFn:
436 caseBuiltinType::IncompleteMatrixIdx:
437 caseBuiltinType::ArraySection:
438 caseBuiltinType::OMPArrayShaping:
439 caseBuiltinType::OMPIterator:
443llvm_unreachable(
"Invalid BuiltinType Kind!");
448TL = PTL.getInnerLoc();
453 if(
autoATL = getAs<AttributedTypeLoc>()) {
454 const Attr*A = ATL.getAttr();
455 if(A && (isa<TypeNullableAttr>(A) || isa<TypeNonNullAttr>(A) ||
456isa<TypeNullUnspecifiedAttr>(A)))
465 if(
autoqual = getAs<QualifiedTypeLoc>())
472 if(
attr.isQualifier())
return attr;
473 return attr.getModifiedLoc().findExplicitQualifierLoc();
555Builder.MakeTrivial(Context,
getTypePtr()->getQualifier(),
Loc);
563Builder.MakeTrivial(Context,
getTypePtr()->getQualifier(),
Loc);
574Builder.MakeTrivial(Context,
getTypePtr()->getQualifier(),
Loc);
584Context,
getTypePtr()->template_arguments(), getArgInfos(),
Loc);
590 for(
unsignedi = 0, e = Args.size(); i != e; ++i) {
593llvm_unreachable(
"Impossible TemplateArgument");
615 TemplateNameTemplate = Args[i].getAsTemplateOrTemplatePattern();
617Builder.MakeTrivial(Context, DTN->getQualifier(),
Loc);
619Builder.MakeTrivial(Context, QTN->getQualifier(),
Loc);
622Context, Builder.getWithLocInContext(Context),
Loc,
648 for(
unsignedi = 0; i < size; ++i) {
674 classGetContainedAutoTypeLocVisitor :
686 returnVisit(
T.getNamedTypeLoc());
690 returnVisit(
T.getUnqualifiedLoc());
694 returnVisit(
T.getPointeeLoc());
698 returnVisit(
T.getPointeeLoc());
702 returnVisit(
T.getPointeeLoc());
706 returnVisit(
T.getPointeeLoc());
710 returnVisit(
T.getElementLoc());
714 returnVisit(
T.getReturnLoc());
718 returnVisit(
T.getInnerLoc());
722 returnVisit(
T.getModifiedLoc());
726 returnVisit(
T.getWrappedLoc());
731 returnVisit(
T.getWrappedLoc());
735 returnVisit(
T.getInnerLoc());
739 returnVisit(
T.getOriginalLoc());
743 returnVisit(
T.getPatternLoc());
750 TypeLocRes = GetContainedAutoTypeLocVisitor().Visit(*
this);
757 if(
const autoTSTL = getAsAdjusted<TemplateSpecializationTypeLoc>())
758 returnTSTL.getTemplateKeywordLoc();
759 if(
const autoDTSTL =
760getAsAdjusted<DependentTemplateSpecializationTypeLoc>())
761 returnDTSTL.getTemplateKeywordLoc();
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
static Decl::Kind getKind(const Decl *D)
Defines the C++ template declaration subclasses.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
static ConceptReference * createTrivialConceptReference(ASTContext &Context, SourceLocation Loc, const AutoType *AT)
static const unsigned TypeLocMaxDataAlign
Defines the clang::TypeLoc interface and its subclasses.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location,...
Wrapper for source info for arrays.
Attr - This represents one attribute.
SourceLocation getLocation() const
SourceRange getRange() const
Type source information for an attributed type.
const Attr * getAttr() const
The type attribute.
SourceRange getLocalSourceRange() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setConceptReference(ConceptReference *CR)
bool isConstrained() const
void setRParenLoc(SourceLocation Loc)
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
ArrayRef< TemplateArgument > getTypeConstraintArguments() const
ConceptDecl * getTypeConstraintConcept() const
Type source information for an btf_tag attributed type.
const BTFTypeTagAttr * getAttr() const
The btf_type_tag attribute.
SourceRange getLocalSourceRange() const
Wrapper for source info for block pointers.
TypeSpecifierType getWrittenTypeSpec() const
bool needsExtraLocalData() const
WrittenBuiltinSpecs & getWrittenBuiltinSpecs()
A reference to a concept and its template args, as it appears in the code.
static ConceptReference * Create(const ASTContext &C, NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten)
const BuiltinType * getTypePtr() const
LocalData * getLocalData() const
Expr * getCountExpr() const
SourceRange getLocalSourceRange() const
SourceLocation getLocation() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setNameLoc(SourceLocation Loc)
void setElaboratedKeywordLoc(SourceLocation Loc)
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
Represents a dependent template name that cannot be resolved prior to template instantiation.
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setTemplateKeywordLoc(SourceLocation Loc)
void setElaboratedKeywordLoc(SourceLocation Loc)
void setRAngleLoc(SourceLocation Loc)
void setLAngleLoc(SourceLocation Loc)
void setTemplateNameLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setElaboratedKeywordLoc(SourceLocation Loc)
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
bool hasTrailingReturn() const
Whether this function prototype has a trailing return type.
Wrapper for source info for functions.
Type source information for HLSL attributed resource type.
const TypeClass * getTypePtr() const
Wrapper for source info for member pointers.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Class that aids in the construction of nested-name-specifiers along with source-location information ...
A C++ nested-name-specifier augmented with source location information.
Wraps an ObjCPointerType with source location information.
SourceLocation getStarLoc() const
void setTypeArgsRAngleLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
unsigned getNumTypeArgs() const
unsigned getNumProtocols() const
void setTypeArgsLAngleLoc(SourceLocation Loc)
void setTypeArgTInfo(unsigned i, TypeSourceInfo *TInfo)
void setProtocolLAngleLoc(SourceLocation Loc)
void setProtocolRAngleLoc(SourceLocation Loc)
void setHasBaseTypeAsWritten(bool HasBaseType)
void setProtocolLoc(unsigned i, SourceLocation Loc)
unsigned getNumProtocols() const
void setProtocolLoc(unsigned i, SourceLocation Loc)
void setProtocolLAngleLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setProtocolRAngleLoc(SourceLocation Loc)
void setNameLoc(SourceLocation Loc)
Wrapper for source info for pointers.
A (possibly-)qualified type.
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
Represents a template name as written in source code.
Wrapper of type source information for a type with non-trivial direct qualifiers.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
SourceLocation getBegin() const
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Represents the declaration of a struct/union/class/enum.
TagDecl * getDecl() const
bool isDefinition() const
True if the tag was defined in this type specifier.
A convenient class for passing around template argument information.
void addArgument(const TemplateArgumentLoc &Loc)
Location wrapper for a TemplateArgument.
@ Declaration
The template argument is a declaration that was provided for a pointer, reference,...
@ Template
The template argument is a template name that was provided for a template template parameter.
@ StructuralValue
The template argument is a non-type template argument that can't be represented by the special-case D...
@ Pack
The template argument is actually a parameter pack.
@ TemplateExpansion
The template argument is a pack expansion of a template name that was provided for a template templat...
@ NullPtr
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
@ Type
The template argument is a type.
@ Null
Represents an empty template argument, e.g., one that has not been deduced.
@ Integral
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
@ Expression
The template argument is an expression, and we've not resolved it to one of the other forms yet,...
Represents a C++ template name within the type system.
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
static void initializeArgLocs(ASTContext &Context, ArrayRef< TemplateArgument > Args, TemplateArgumentLocInfo *ArgInfos, SourceLocation Loc)
RetTy Visit(TypeLoc TyLoc)
Base wrapper for a particular "section" of type source info.
SourceLocation findNullabilityLoc() const
Find the location of the nullability specifier (__nonnull, __nullable, or __null_unspecifier),...
static unsigned getLocalAlignmentForType(QualType Ty)
Returns the alignment of type source info data block for the given type.
TypeLoc findExplicitQualifierLoc() const
Find a type with the location of an explicit type qualifier.
QualType getType() const
Get the type for which this source info wrapper provides information.
TypeLoc getNextTypeLoc() const
Get the next TypeLoc pointed by this TypeLoc, e.g for "int*" the TypeLoc is a PointerLoc and next Typ...
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
TypeLoc IgnoreParens() const
T castAs() const
Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type.
SourceRange getLocalSourceRange() const
Get the local source range.
unsigned getFullDataSize() const
Returns the size of the type source info data block.
AutoTypeLoc getContainedAutoTypeLoc() const
Get the typeloc of an AutoType whose type will be deduced for a variable with an initializer of this ...
SourceLocation getTemplateKeywordLoc() const
Get the SourceLocation of the template keyword (if any).
void copy(TypeLoc other)
Copies the other type loc into this one.
TypeLocClass getTypeLocClass() const
static unsigned getFullDataSizeForType(QualType Ty)
Returns the size of type source info data block for the given type.
SourceLocation getEndLoc() const
Get the end source location.
SourceLocation getBeginLoc() const
Get the begin source location.
SourceRange getLocalSourceRange() const
Expr * getUnderlyingExpr() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
QualType getUnmodifiedType() const
A reasonable base class for TypeLocs that correspond to types that are written as a type-specifier.
SourceLocation getNameLoc() const
void setNameLoc(SourceLocation Loc)
SourceLocation getRParenLoc() const
SourceLocation getTypeofLoc() const
void setRParenLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setKWLoc(SourceLocation Loc)
void setUnderlyingTInfo(TypeSourceInfo *TInfo)
void setLParenLoc(SourceLocation Loc)
const internal::VariadicAllOfMatcher< Attr > attr
Matches attributes.
The JSON file list parser is used to communicate input to InstallAPI.
TypeSpecifierType
Specifies the kind of type.
const FunctionProtoType * T
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
static const ASTTemplateArgumentListInfo * Create(const ASTContext &C, const TemplateArgumentListInfo &List)
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
Location information for a TemplateArgument.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4