/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/AST/TypeLoc.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | //===- TypeLoc.cpp - Type Source Info Wrapper -----------------------------===// |
2 | | // |
3 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | | // See https://llvm.org/LICENSE.txt for license information. |
5 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | // |
9 | | // This file defines the TypeLoc subclasses implementations. |
10 | | // |
11 | | //===----------------------------------------------------------------------===// |
12 | | |
13 | | #include "clang/AST/TypeLoc.h" |
14 | | #include "clang/AST/DeclTemplate.h" |
15 | | #include "clang/AST/ASTContext.h" |
16 | | #include "clang/AST/Attr.h" |
17 | | #include "clang/AST/Expr.h" |
18 | | #include "clang/AST/NestedNameSpecifier.h" |
19 | | #include "clang/AST/TemplateBase.h" |
20 | | #include "clang/AST/TemplateName.h" |
21 | | #include "clang/AST/TypeLocVisitor.h" |
22 | | #include "clang/Basic/SourceLocation.h" |
23 | | #include "clang/Basic/Specifiers.h" |
24 | | #include "llvm/Support/ErrorHandling.h" |
25 | | #include "llvm/Support/MathExtras.h" |
26 | | #include <algorithm> |
27 | | #include <cassert> |
28 | | #include <cstdint> |
29 | | #include <cstring> |
30 | | |
31 | | using namespace clang; |
32 | | |
33 | | static const unsigned TypeLocMaxDataAlign = alignof(void *); |
34 | | |
35 | | //===----------------------------------------------------------------------===// |
36 | | // TypeLoc Implementation |
37 | | //===----------------------------------------------------------------------===// |
38 | | |
39 | | namespace { |
40 | | |
41 | | class TypeLocRanger : public TypeLocVisitor<TypeLocRanger, SourceRange> { |
42 | | public: |
43 | | #define ABSTRACT_TYPELOC(CLASS, PARENT) |
44 | | #define TYPELOC(CLASS, PARENT) \ |
45 | 229M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ |
46 | 229M | return TyLoc.getLocalSourceRange(); \ |
47 | 229M | } TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc) Line | Count | Source | 45 | 8.80k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 8.80k | return TyLoc.getLocalSourceRange(); \ | 47 | 8.80k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc) Line | Count | Source | 45 | 3 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 3 | return TyLoc.getLocalSourceRange(); \ | 47 | 3 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDecayedTypeLoc(clang::DecayedTypeLoc) Line | Count | Source | 45 | 1.07k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 1.07k | return TyLoc.getLocalSourceRange(); \ | 47 | 1.07k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc) Line | Count | Source | 45 | 4.13k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 4.13k | return TyLoc.getLocalSourceRange(); \ | 47 | 4.13k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc) Line | Count | Source | 45 | 7.76k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 7.76k | return TyLoc.getLocalSourceRange(); \ | 47 | 7.76k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc) Line | Count | Source | 45 | 16.1k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 16.1k | return TyLoc.getLocalSourceRange(); \ | 47 | 16.1k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc) Line | Count | Source | 45 | 59 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 59 | return TyLoc.getLocalSourceRange(); \ | 47 | 59 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAtomicTypeLoc(clang::AtomicTypeLoc) Line | Count | Source | 45 | 876 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 876 | return TyLoc.getLocalSourceRange(); \ | 47 | 876 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAttributedTypeLoc(clang::AttributedTypeLoc) Line | Count | Source | 45 | 781k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 781k | return TyLoc.getLocalSourceRange(); \ | 47 | 781k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBTFTagAttributedTypeLoc(clang::BTFTagAttributedTypeLoc) Line | Count | Source | 45 | 16 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 16 | return TyLoc.getLocalSourceRange(); \ | 47 | 16 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBitIntTypeLoc(clang::BitIntTypeLoc) Line | Count | Source | 45 | 970 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 970 | return TyLoc.getLocalSourceRange(); \ | 47 | 970 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc) Line | Count | Source | 45 | 32.4k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 32.4k | return TyLoc.getLocalSourceRange(); \ | 47 | 32.4k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc) Line | Count | Source | 45 | 11.2M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 11.2M | return TyLoc.getLocalSourceRange(); \ | 47 | 11.2M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitComplexTypeLoc(clang::ComplexTypeLoc) Line | Count | Source | 45 | 2.91k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 2.91k | return TyLoc.getLocalSourceRange(); \ | 47 | 2.91k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc) Line | Count | Source | 45 | 561k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 561k | return TyLoc.getLocalSourceRange(); \ | 47 | 561k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAutoTypeLoc(clang::AutoTypeLoc) Line | Count | Source | 45 | 83.3k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 83.3k | return TyLoc.getLocalSourceRange(); \ | 47 | 83.3k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc) Line | Count | Source | 45 | 11.0k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 11.0k | return TyLoc.getLocalSourceRange(); \ | 47 | 11.0k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc) Line | Count | Source | 45 | 46 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 46 | return TyLoc.getLocalSourceRange(); \ | 47 | 46 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentBitIntTypeLoc(clang::DependentBitIntTypeLoc) Line | Count | Source | 45 | 68 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 68 | return TyLoc.getLocalSourceRange(); \ | 47 | 68 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc) Line | Count | Source | 45 | 4.49M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 4.49M | return TyLoc.getLocalSourceRange(); \ | 47 | 4.49M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc) Line | Count | Source | 45 | 32 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 32 | return TyLoc.getLocalSourceRange(); \ | 47 | 32 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc) Line | Count | Source | 45 | 105k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 105k | return TyLoc.getLocalSourceRange(); \ | 47 | 105k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc) Line | Count | Source | 45 | 85 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 85 | return TyLoc.getLocalSourceRange(); \ | 47 | 85 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc) Line | Count | Source | 45 | 783k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 783k | return TyLoc.getLocalSourceRange(); \ | 47 | 783k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc) Line | Count | Source | 45 | 246 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 246 | return TyLoc.getLocalSourceRange(); \ | 47 | 246 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc) Line | Count | Source | 45 | 1.29M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 1.29M | return TyLoc.getLocalSourceRange(); \ | 47 | 1.29M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc) Line | Count | Source | 45 | 1.85M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 1.85M | return TyLoc.getLocalSourceRange(); \ | 47 | 1.85M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc) Line | Count | Source | 45 | 440 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 440 | return TyLoc.getLocalSourceRange(); \ | 47 | 440 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc) Line | Count | Source | 45 | 294 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 294 | return TyLoc.getLocalSourceRange(); \ | 47 | 294 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc) Line | Count | Source | 45 | 496 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 496 | return TyLoc.getLocalSourceRange(); \ | 47 | 496 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc) Line | Count | Source | 45 | 62.0k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 62.0k | return TyLoc.getLocalSourceRange(); \ | 47 | 62.0k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc) Line | Count | Source | 45 | 543k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 543k | return TyLoc.getLocalSourceRange(); \ | 47 | 543k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc) Line | Count | Source | 45 | 62.7k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 62.7k | return TyLoc.getLocalSourceRange(); \ | 47 | 62.7k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc) Line | Count | Source | 45 | 1.58M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 1.58M | return TyLoc.getLocalSourceRange(); \ | 47 | 1.58M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc) Line | Count | Source | 45 | 46.8k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 46.8k | return TyLoc.getLocalSourceRange(); \ | 47 | 46.8k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc) Line | Count | Source | 45 | 438k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 438k | return TyLoc.getLocalSourceRange(); \ | 47 | 438k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitParenTypeLoc(clang::ParenTypeLoc) Line | Count | Source | 45 | 98.2k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 98.2k | return TyLoc.getLocalSourceRange(); \ | 47 | 98.2k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPipeTypeLoc(clang::PipeTypeLoc) Line | Count | Source | 45 | 6 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 6 | return TyLoc.getLocalSourceRange(); \ | 47 | 6 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPointerTypeLoc(clang::PointerTypeLoc) Line | Count | Source | 45 | 1.66M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 1.66M | return TyLoc.getLocalSourceRange(); \ | 47 | 1.66M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc) Line | Count | Source | 45 | 1.94M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 1.94M | return TyLoc.getLocalSourceRange(); \ | 47 | 1.94M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc) Line | Count | Source | 45 | 573k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 573k | return TyLoc.getLocalSourceRange(); \ | 47 | 573k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc) Line | Count | Source | 45 | 20.0k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 20.0k | return TyLoc.getLocalSourceRange(); \ | 47 | 20.0k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc) Line | Count | Source | 45 | 16.0M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 16.0M | return TyLoc.getLocalSourceRange(); \ | 47 | 16.0M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitEnumTypeLoc(clang::EnumTypeLoc) Line | Count | Source | 45 | 457k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 457k | return TyLoc.getLocalSourceRange(); \ | 47 | 457k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRecordTypeLoc(clang::RecordTypeLoc) Line | Count | Source | 45 | 12.3M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 12.3M | return TyLoc.getLocalSourceRange(); \ | 47 | 12.3M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc) Line | Count | Source | 45 | 105M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 105M | return TyLoc.getLocalSourceRange(); \ | 47 | 105M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc) Line | Count | Source | 45 | 32.4M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 32.4M | return TyLoc.getLocalSourceRange(); \ | 47 | 32.4M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc) Line | Count | Source | 45 | 6.19k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 6.19k | return TyLoc.getLocalSourceRange(); \ | 47 | 6.19k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc) Line | Count | Source | 45 | 67 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 67 | return TyLoc.getLocalSourceRange(); \ | 47 | 67 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTypedefTypeLoc(clang::TypedefTypeLoc) Line | Count | Source | 45 | 33.7M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 33.7M | return TyLoc.getLocalSourceRange(); \ | 47 | 33.7M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc) Line | Count | Source | 45 | 2.51k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 2.51k | return TyLoc.getLocalSourceRange(); \ | 47 | 2.51k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc) Line | Count | Source | 45 | 2.78k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 2.78k | return TyLoc.getLocalSourceRange(); \ | 47 | 2.78k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUsingTypeLoc(clang::UsingTypeLoc) Line | Count | Source | 45 | 814k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 814k | return TyLoc.getLocalSourceRange(); \ | 47 | 814k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitVectorTypeLoc(clang::VectorTypeLoc) Line | Count | Source | 45 | 60.5k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 60.5k | return TyLoc.getLocalSourceRange(); \ | 47 | 60.5k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc) Line | Count | Source | 45 | 72 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 72 | return TyLoc.getLocalSourceRange(); \ | 47 | 72 | } |
|
48 | | #include "clang/AST/TypeLocNodes.def" |
49 | | }; |
50 | | |
51 | | } // namespace |
52 | | |
53 | 229M | SourceRange TypeLoc::getLocalSourceRangeImpl(TypeLoc TL) { |
54 | 229M | if (TL.isNull()) return SourceRange()0 ; |
55 | 229M | return TypeLocRanger().Visit(TL); |
56 | 229M | } |
57 | | |
58 | | namespace { |
59 | | |
60 | | class TypeAligner : public TypeLocVisitor<TypeAligner, unsigned> { |
61 | | public: |
62 | | #define ABSTRACT_TYPELOC(CLASS, PARENT) |
63 | | #define TYPELOC(CLASS, PARENT) \ |
64 | 394M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ |
65 | 394M | return TyLoc.getLocalDataAlignment(); \ |
66 | 394M | } TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc) Line | Count | Source | 64 | 22.4M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 22.4M | return TyLoc.getLocalDataAlignment(); \ | 66 | 22.4M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc) Line | Count | Source | 64 | 30 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 30 | return TyLoc.getLocalDataAlignment(); \ | 66 | 30 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDecayedTypeLoc(clang::DecayedTypeLoc) Line | Count | Source | 64 | 6.13k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 6.13k | return TyLoc.getLocalDataAlignment(); \ | 66 | 6.13k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc) Line | Count | Source | 64 | 532k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 532k | return TyLoc.getLocalDataAlignment(); \ | 66 | 532k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc) Line | Count | Source | 64 | 52.3k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 52.3k | return TyLoc.getLocalDataAlignment(); \ | 66 | 52.3k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc) Line | Count | Source | 64 | 139k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 139k | return TyLoc.getLocalDataAlignment(); \ | 66 | 139k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc) Line | Count | Source | 64 | 46.9k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 46.9k | return TyLoc.getLocalDataAlignment(); \ | 66 | 46.9k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAtomicTypeLoc(clang::AtomicTypeLoc) Line | Count | Source | 64 | 10.4k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 10.4k | return TyLoc.getLocalDataAlignment(); \ | 66 | 10.4k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAttributedTypeLoc(clang::AttributedTypeLoc) Line | Count | Source | 64 | 4.49M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 4.49M | return TyLoc.getLocalDataAlignment(); \ | 66 | 4.49M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBTFTagAttributedTypeLoc(clang::BTFTagAttributedTypeLoc) Line | Count | Source | 64 | 183 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 183 | return TyLoc.getLocalDataAlignment(); \ | 66 | 183 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBitIntTypeLoc(clang::BitIntTypeLoc) Line | Count | Source | 64 | 1.74k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 1.74k | return TyLoc.getLocalDataAlignment(); \ | 66 | 1.74k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc) Line | Count | Source | 64 | 190k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 190k | return TyLoc.getLocalDataAlignment(); \ | 66 | 190k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc) Line | Count | Source | 64 | 36.9M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 36.9M | return TyLoc.getLocalDataAlignment(); \ | 66 | 36.9M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitComplexTypeLoc(clang::ComplexTypeLoc) Line | Count | Source | 64 | 26.5k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 26.5k | return TyLoc.getLocalDataAlignment(); \ | 66 | 26.5k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc) Line | Count | Source | 64 | 736k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 736k | return TyLoc.getLocalDataAlignment(); \ | 66 | 736k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAutoTypeLoc(clang::AutoTypeLoc) Line | Count | Source | 64 | 578k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 578k | return TyLoc.getLocalDataAlignment(); \ | 66 | 578k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc) Line | Count | Source | 64 | 4.60k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 4.60k | return TyLoc.getLocalDataAlignment(); \ | 66 | 4.60k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc) Line | Count | Source | 64 | 250 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 250 | return TyLoc.getLocalDataAlignment(); \ | 66 | 250 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentBitIntTypeLoc(clang::DependentBitIntTypeLoc) Line | Count | Source | 64 | 42 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 42 | return TyLoc.getLocalDataAlignment(); \ | 66 | 42 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc) Line | Count | Source | 64 | 7.30M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 7.30M | return TyLoc.getLocalDataAlignment(); \ | 66 | 7.30M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc) Line | Count | Source | 64 | 59 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 59 | return TyLoc.getLocalDataAlignment(); \ | 66 | 59 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc) Line | Count | Source | 64 | 180k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 180k | return TyLoc.getLocalDataAlignment(); \ | 66 | 180k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc) Line | Count | Source | 64 | 130 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 130 | return TyLoc.getLocalDataAlignment(); \ | 66 | 130 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc) Line | Count | Source | 64 | 5.98M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 5.98M | return TyLoc.getLocalDataAlignment(); \ | 66 | 5.98M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc) Line | Count | Source | 64 | 10.0k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 10.0k | return TyLoc.getLocalDataAlignment(); \ | 66 | 10.0k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc) Line | Count | Source | 64 | 32.2M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 32.2M | return TyLoc.getLocalDataAlignment(); \ | 66 | 32.2M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc) Line | Count | Source | 64 | 3.54M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 3.54M | return TyLoc.getLocalDataAlignment(); \ | 66 | 3.54M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc) Line | Count | Source | 64 | 246k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 246k | return TyLoc.getLocalDataAlignment(); \ | 66 | 246k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc) Line | Count | Source | 64 | 1.02k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 1.02k | return TyLoc.getLocalDataAlignment(); \ | 66 | 1.02k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc) Line | Count | Source | 64 | 554 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 554 | return TyLoc.getLocalDataAlignment(); \ | 66 | 554 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc) Line | Count | Source | 64 | 48.6k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 48.6k | return TyLoc.getLocalDataAlignment(); \ | 66 | 48.6k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc) Line | Count | Source | 64 | 4.00M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 4.00M | return TyLoc.getLocalDataAlignment(); \ | 66 | 4.00M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc) Line | Count | Source | 64 | 1.36M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 1.36M | return TyLoc.getLocalDataAlignment(); \ | 66 | 1.36M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc) Line | Count | Source | 64 | 5.46M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 5.46M | return TyLoc.getLocalDataAlignment(); \ | 66 | 5.46M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc) Line | Count | Source | 64 | 226k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 226k | return TyLoc.getLocalDataAlignment(); \ | 66 | 226k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc) Line | Count | Source | 64 | 897k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 897k | return TyLoc.getLocalDataAlignment(); \ | 66 | 897k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitParenTypeLoc(clang::ParenTypeLoc) Line | Count | Source | 64 | 1.20M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 1.20M | return TyLoc.getLocalDataAlignment(); \ | 66 | 1.20M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPipeTypeLoc(clang::PipeTypeLoc) Line | Count | Source | 64 | 273 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 273 | return TyLoc.getLocalDataAlignment(); \ | 66 | 273 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPointerTypeLoc(clang::PointerTypeLoc) Line | Count | Source | 64 | 11.4M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 11.4M | return TyLoc.getLocalDataAlignment(); \ | 66 | 11.4M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc) Line | Count | Source | 64 | 7.51M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 7.51M | return TyLoc.getLocalDataAlignment(); \ | 66 | 7.51M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc) Line | Count | Source | 64 | 1.83M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 1.83M | return TyLoc.getLocalDataAlignment(); \ | 66 | 1.83M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc) Line | Count | Source | 64 | 91.4k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 91.4k | return TyLoc.getLocalDataAlignment(); \ | 66 | 91.4k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc) Line | Count | Source | 64 | 13.9M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 13.9M | return TyLoc.getLocalDataAlignment(); \ | 66 | 13.9M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitEnumTypeLoc(clang::EnumTypeLoc) Line | Count | Source | 64 | 1.56M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 1.56M | return TyLoc.getLocalDataAlignment(); \ | 66 | 1.56M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRecordTypeLoc(clang::RecordTypeLoc) Line | Count | Source | 64 | 10.2M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 10.2M | return TyLoc.getLocalDataAlignment(); \ | 66 | 10.2M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc) Line | Count | Source | 64 | 26.0M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 26.0M | return TyLoc.getLocalDataAlignment(); \ | 66 | 26.0M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc) Line | Count | Source | 64 | 27.4M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 27.4M | return TyLoc.getLocalDataAlignment(); \ | 66 | 27.4M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc) Line | Count | Source | 64 | 13.2k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 13.2k | return TyLoc.getLocalDataAlignment(); \ | 66 | 13.2k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc) Line | Count | Source | 64 | 126 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 126 | return TyLoc.getLocalDataAlignment(); \ | 66 | 126 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypedefTypeLoc(clang::TypedefTypeLoc) Line | Count | Source | 64 | 163M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 163M | return TyLoc.getLocalDataAlignment(); \ | 66 | 163M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc) Line | Count | Source | 64 | 4.11k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 4.11k | return TyLoc.getLocalDataAlignment(); \ | 66 | 4.11k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc) Line | Count | Source | 64 | 2.86k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 2.86k | return TyLoc.getLocalDataAlignment(); \ | 66 | 2.86k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUsingTypeLoc(clang::UsingTypeLoc) Line | Count | Source | 64 | 1.11M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 1.11M | return TyLoc.getLocalDataAlignment(); \ | 66 | 1.11M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVectorTypeLoc(clang::VectorTypeLoc) Line | Count | Source | 64 | 191k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 191k | return TyLoc.getLocalDataAlignment(); \ | 66 | 191k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc) Line | Count | Source | 64 | 4.60k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 4.60k | return TyLoc.getLocalDataAlignment(); \ | 66 | 4.60k | } |
|
67 | | #include "clang/AST/TypeLocNodes.def" |
68 | | }; |
69 | | |
70 | | } // namespace |
71 | | |
72 | | /// Returns the alignment of the type source info data block. |
73 | 394M | unsigned TypeLoc::getLocalAlignmentForType(QualType Ty) { |
74 | 394M | if (Ty.isNull()) return 10 ; |
75 | 394M | return TypeAligner().Visit(TypeLoc(Ty, nullptr)); |
76 | 394M | } |
77 | | |
78 | | namespace { |
79 | | |
80 | | class TypeSizer : public TypeLocVisitor<TypeSizer, unsigned> { |
81 | | public: |
82 | | #define ABSTRACT_TYPELOC(CLASS, PARENT) |
83 | | #define TYPELOC(CLASS, PARENT) \ |
84 | 249M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ |
85 | 249M | return TyLoc.getLocalDataSize(); \ |
86 | 249M | } TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc) Line | Count | Source | 84 | 7.78M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 7.78M | return TyLoc.getLocalDataSize(); \ | 86 | 7.78M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc) Line | Count | Source | 84 | 12 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 12 | return TyLoc.getLocalDataSize(); \ | 86 | 12 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDecayedTypeLoc(clang::DecayedTypeLoc) Line | Count | Source | 84 | 5.68k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 5.68k | return TyLoc.getLocalDataSize(); \ | 86 | 5.68k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc) Line | Count | Source | 84 | 401k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 401k | return TyLoc.getLocalDataSize(); \ | 86 | 401k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc) Line | Count | Source | 84 | 35.7k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 35.7k | return TyLoc.getLocalDataSize(); \ | 86 | 35.7k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc) Line | Count | Source | 84 | 76.1k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 76.1k | return TyLoc.getLocalDataSize(); \ | 86 | 76.1k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc) Line | Count | Source | 84 | 17.8k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 17.8k | return TyLoc.getLocalDataSize(); \ | 86 | 17.8k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAtomicTypeLoc(clang::AtomicTypeLoc) Line | Count | Source | 84 | 9.18k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 9.18k | return TyLoc.getLocalDataSize(); \ | 86 | 9.18k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAttributedTypeLoc(clang::AttributedTypeLoc) Line | Count | Source | 84 | 3.30M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 3.30M | return TyLoc.getLocalDataSize(); \ | 86 | 3.30M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBTFTagAttributedTypeLoc(clang::BTFTagAttributedTypeLoc) Line | Count | Source | 84 | 54 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 54 | return TyLoc.getLocalDataSize(); \ | 86 | 54 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBitIntTypeLoc(clang::BitIntTypeLoc) Line | Count | Source | 84 | 1.08k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 1.08k | return TyLoc.getLocalDataSize(); \ | 86 | 1.08k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc) Line | Count | Source | 84 | 61.7k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 61.7k | return TyLoc.getLocalDataSize(); \ | 86 | 61.7k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc) Line | Count | Source | 84 | 15.8M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 15.8M | return TyLoc.getLocalDataSize(); \ | 86 | 15.8M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitComplexTypeLoc(clang::ComplexTypeLoc) Line | Count | Source | 84 | 11.6k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 11.6k | return TyLoc.getLocalDataSize(); \ | 86 | 11.6k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc) Line | Count | Source | 84 | 579k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 579k | return TyLoc.getLocalDataSize(); \ | 86 | 579k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAutoTypeLoc(clang::AutoTypeLoc) Line | Count | Source | 84 | 407k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 407k | return TyLoc.getLocalDataSize(); \ | 86 | 407k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc) Line | Count | Source | 84 | 3.87k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 3.87k | return TyLoc.getLocalDataSize(); \ | 86 | 3.87k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc) Line | Count | Source | 84 | 82 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 82 | return TyLoc.getLocalDataSize(); \ | 86 | 82 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentBitIntTypeLoc(clang::DependentBitIntTypeLoc) Line | Count | Source | 84 | 42 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 42 | return TyLoc.getLocalDataSize(); \ | 86 | 42 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc) Line | Count | Source | 84 | 5.46M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 5.46M | return TyLoc.getLocalDataSize(); \ | 86 | 5.46M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc) Line | Count | Source | 84 | 59 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 59 | return TyLoc.getLocalDataSize(); \ | 86 | 59 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc) Line | Count | Source | 84 | 173k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 173k | return TyLoc.getLocalDataSize(); \ | 86 | 173k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc) Line | Count | Source | 84 | 130 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 130 | return TyLoc.getLocalDataSize(); \ | 86 | 130 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc) Line | Count | Source | 84 | 4.41M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 4.41M | return TyLoc.getLocalDataSize(); \ | 86 | 4.41M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc) Line | Count | Source | 84 | 9.34k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 9.34k | return TyLoc.getLocalDataSize(); \ | 86 | 9.34k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc) Line | Count | Source | 84 | 31.1M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 31.1M | return TyLoc.getLocalDataSize(); \ | 86 | 31.1M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc) Line | Count | Source | 84 | 1.36M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 1.36M | return TyLoc.getLocalDataSize(); \ | 86 | 1.36M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc) Line | Count | Source | 84 | 244k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 244k | return TyLoc.getLocalDataSize(); \ | 86 | 244k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc) Line | Count | Source | 84 | 1.02k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 1.02k | return TyLoc.getLocalDataSize(); \ | 86 | 1.02k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc) Line | Count | Source | 84 | 554 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 554 | return TyLoc.getLocalDataSize(); \ | 86 | 554 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc) Line | Count | Source | 84 | 43.8k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 43.8k | return TyLoc.getLocalDataSize(); \ | 86 | 43.8k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc) Line | Count | Source | 84 | 1.32M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 1.32M | return TyLoc.getLocalDataSize(); \ | 86 | 1.32M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc) Line | Count | Source | 84 | 809k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 809k | return TyLoc.getLocalDataSize(); \ | 86 | 809k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc) Line | Count | Source | 84 | 1.93M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 1.93M | return TyLoc.getLocalDataSize(); \ | 86 | 1.93M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc) Line | Count | Source | 84 | 134k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 134k | return TyLoc.getLocalDataSize(); \ | 86 | 134k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc) Line | Count | Source | 84 | 897k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 897k | return TyLoc.getLocalDataSize(); \ | 86 | 897k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitParenTypeLoc(clang::ParenTypeLoc) Line | Count | Source | 84 | 348k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 348k | return TyLoc.getLocalDataSize(); \ | 86 | 348k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPipeTypeLoc(clang::PipeTypeLoc) Line | Count | Source | 84 | 261 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 261 | return TyLoc.getLocalDataSize(); \ | 86 | 261 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPointerTypeLoc(clang::PointerTypeLoc) Line | Count | Source | 84 | 8.70M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 8.70M | return TyLoc.getLocalDataSize(); \ | 86 | 8.70M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc) Line | Count | Source | 84 | 5.10M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 5.10M | return TyLoc.getLocalDataSize(); \ | 86 | 5.10M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc) Line | Count | Source | 84 | 1.30M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 1.30M | return TyLoc.getLocalDataSize(); \ | 86 | 1.30M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc) Line | Count | Source | 84 | 87.4k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 87.4k | return TyLoc.getLocalDataSize(); \ | 86 | 87.4k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc) Line | Count | Source | 84 | 11.3M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 11.3M | return TyLoc.getLocalDataSize(); \ | 86 | 11.3M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitEnumTypeLoc(clang::EnumTypeLoc) Line | Count | Source | 84 | 554k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 554k | return TyLoc.getLocalDataSize(); \ | 86 | 554k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitRecordTypeLoc(clang::RecordTypeLoc) Line | Count | Source | 84 | 4.79M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 4.79M | return TyLoc.getLocalDataSize(); \ | 86 | 4.79M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc) Line | Count | Source | 84 | 21.3M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 21.3M | return TyLoc.getLocalDataSize(); \ | 86 | 21.3M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc) Line | Count | Source | 84 | 18.4M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 18.4M | return TyLoc.getLocalDataSize(); \ | 86 | 18.4M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc) Line | Count | Source | 84 | 3.99k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 3.99k | return TyLoc.getLocalDataSize(); \ | 86 | 3.99k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc) Line | Count | Source | 84 | 118 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 118 | return TyLoc.getLocalDataSize(); \ | 86 | 118 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypedefTypeLoc(clang::TypedefTypeLoc) Line | Count | Source | 84 | 100M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 100M | return TyLoc.getLocalDataSize(); \ | 86 | 100M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc) Line | Count | Source | 84 | 4.09k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 4.09k | return TyLoc.getLocalDataSize(); \ | 86 | 4.09k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc) Line | Count | Source | 84 | 2.57k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 2.57k | return TyLoc.getLocalDataSize(); \ | 86 | 2.57k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUsingTypeLoc(clang::UsingTypeLoc) Line | Count | Source | 84 | 704k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 704k | return TyLoc.getLocalDataSize(); \ | 86 | 704k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVectorTypeLoc(clang::VectorTypeLoc) Line | Count | Source | 84 | 141k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 141k | return TyLoc.getLocalDataSize(); \ | 86 | 141k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc) Line | Count | Source | 84 | 4.60k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 4.60k | return TyLoc.getLocalDataSize(); \ | 86 | 4.60k | } |
|
87 | | #include "clang/AST/TypeLocNodes.def" |
88 | | }; |
89 | | |
90 | | } // namespace |
91 | | |
92 | | /// Returns the size of the type source info data block. |
93 | 183M | unsigned TypeLoc::getFullDataSizeForType(QualType Ty) { |
94 | 183M | unsigned Total = 0; |
95 | 183M | TypeLoc TyLoc(Ty, nullptr); |
96 | 183M | unsigned MaxAlign = 1; |
97 | 433M | while (!TyLoc.isNull()) { |
98 | 249M | unsigned Align = getLocalAlignmentForType(TyLoc.getType()); |
99 | 249M | MaxAlign = std::max(Align, MaxAlign); |
100 | 249M | Total = llvm::alignTo(Total, Align); |
101 | 249M | Total += TypeSizer().Visit(TyLoc); |
102 | 249M | TyLoc = TyLoc.getNextTypeLoc(); |
103 | 249M | } |
104 | 183M | Total = llvm::alignTo(Total, MaxAlign); |
105 | 183M | return Total; |
106 | 183M | } |
107 | | |
108 | | namespace { |
109 | | |
110 | | class NextLoc : public TypeLocVisitor<NextLoc, TypeLoc> { |
111 | | public: |
112 | | #define ABSTRACT_TYPELOC(CLASS, PARENT) |
113 | | #define TYPELOC(CLASS, PARENT) \ |
114 | 439M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ |
115 | 439M | return TyLoc.getNextTypeLoc(); \ |
116 | 439M | } TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc) Line | Count | Source | 114 | 11.2M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 11.2M | return TyLoc.getNextTypeLoc(); \ | 116 | 11.2M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc) Line | Count | Source | 114 | 16 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 16 | return TyLoc.getNextTypeLoc(); \ | 116 | 16 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDecayedTypeLoc(clang::DecayedTypeLoc) Line | Count | Source | 114 | 8.10k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 8.10k | return TyLoc.getNextTypeLoc(); \ | 116 | 8.10k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc) Line | Count | Source | 114 | 715k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 715k | return TyLoc.getNextTypeLoc(); \ | 116 | 715k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc) Line | Count | Source | 114 | 87.4k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 87.4k | return TyLoc.getNextTypeLoc(); \ | 116 | 87.4k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc) Line | Count | Source | 114 | 190k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 190k | return TyLoc.getNextTypeLoc(); \ | 116 | 190k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc) Line | Count | Source | 114 | 31.0k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 31.0k | return TyLoc.getNextTypeLoc(); \ | 116 | 31.0k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAtomicTypeLoc(clang::AtomicTypeLoc) Line | Count | Source | 114 | 11.9k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 11.9k | return TyLoc.getNextTypeLoc(); \ | 116 | 11.9k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAttributedTypeLoc(clang::AttributedTypeLoc) Line | Count | Source | 114 | 4.22M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 4.22M | return TyLoc.getNextTypeLoc(); \ | 116 | 4.22M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBTFTagAttributedTypeLoc(clang::BTFTagAttributedTypeLoc) Line | Count | Source | 114 | 86 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 86 | return TyLoc.getNextTypeLoc(); \ | 116 | 86 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBitIntTypeLoc(clang::BitIntTypeLoc) Line | Count | Source | 114 | 1.56k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 1.56k | return TyLoc.getNextTypeLoc(); \ | 116 | 1.56k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc) Line | Count | Source | 114 | 157k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 157k | return TyLoc.getNextTypeLoc(); \ | 116 | 157k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc) Line | Count | Source | 114 | 23.1M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 23.1M | return TyLoc.getNextTypeLoc(); \ | 116 | 23.1M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitComplexTypeLoc(clang::ComplexTypeLoc) Line | Count | Source | 114 | 21.0k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 21.0k | return TyLoc.getNextTypeLoc(); \ | 116 | 21.0k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc) Line | Count | Source | 114 | 985k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 985k | return TyLoc.getNextTypeLoc(); \ | 116 | 985k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAutoTypeLoc(clang::AutoTypeLoc) Line | Count | Source | 114 | 538k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 538k | return TyLoc.getNextTypeLoc(); \ | 116 | 538k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc) Line | Count | Source | 114 | 9.57k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 9.57k | return TyLoc.getNextTypeLoc(); \ | 116 | 9.57k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc) Line | Count | Source | 114 | 144 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 144 | return TyLoc.getNextTypeLoc(); \ | 116 | 144 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentBitIntTypeLoc(clang::DependentBitIntTypeLoc) Line | Count | Source | 114 | 77 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 77 | return TyLoc.getNextTypeLoc(); \ | 116 | 77 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc) Line | Count | Source | 114 | 8.44M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 8.44M | return TyLoc.getNextTypeLoc(); \ | 116 | 8.44M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc) Line | Count | Source | 114 | 101 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 101 | return TyLoc.getNextTypeLoc(); \ | 116 | 101 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc) Line | Count | Source | 114 | 267k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 267k | return TyLoc.getNextTypeLoc(); \ | 116 | 267k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc) Line | Count | Source | 114 | 230 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 230 | return TyLoc.getNextTypeLoc(); \ | 116 | 230 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc) Line | Count | Source | 114 | 6.11M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 6.11M | return TyLoc.getNextTypeLoc(); \ | 116 | 6.11M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc) Line | Count | Source | 114 | 25.2k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 25.2k | return TyLoc.getNextTypeLoc(); \ | 116 | 25.2k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc) Line | Count | Source | 114 | 63.0M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 63.0M | return TyLoc.getNextTypeLoc(); \ | 116 | 63.0M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc) Line | Count | Source | 114 | 2.48M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 2.48M | return TyLoc.getNextTypeLoc(); \ | 116 | 2.48M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc) Line | Count | Source | 114 | 253k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 253k | return TyLoc.getNextTypeLoc(); \ | 116 | 253k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc) Line | Count | Source | 114 | 1.48k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 1.48k | return TyLoc.getNextTypeLoc(); \ | 116 | 1.48k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc) Line | Count | Source | 114 | 845 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 845 | return TyLoc.getNextTypeLoc(); \ | 116 | 845 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc) Line | Count | Source | 114 | 165k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 165k | return TyLoc.getNextTypeLoc(); \ | 116 | 165k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc) Line | Count | Source | 114 | 3.08M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 3.08M | return TyLoc.getNextTypeLoc(); \ | 116 | 3.08M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc) Line | Count | Source | 114 | 878k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 878k | return TyLoc.getNextTypeLoc(); \ | 116 | 878k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc) Line | Count | Source | 114 | 2.68M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 2.68M | return TyLoc.getNextTypeLoc(); \ | 116 | 2.68M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc) Line | Count | Source | 114 | 160k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 160k | return TyLoc.getNextTypeLoc(); \ | 116 | 160k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc) Line | Count | Source | 114 | 1.81M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 1.81M | return TyLoc.getNextTypeLoc(); \ | 116 | 1.81M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitParenTypeLoc(clang::ParenTypeLoc) Line | Count | Source | 114 | 828k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 828k | return TyLoc.getNextTypeLoc(); \ | 116 | 828k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPipeTypeLoc(clang::PipeTypeLoc) Line | Count | Source | 114 | 537 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 537 | return TyLoc.getNextTypeLoc(); \ | 116 | 537 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPointerTypeLoc(clang::PointerTypeLoc) Line | Count | Source | 114 | 17.8M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 17.8M | return TyLoc.getNextTypeLoc(); \ | 116 | 17.8M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc) Line | Count | Source | 114 | 9.81M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 9.81M | return TyLoc.getNextTypeLoc(); \ | 116 | 9.81M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc) Line | Count | Source | 114 | 2.48M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 2.48M | return TyLoc.getNextTypeLoc(); \ | 116 | 2.48M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc) Line | Count | Source | 114 | 137k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 137k | return TyLoc.getNextTypeLoc(); \ | 116 | 137k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc) Line | Count | Source | 114 | 23.4M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 23.4M | return TyLoc.getNextTypeLoc(); \ | 116 | 23.4M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitEnumTypeLoc(clang::EnumTypeLoc) Line | Count | Source | 114 | 829k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 829k | return TyLoc.getNextTypeLoc(); \ | 116 | 829k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitRecordTypeLoc(clang::RecordTypeLoc) Line | Count | Source | 114 | 11.9M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 11.9M | return TyLoc.getNextTypeLoc(); \ | 116 | 11.9M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc) Line | Count | Source | 114 | 82.3M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 82.3M | return TyLoc.getNextTypeLoc(); \ | 116 | 82.3M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc) Line | Count | Source | 114 | 38.0M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 38.0M | return TyLoc.getNextTypeLoc(); \ | 116 | 38.0M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc) Line | Count | Source | 114 | 7.44k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 7.44k | return TyLoc.getNextTypeLoc(); \ | 116 | 7.44k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc) Line | Count | Source | 114 | 184 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 184 | return TyLoc.getNextTypeLoc(); \ | 116 | 184 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypedefTypeLoc(clang::TypedefTypeLoc) Line | Count | Source | 114 | 119M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 119M | return TyLoc.getNextTypeLoc(); \ | 116 | 119M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc) Line | Count | Source | 114 | 6.69k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 6.69k | return TyLoc.getNextTypeLoc(); \ | 116 | 6.69k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc) Line | Count | Source | 114 | 5.02k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 5.02k | return TyLoc.getNextTypeLoc(); \ | 116 | 5.02k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUsingTypeLoc(clang::UsingTypeLoc) Line | Count | Source | 114 | 1.31M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 1.31M | return TyLoc.getNextTypeLoc(); \ | 116 | 1.31M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVectorTypeLoc(clang::VectorTypeLoc) Line | Count | Source | 114 | 171k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 171k | return TyLoc.getNextTypeLoc(); \ | 116 | 171k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc) Line | Count | Source | 114 | 5.25k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 5.25k | return TyLoc.getNextTypeLoc(); \ | 116 | 5.25k | } |
|
117 | | #include "clang/AST/TypeLocNodes.def" |
118 | | }; |
119 | | |
120 | | } // namespace |
121 | | |
122 | | /// Get the next TypeLoc pointed by this TypeLoc, e.g for "int*" the |
123 | | /// TypeLoc is a PointerLoc and next TypeLoc is for "int". |
124 | 439M | TypeLoc TypeLoc::getNextTypeLocImpl(TypeLoc TL) { |
125 | 439M | return NextLoc().Visit(TL); |
126 | 439M | } |
127 | | |
128 | | /// Initializes a type location, and all of its children |
129 | | /// recursively, as if the entire tree had been written in the |
130 | | /// given location. |
131 | | void TypeLoc::initializeImpl(ASTContext &Context, TypeLoc TL, |
132 | 18.1M | SourceLocation Loc) { |
133 | 23.4M | while (true23.4M ) { |
134 | 23.4M | switch (TL.getTypeLocClass()) { |
135 | 0 | #define ABSTRACT_TYPELOC(CLASS, PARENT) |
136 | 0 | #define TYPELOC(CLASS, PARENT) \ |
137 | 5.28M | case CLASS: { \ |
138 | 5.28M | CLASS##TypeLoc TLCasted = TL.castAs<CLASS##TypeLoc>(); \ |
139 | 5.28M | TLCasted.initializeLocal(Context, Loc); \ |
140 | 5.28M | TL = TLCasted.getNextTypeLoc(); \ |
141 | 23.4M | if (!TL) return18.1M ; \ |
142 | 5.28M | continue; \ |
143 | 5.28M | } |
144 | 23.4M | #include "clang/AST/TypeLocNodes.def"0 |
145 | 23.4M | } |
146 | 23.4M | } |
147 | 18.1M | } |
148 | | |
149 | | namespace { |
150 | | |
151 | | class TypeLocCopier : public TypeLocVisitor<TypeLocCopier> { |
152 | | TypeLoc Source; |
153 | | |
154 | | public: |
155 | 2.60k | TypeLocCopier(TypeLoc source) : Source(source) {} |
156 | | |
157 | | #define ABSTRACT_TYPELOC(CLASS, PARENT) |
158 | | #define TYPELOC(CLASS, PARENT) \ |
159 | 2.60k | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ |
160 | 2.60k | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ |
161 | 2.60k | } TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc) Line | Count | Source | 159 | 4 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 4 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 4 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDecayedTypeLoc(clang::DecayedTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc) TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitAtomicTypeLoc(clang::AtomicTypeLoc) Line | Count | Source | 159 | 1 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 1 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 1 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitAttributedTypeLoc(clang::AttributedTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitBTFTagAttributedTypeLoc(clang::BTFTagAttributedTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitBitIntTypeLoc(clang::BitIntTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc) TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc) Line | Count | Source | 159 | 880 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 880 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 880 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitComplexTypeLoc(clang::ComplexTypeLoc) Line | Count | Source | 159 | 4 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 4 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 4 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitAutoTypeLoc(clang::AutoTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentBitIntTypeLoc(clang::DependentBitIntTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc) TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc) Line | Count | Source | 159 | 3 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 3 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 3 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc) TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc) Line | Count | Source | 159 | 18 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 18 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 18 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc) Line | Count | Source | 159 | 18 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 18 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 18 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc) TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitParenTypeLoc(clang::ParenTypeLoc) Line | Count | Source | 159 | 3 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 3 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 3 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPipeTypeLoc(clang::PipeTypeLoc) TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPointerTypeLoc(clang::PointerTypeLoc) Line | Count | Source | 159 | 41 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 41 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 41 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitEnumTypeLoc(clang::EnumTypeLoc) TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitRecordTypeLoc(clang::RecordTypeLoc) Line | Count | Source | 159 | 49 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 49 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 49 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc) TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc) Line | Count | Source | 159 | 432 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 432 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 432 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc) Line | Count | Source | 159 | 1 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 1 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 1 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc) TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTypedefTypeLoc(clang::TypedefTypeLoc) Line | Count | Source | 159 | 1.14k | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 1.14k | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 1.14k | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitUsingTypeLoc(clang::UsingTypeLoc) TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitVectorTypeLoc(clang::VectorTypeLoc) Line | Count | Source | 159 | 2 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 2 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 2 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc) |
162 | | #include "clang/AST/TypeLocNodes.def" |
163 | | }; |
164 | | |
165 | | } // namespace |
166 | | |
167 | 176k | void TypeLoc::copy(TypeLoc other) { |
168 | 176k | assert(getFullDataSize() == other.getFullDataSize()); |
169 | | |
170 | | // If both data pointers are aligned to the maximum alignment, we |
171 | | // can memcpy because getFullDataSize() accurately reflects the |
172 | | // layout of the data. |
173 | 176k | if (reinterpret_cast<uintptr_t>(Data) == |
174 | 176k | llvm::alignTo(reinterpret_cast<uintptr_t>(Data), |
175 | 176k | TypeLocMaxDataAlign) && |
176 | 176k | reinterpret_cast<uintptr_t>(other.Data) == |
177 | 173k | llvm::alignTo(reinterpret_cast<uintptr_t>(other.Data), |
178 | 173k | TypeLocMaxDataAlign)) { |
179 | 173k | memcpy(Data, other.Data, getFullDataSize()); |
180 | 173k | return; |
181 | 173k | } |
182 | | |
183 | | // Copy each of the pieces. |
184 | 2.51k | TypeLoc TL(getType(), Data); |
185 | 2.60k | do { |
186 | 2.60k | TypeLocCopier(other).Visit(TL); |
187 | 2.60k | other = other.getNextTypeLoc(); |
188 | 2.60k | } while ((TL = TL.getNextTypeLoc())); |
189 | 2.51k | } |
190 | | |
191 | 104M | SourceLocation TypeLoc::getBeginLoc() const { |
192 | 104M | TypeLoc Cur = *this; |
193 | 104M | TypeLoc LeftMost = Cur; |
194 | 115M | while (true) { |
195 | 115M | switch (Cur.getTypeLocClass()) { |
196 | 767k | case Elaborated: |
197 | 767k | LeftMost = Cur; |
198 | 767k | break; |
199 | 4.06M | case FunctionProto: |
200 | 4.06M | if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr() |
201 | 4.06M | ->hasTrailingReturn()) { |
202 | 18.7k | LeftMost = Cur; |
203 | 18.7k | break; |
204 | 18.7k | } |
205 | 4.06M | LLVM_FALLTHROUGH4.04M ;4.04M |
206 | 4.05M | case FunctionNoProto: |
207 | 4.06M | case ConstantArray: |
208 | 4.08M | case DependentSizedArray: |
209 | 4.12M | case IncompleteArray: |
210 | 4.12M | case VariableArray: |
211 | | // FIXME: Currently QualifiedTypeLoc does not have a source range |
212 | 6.20M | case Qualified: |
213 | 6.20M | Cur = Cur.getNextTypeLoc(); |
214 | 6.20M | continue; |
215 | 108M | default: |
216 | 108M | if (Cur.getLocalSourceRange().getBegin().isValid()) |
217 | 107M | LeftMost = Cur; |
218 | 108M | Cur = Cur.getNextTypeLoc(); |
219 | 108M | if (Cur.isNull()) |
220 | 103M | break; |
221 | 5.25M | continue; |
222 | 115M | } // switch |
223 | 104M | break; |
224 | 115M | } // while |
225 | 104M | return LeftMost.getLocalSourceRange().getBegin(); |
226 | 104M | } |
227 | | |
228 | 16.8M | SourceLocation TypeLoc::getEndLoc() const { |
229 | 16.8M | TypeLoc Cur = *this; |
230 | 16.8M | TypeLoc Last; |
231 | 19.3M | while (true) { |
232 | 19.3M | switch (Cur.getTypeLocClass()) { |
233 | 16.8M | default: |
234 | 16.8M | if (!Last) |
235 | 15.4M | Last = Cur; |
236 | 16.8M | return Last.getLocalSourceRange().getEnd(); |
237 | 30.4k | case Paren: |
238 | 33.9k | case ConstantArray: |
239 | 41.7k | case DependentSizedArray: |
240 | 57.9k | case IncompleteArray: |
241 | 57.9k | case VariableArray: |
242 | 58.2k | case FunctionNoProto: |
243 | | // The innermost type with suffix syntax always determines the end of the |
244 | | // type. |
245 | 58.2k | Last = Cur; |
246 | 58.2k | break; |
247 | 476k | case FunctionProto: |
248 | 476k | if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr()->hasTrailingReturn()) |
249 | 4.48k | Last = TypeLoc(); |
250 | 471k | else |
251 | 471k | Last = Cur; |
252 | 476k | break; |
253 | 1.77k | case ObjCObjectPointer: |
254 | | // `id` and `id<...>` have no star location. |
255 | 1.77k | if (Cur.castAs<ObjCObjectPointerTypeLoc>().getStarLoc().isInvalid()) |
256 | 130 | break; |
257 | 1.77k | LLVM_FALLTHROUGH1.64k ;1.64k |
258 | 465k | case Pointer: |
259 | 465k | case BlockPointer: |
260 | 504k | case MemberPointer: |
261 | 765k | case LValueReference: |
262 | 852k | case RValueReference: |
263 | 1.06M | case PackExpansion: |
264 | | // Types with prefix syntax only determine the end of the type if there |
265 | | // is no suffix type. |
266 | 1.06M | if (!Last) |
267 | 980k | Last = Cur; |
268 | 1.06M | break; |
269 | 359k | case Qualified: |
270 | 811k | case Elaborated: |
271 | 811k | break; |
272 | 19.3M | } |
273 | 2.40M | Cur = Cur.getNextTypeLoc(); |
274 | 2.40M | } |
275 | 16.8M | } |
276 | | |
277 | | namespace { |
278 | | |
279 | | struct TSTChecker : public TypeLocVisitor<TSTChecker, bool> { |
280 | | // Overload resolution does the real work for us. |
281 | 1.43M | static bool isTypeSpec(TypeSpecTypeLoc _) { return true; } |
282 | 0 | static bool isTypeSpec(TypeLoc _) { return false; } |
283 | | |
284 | | #define ABSTRACT_TYPELOC(CLASS, PARENT) |
285 | | #define TYPELOC(CLASS, PARENT) \ |
286 | 1.43M | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ |
287 | 1.43M | return isTypeSpec(TyLoc); \ |
288 | 1.43M | } Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDecayedTypeLoc(clang::DecayedTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitAtomicTypeLoc(clang::AtomicTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitAttributedTypeLoc(clang::AttributedTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitBTFTagAttributedTypeLoc(clang::BTFTagAttributedTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitBitIntTypeLoc(clang::BitIntTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitComplexTypeLoc(clang::ComplexTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitAutoTypeLoc(clang::AutoTypeLoc) TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc) Line | Count | Source | 286 | 64 | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 287 | 64 | return isTypeSpec(TyLoc); \ | 288 | 64 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentBitIntTypeLoc(clang::DependentBitIntTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc) TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc) Line | Count | Source | 286 | 6.06k | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 287 | 6.06k | return isTypeSpec(TyLoc); \ | 288 | 6.06k | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitParenTypeLoc(clang::ParenTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitPipeTypeLoc(clang::PipeTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitPointerTypeLoc(clang::PointerTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc) TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitEnumTypeLoc(clang::EnumTypeLoc) Line | Count | Source | 286 | 10.2k | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 287 | 10.2k | return isTypeSpec(TyLoc); \ | 288 | 10.2k | } |
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitRecordTypeLoc(clang::RecordTypeLoc) Line | Count | Source | 286 | 563k | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 287 | 563k | return isTypeSpec(TyLoc); \ | 288 | 563k | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc) TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTypedefTypeLoc(clang::TypedefTypeLoc) Line | Count | Source | 286 | 845k | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 287 | 845k | return isTypeSpec(TyLoc); \ | 288 | 845k | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc) TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc) Line | Count | Source | 286 | 122 | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 287 | 122 | return isTypeSpec(TyLoc); \ | 288 | 122 | } |
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUsingTypeLoc(clang::UsingTypeLoc) Line | Count | Source | 286 | 9.46k | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 287 | 9.46k | return isTypeSpec(TyLoc); \ | 288 | 9.46k | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitVectorTypeLoc(clang::VectorTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc) |
289 | | #include "clang/AST/TypeLocNodes.def" |
290 | | }; |
291 | | |
292 | | } // namespace |
293 | | |
294 | | /// Determines if the given type loc corresponds to a |
295 | | /// TypeSpecTypeLoc. Since there is not actually a TypeSpecType in |
296 | | /// the type hierarchy, this is made somewhat complicated. |
297 | | /// |
298 | | /// There are a lot of types that currently use TypeSpecTypeLoc |
299 | | /// because it's a convenient base class. Ideally we would not accept |
300 | | /// those here, but ideally we would have better implementations for |
301 | | /// them. |
302 | 1.43M | bool TypeSpecTypeLoc::isKind(const TypeLoc &TL) { |
303 | 1.43M | if (TL.getType().hasLocalQualifiers()) return false0 ; |
304 | 1.43M | return TSTChecker().Visit(TL); |
305 | 1.43M | } |
306 | | |
307 | 765 | bool TagTypeLoc::isDefinition() const { |
308 | 765 | TagDecl *D = getDecl(); |
309 | 765 | return D->isCompleteDefinition() && |
310 | 765 | (715 D->getIdentifier() == nullptr715 || D->getLocation() == getNameLoc()677 ); |
311 | 765 | } |
312 | | |
313 | | // Reimplemented to account for GNU/C++ extension |
314 | | // typeof unary-expression |
315 | | // where there are no parentheses. |
316 | 6.19k | SourceRange TypeOfExprTypeLoc::getLocalSourceRange() const { |
317 | 6.19k | if (getRParenLoc().isValid()) |
318 | 6.19k | return SourceRange(getTypeofLoc(), getRParenLoc()); |
319 | 0 | else |
320 | 0 | return SourceRange(getTypeofLoc(), |
321 | 0 | getUnderlyingExpr()->getSourceRange().getEnd()); |
322 | 6.19k | } |
323 | | |
324 | | |
325 | 325k | TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const { |
326 | 325k | if (needsExtraLocalData()) |
327 | 325k | return static_cast<TypeSpecifierType>(getWrittenBuiltinSpecs().Type); |
328 | 0 | switch (getTypePtr()->getKind()) { |
329 | 0 | case BuiltinType::Void: |
330 | 0 | return TST_void; |
331 | 0 | case BuiltinType::Bool: |
332 | 0 | return TST_bool; |
333 | 0 | case BuiltinType::Char_U: |
334 | 0 | case BuiltinType::Char_S: |
335 | 0 | return TST_char; |
336 | 0 | case BuiltinType::Char8: |
337 | 0 | return TST_char8; |
338 | 0 | case BuiltinType::Char16: |
339 | 0 | return TST_char16; |
340 | 0 | case BuiltinType::Char32: |
341 | 0 | return TST_char32; |
342 | 0 | case BuiltinType::WChar_S: |
343 | 0 | case BuiltinType::WChar_U: |
344 | 0 | return TST_wchar; |
345 | 0 | case BuiltinType::UChar: |
346 | 0 | case BuiltinType::UShort: |
347 | 0 | case BuiltinType::UInt: |
348 | 0 | case BuiltinType::ULong: |
349 | 0 | case BuiltinType::ULongLong: |
350 | 0 | case BuiltinType::UInt128: |
351 | 0 | case BuiltinType::SChar: |
352 | 0 | case BuiltinType::Short: |
353 | 0 | case BuiltinType::Int: |
354 | 0 | case BuiltinType::Long: |
355 | 0 | case BuiltinType::LongLong: |
356 | 0 | case BuiltinType::Int128: |
357 | 0 | case BuiltinType::Half: |
358 | 0 | case BuiltinType::Float: |
359 | 0 | case BuiltinType::Double: |
360 | 0 | case BuiltinType::LongDouble: |
361 | 0 | case BuiltinType::Float16: |
362 | 0 | case BuiltinType::Float128: |
363 | 0 | case BuiltinType::Ibm128: |
364 | 0 | case BuiltinType::ShortAccum: |
365 | 0 | case BuiltinType::Accum: |
366 | 0 | case BuiltinType::LongAccum: |
367 | 0 | case BuiltinType::UShortAccum: |
368 | 0 | case BuiltinType::UAccum: |
369 | 0 | case BuiltinType::ULongAccum: |
370 | 0 | case BuiltinType::ShortFract: |
371 | 0 | case BuiltinType::Fract: |
372 | 0 | case BuiltinType::LongFract: |
373 | 0 | case BuiltinType::UShortFract: |
374 | 0 | case BuiltinType::UFract: |
375 | 0 | case BuiltinType::ULongFract: |
376 | 0 | case BuiltinType::SatShortAccum: |
377 | 0 | case BuiltinType::SatAccum: |
378 | 0 | case BuiltinType::SatLongAccum: |
379 | 0 | case BuiltinType::SatUShortAccum: |
380 | 0 | case BuiltinType::SatUAccum: |
381 | 0 | case BuiltinType::SatULongAccum: |
382 | 0 | case BuiltinType::SatShortFract: |
383 | 0 | case BuiltinType::SatFract: |
384 | 0 | case BuiltinType::SatLongFract: |
385 | 0 | case BuiltinType::SatUShortFract: |
386 | 0 | case BuiltinType::SatUFract: |
387 | 0 | case BuiltinType::SatULongFract: |
388 | 0 | case BuiltinType::BFloat16: |
389 | 0 | llvm_unreachable("Builtin type needs extra local data!"); |
390 | | // Fall through, if the impossible happens. |
391 | |
|
392 | 0 | case BuiltinType::NullPtr: |
393 | 0 | case BuiltinType::Overload: |
394 | 0 | case BuiltinType::Dependent: |
395 | 0 | case BuiltinType::BoundMember: |
396 | 0 | case BuiltinType::UnknownAny: |
397 | 0 | case BuiltinType::ARCUnbridgedCast: |
398 | 0 | case BuiltinType::PseudoObject: |
399 | 0 | case BuiltinType::ObjCId: |
400 | 0 | case BuiltinType::ObjCClass: |
401 | 0 | case BuiltinType::ObjCSel: |
402 | 0 | #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ |
403 | 0 | case BuiltinType::Id: |
404 | 0 | #include "clang/Basic/OpenCLImageTypes.def" |
405 | 0 | #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \ |
406 | 0 | case BuiltinType::Id: |
407 | 0 | #include "clang/Basic/OpenCLExtensionTypes.def" |
408 | 0 | case BuiltinType::OCLSampler: |
409 | 0 | case BuiltinType::OCLEvent: |
410 | 0 | case BuiltinType::OCLClkEvent: |
411 | 0 | case BuiltinType::OCLQueue: |
412 | 0 | case BuiltinType::OCLReserveID: |
413 | 0 | #define SVE_TYPE(Name, Id, SingletonId) \ |
414 | 0 | case BuiltinType::Id: |
415 | 0 | #include "clang/Basic/AArch64SVEACLETypes.def" |
416 | 0 | #define PPC_VECTOR_TYPE(Name, Id, Size) \ |
417 | 0 | case BuiltinType::Id: |
418 | 0 | #include "clang/Basic/PPCTypes.def" |
419 | 0 | #define RVV_TYPE(Name, Id, SingletonId) case BuiltinType::Id: |
420 | 0 | #include "clang/Basic/RISCVVTypes.def" |
421 | 0 | case BuiltinType::BuiltinFn: |
422 | 0 | case BuiltinType::IncompleteMatrixIdx: |
423 | 0 | case BuiltinType::OMPArraySection: |
424 | 0 | case BuiltinType::OMPArrayShaping: |
425 | 0 | case BuiltinType::OMPIterator: |
426 | 0 | return TST_unspecified; |
427 | 0 | } |
428 | | |
429 | 0 | llvm_unreachable("Invalid BuiltinType Kind!"); |
430 | 0 | } |
431 | | |
432 | 172 | TypeLoc TypeLoc::IgnoreParensImpl(TypeLoc TL) { |
433 | 344 | while (ParenTypeLoc PTL = TL.getAs<ParenTypeLoc>()) |
434 | 172 | TL = PTL.getInnerLoc(); |
435 | 172 | return TL; |
436 | 172 | } |
437 | | |
438 | 25 | SourceLocation TypeLoc::findNullabilityLoc() const { |
439 | 25 | if (auto ATL = getAs<AttributedTypeLoc>()) { |
440 | 25 | const Attr *A = ATL.getAttr(); |
441 | 25 | if (A && (isa<TypeNullableAttr>(A) || isa<TypeNonNullAttr>(A) || |
442 | 25 | isa<TypeNullUnspecifiedAttr>(A)0 )) |
443 | 25 | return A->getLocation(); |
444 | 25 | } |
445 | | |
446 | 0 | return {}; |
447 | 25 | } |
448 | | |
449 | 161k | TypeLoc TypeLoc::findExplicitQualifierLoc() const { |
450 | | // Qualified types. |
451 | 161k | if (auto qual = getAs<QualifiedTypeLoc>()) |
452 | 9 | return qual; |
453 | | |
454 | 161k | TypeLoc loc = IgnoreParens(); |
455 | | |
456 | | // Attributed types. |
457 | 161k | if (auto attr = loc.getAs<AttributedTypeLoc>()) { |
458 | 23 | if (attr.isQualifier()) return attr; |
459 | 0 | return attr.getModifiedLoc().findExplicitQualifierLoc(); |
460 | 23 | } |
461 | | |
462 | | // C11 _Atomic types. |
463 | 161k | if (auto atomic = loc.getAs<AtomicTypeLoc>()) { |
464 | 0 | return atomic; |
465 | 0 | } |
466 | | |
467 | 161k | return {}; |
468 | 161k | } |
469 | | |
470 | | void ObjCTypeParamTypeLoc::initializeLocal(ASTContext &Context, |
471 | 132k | SourceLocation Loc) { |
472 | 132k | setNameLoc(Loc); |
473 | 132k | if (!getNumProtocols()) return130k ; |
474 | | |
475 | 1.78k | setProtocolLAngleLoc(Loc); |
476 | 1.78k | setProtocolRAngleLoc(Loc); |
477 | 3.56k | for (unsigned i = 0, e = getNumProtocols(); i != e; ++i1.78k ) |
478 | 1.78k | setProtocolLoc(i, Loc); |
479 | 1.78k | } |
480 | | |
481 | | void ObjCObjectTypeLoc::initializeLocal(ASTContext &Context, |
482 | 57.0k | SourceLocation Loc) { |
483 | 57.0k | setHasBaseTypeAsWritten(true); |
484 | 57.0k | setTypeArgsLAngleLoc(Loc); |
485 | 57.0k | setTypeArgsRAngleLoc(Loc); |
486 | 57.2k | for (unsigned i = 0, e = getNumTypeArgs(); i != e; ++i169 ) { |
487 | 169 | setTypeArgTInfo(i, |
488 | 169 | Context.getTrivialTypeSourceInfo( |
489 | 169 | getTypePtr()->getTypeArgsAsWritten()[i], Loc)); |
490 | 169 | } |
491 | 57.0k | setProtocolLAngleLoc(Loc); |
492 | 57.0k | setProtocolRAngleLoc(Loc); |
493 | 57.1k | for (unsigned i = 0, e = getNumProtocols(); i != e; ++i11 ) |
494 | 11 | setProtocolLoc(i, Loc); |
495 | 57.0k | } |
496 | | |
497 | 781k | SourceRange AttributedTypeLoc::getLocalSourceRange() const { |
498 | | // Note that this does *not* include the range of the attribute |
499 | | // enclosure, e.g.: |
500 | | // __attribute__((foo(bar))) |
501 | | // ^~~~~~~~~~~~~~~ ~~ |
502 | | // or |
503 | | // [[foo(bar)]] |
504 | | // ^~ ~~ |
505 | | // That enclosure doesn't necessarily belong to a single attribute |
506 | | // anyway. |
507 | 781k | return getAttr() ? getAttr()->getRange()780k : SourceRange()231 ; |
508 | 781k | } |
509 | | |
510 | 16 | SourceRange BTFTagAttributedTypeLoc::getLocalSourceRange() const { |
511 | 16 | return getAttr() ? getAttr()->getRange() : SourceRange()0 ; |
512 | 16 | } |
513 | | |
514 | | void TypeOfTypeLoc::initializeLocal(ASTContext &Context, |
515 | 2 | SourceLocation Loc) { |
516 | 2 | TypeofLikeTypeLoc<TypeOfTypeLoc, TypeOfType, TypeOfTypeLocInfo> |
517 | 2 | ::initializeLocal(Context, Loc); |
518 | 2 | this->getLocalData()->UnderlyingTInfo = Context.getTrivialTypeSourceInfo( |
519 | 2 | getUnderlyingType(), Loc); |
520 | 2 | } |
521 | | |
522 | | void UnaryTransformTypeLoc::initializeLocal(ASTContext &Context, |
523 | 194 | SourceLocation Loc) { |
524 | 194 | setKWLoc(Loc); |
525 | 194 | setRParenLoc(Loc); |
526 | 194 | setLParenLoc(Loc); |
527 | 194 | this->setUnderlyingTInfo( |
528 | 194 | Context.getTrivialTypeSourceInfo(getTypePtr()->getBaseType(), Loc)); |
529 | 194 | } |
530 | | |
531 | | void ElaboratedTypeLoc::initializeLocal(ASTContext &Context, |
532 | 159k | SourceLocation Loc) { |
533 | 159k | setElaboratedKeywordLoc(Loc); |
534 | 159k | NestedNameSpecifierLocBuilder Builder; |
535 | 159k | Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc); |
536 | 159k | setQualifierLoc(Builder.getWithLocInContext(Context)); |
537 | 159k | } |
538 | | |
539 | | void DependentNameTypeLoc::initializeLocal(ASTContext &Context, |
540 | 709k | SourceLocation Loc) { |
541 | 709k | setElaboratedKeywordLoc(Loc); |
542 | 709k | NestedNameSpecifierLocBuilder Builder; |
543 | 709k | Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc); |
544 | 709k | setQualifierLoc(Builder.getWithLocInContext(Context)); |
545 | 709k | setNameLoc(Loc); |
546 | 709k | } |
547 | | |
548 | | void |
549 | | DependentTemplateSpecializationTypeLoc::initializeLocal(ASTContext &Context, |
550 | 31.9k | SourceLocation Loc) { |
551 | 31.9k | setElaboratedKeywordLoc(Loc); |
552 | 31.9k | if (getTypePtr()->getQualifier()) { |
553 | 31.9k | NestedNameSpecifierLocBuilder Builder; |
554 | 31.9k | Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc); |
555 | 31.9k | setQualifierLoc(Builder.getWithLocInContext(Context)); |
556 | 31.9k | } else { |
557 | 0 | setQualifierLoc(NestedNameSpecifierLoc()); |
558 | 0 | } |
559 | 31.9k | setTemplateKeywordLoc(Loc); |
560 | 31.9k | setTemplateNameLoc(Loc); |
561 | 31.9k | setLAngleLoc(Loc); |
562 | 31.9k | setRAngleLoc(Loc); |
563 | 31.9k | TemplateSpecializationTypeLoc::initializeArgLocs(Context, getNumArgs(), |
564 | 31.9k | getTypePtr()->getArgs(), |
565 | 31.9k | getArgInfos(), Loc); |
566 | 31.9k | } |
567 | | |
568 | | void TemplateSpecializationTypeLoc::initializeArgLocs(ASTContext &Context, |
569 | | unsigned NumArgs, |
570 | | const TemplateArgument *Args, |
571 | | TemplateArgumentLocInfo *ArgInfos, |
572 | 2.13M | SourceLocation Loc) { |
573 | 5.72M | for (unsigned i = 0, e = NumArgs; i != e; ++i3.59M ) { |
574 | 3.59M | switch (Args[i].getKind()) { |
575 | 0 | case TemplateArgument::Null: |
576 | 0 | llvm_unreachable("Impossible TemplateArgument"); |
577 | |
|
578 | 18 | case TemplateArgument::Integral: |
579 | 21 | case TemplateArgument::Declaration: |
580 | 24 | case TemplateArgument::NullPtr: |
581 | 24 | ArgInfos[i] = TemplateArgumentLocInfo(); |
582 | 24 | break; |
583 | | |
584 | 1.06M | case TemplateArgument::Expression: |
585 | 1.06M | ArgInfos[i] = TemplateArgumentLocInfo(Args[i].getAsExpr()); |
586 | 1.06M | break; |
587 | | |
588 | 2.50M | case TemplateArgument::Type: |
589 | 2.50M | ArgInfos[i] = TemplateArgumentLocInfo( |
590 | 2.50M | Context.getTrivialTypeSourceInfo(Args[i].getAsType(), |
591 | 2.50M | Loc)); |
592 | 2.50M | break; |
593 | | |
594 | 5.88k | case TemplateArgument::Template: |
595 | 5.89k | case TemplateArgument::TemplateExpansion: { |
596 | 5.89k | NestedNameSpecifierLocBuilder Builder; |
597 | 5.89k | TemplateName Template = Args[i].getAsTemplateOrTemplatePattern(); |
598 | 5.89k | if (DependentTemplateName *DTN = Template.getAsDependentTemplateName()) |
599 | 36 | Builder.MakeTrivial(Context, DTN->getQualifier(), Loc); |
600 | 5.85k | else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName()) |
601 | 2 | Builder.MakeTrivial(Context, QTN->getQualifier(), Loc); |
602 | | |
603 | 5.89k | ArgInfos[i] = TemplateArgumentLocInfo( |
604 | 5.89k | Context, Builder.getWithLocInContext(Context), Loc, |
605 | 5.89k | Args[i].getKind() == TemplateArgument::Template ? SourceLocation()5.88k |
606 | 5.89k | : Loc3 ); |
607 | 5.89k | break; |
608 | 5.88k | } |
609 | | |
610 | 15.8k | case TemplateArgument::Pack: |
611 | 15.8k | ArgInfos[i] = TemplateArgumentLocInfo(); |
612 | 15.8k | break; |
613 | 3.59M | } |
614 | 3.59M | } |
615 | 2.13M | } |
616 | | |
617 | 10 | DeclarationNameInfo AutoTypeLoc::getConceptNameInfo() const { |
618 | 10 | return DeclarationNameInfo(getNamedConcept()->getDeclName(), |
619 | 10 | getLocalData()->ConceptNameLoc); |
620 | 10 | } |
621 | | |
622 | 34.3k | void AutoTypeLoc::initializeLocal(ASTContext &Context, SourceLocation Loc) { |
623 | 34.3k | setNestedNameSpecifierLoc(NestedNameSpecifierLoc()); |
624 | 34.3k | setTemplateKWLoc(Loc); |
625 | 34.3k | setConceptNameLoc(Loc); |
626 | 34.3k | setFoundDecl(nullptr); |
627 | 34.3k | setRAngleLoc(Loc); |
628 | 34.3k | setLAngleLoc(Loc); |
629 | 34.3k | setRParenLoc(Loc); |
630 | 34.3k | TemplateSpecializationTypeLoc::initializeArgLocs(Context, getNumArgs(), |
631 | 34.3k | getTypePtr()->getArgs(), |
632 | 34.3k | getArgInfos(), Loc); |
633 | 34.3k | setNameLoc(Loc); |
634 | 34.3k | } |
635 | | |
636 | | |
637 | | namespace { |
638 | | |
639 | | class GetContainedAutoTypeLocVisitor : |
640 | | public TypeLocVisitor<GetContainedAutoTypeLocVisitor, TypeLoc> { |
641 | | public: |
642 | | using TypeLocVisitor<GetContainedAutoTypeLocVisitor, TypeLoc>::Visit; |
643 | | |
644 | 275 | TypeLoc VisitAutoTypeLoc(AutoTypeLoc TL) { |
645 | 275 | return TL; |
646 | 275 | } |
647 | | |
648 | | // Only these types can contain the desired 'auto' type. |
649 | | |
650 | 325 | TypeLoc VisitElaboratedTypeLoc(ElaboratedTypeLoc T) { |
651 | 325 | return Visit(T.getNamedTypeLoc()); |
652 | 325 | } |
653 | | |
654 | 239 | TypeLoc VisitQualifiedTypeLoc(QualifiedTypeLoc T) { |
655 | 239 | return Visit(T.getUnqualifiedLoc()); |
656 | 239 | } |
657 | | |
658 | 22.5k | TypeLoc VisitPointerTypeLoc(PointerTypeLoc T) { |
659 | 22.5k | return Visit(T.getPointeeLoc()); |
660 | 22.5k | } |
661 | | |
662 | 0 | TypeLoc VisitBlockPointerTypeLoc(BlockPointerTypeLoc T) { |
663 | 0 | return Visit(T.getPointeeLoc()); |
664 | 0 | } |
665 | | |
666 | 3.56k | TypeLoc VisitReferenceTypeLoc(ReferenceTypeLoc T) { |
667 | 3.56k | return Visit(T.getPointeeLoc()); |
668 | 3.56k | } |
669 | | |
670 | 111 | TypeLoc VisitMemberPointerTypeLoc(MemberPointerTypeLoc T) { |
671 | 111 | return Visit(T.getPointeeLoc()); |
672 | 111 | } |
673 | | |
674 | 75 | TypeLoc VisitArrayTypeLoc(ArrayTypeLoc T) { |
675 | 75 | return Visit(T.getElementLoc()); |
676 | 75 | } |
677 | | |
678 | 341 | TypeLoc VisitFunctionTypeLoc(FunctionTypeLoc T) { |
679 | 341 | return Visit(T.getReturnLoc()); |
680 | 341 | } |
681 | | |
682 | 340 | TypeLoc VisitParenTypeLoc(ParenTypeLoc T) { |
683 | 340 | return Visit(T.getInnerLoc()); |
684 | 340 | } |
685 | | |
686 | 2 | TypeLoc VisitAttributedTypeLoc(AttributedTypeLoc T) { |
687 | 2 | return Visit(T.getModifiedLoc()); |
688 | 2 | } |
689 | | |
690 | 0 | TypeLoc VisitBTFTagAttributedTypeLoc(BTFTagAttributedTypeLoc T) { |
691 | 0 | return Visit(T.getWrappedLoc()); |
692 | 0 | } |
693 | | |
694 | 0 | TypeLoc VisitMacroQualifiedTypeLoc(MacroQualifiedTypeLoc T) { |
695 | 0 | return Visit(T.getInnerLoc()); |
696 | 0 | } |
697 | | |
698 | 0 | TypeLoc VisitAdjustedTypeLoc(AdjustedTypeLoc T) { |
699 | 0 | return Visit(T.getOriginalLoc()); |
700 | 0 | } |
701 | | |
702 | 98 | TypeLoc VisitPackExpansionTypeLoc(PackExpansionTypeLoc T) { |
703 | 98 | return Visit(T.getPatternLoc()); |
704 | 98 | } |
705 | | }; |
706 | | |
707 | | } // namespace |
708 | | |
709 | 348k | AutoTypeLoc TypeLoc::getContainedAutoTypeLoc() const { |
710 | 348k | TypeLoc Res = GetContainedAutoTypeLocVisitor().Visit(*this); |
711 | 348k | if (Res.isNull()) |
712 | 348k | return AutoTypeLoc(); |
713 | 275 | return Res.getAs<AutoTypeLoc>(); |
714 | 348k | } |