/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 | 212M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ |
46 | 212M | return TyLoc.getLocalSourceRange(); \ |
47 | 212M | } TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc) Line | Count | Source | 45 | 8.50k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 8.50k | return TyLoc.getLocalSourceRange(); \ | 47 | 8.50k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc) Line | Count | Source | 45 | 1 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 1 | return TyLoc.getLocalSourceRange(); \ | 47 | 1 | } |
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.03k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 4.03k | return TyLoc.getLocalSourceRange(); \ | 47 | 4.03k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc) Line | Count | Source | 45 | 6.04k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 6.04k | return TyLoc.getLocalSourceRange(); \ | 47 | 6.04k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc) Line | Count | Source | 45 | 14.0k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 14.0k | return TyLoc.getLocalSourceRange(); \ | 47 | 14.0k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc) Line | Count | Source | 45 | 62 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 62 | return TyLoc.getLocalSourceRange(); \ | 47 | 62 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAtomicTypeLoc(clang::AtomicTypeLoc) Line | Count | Source | 45 | 825 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 825 | return TyLoc.getLocalSourceRange(); \ | 47 | 825 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAttributedTypeLoc(clang::AttributedTypeLoc) Line | Count | Source | 45 | 1.01M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 1.01M | return TyLoc.getLocalSourceRange(); \ | 47 | 1.01M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc) Line | Count | Source | 45 | 43.1k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 43.1k | return TyLoc.getLocalSourceRange(); \ | 47 | 43.1k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc) Line | Count | Source | 45 | 10.0M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 10.0M | return TyLoc.getLocalSourceRange(); \ | 47 | 10.0M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitComplexTypeLoc(clang::ComplexTypeLoc) Line | Count | Source | 45 | 2.96k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 2.96k | return TyLoc.getLocalSourceRange(); \ | 47 | 2.96k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc) Line | Count | Source | 45 | 388k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 388k | return TyLoc.getLocalSourceRange(); \ | 47 | 388k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAutoTypeLoc(clang::AutoTypeLoc) Line | Count | Source | 45 | 57.6k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 57.6k | return TyLoc.getLocalSourceRange(); \ | 47 | 57.6k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc) Line | Count | Source | 45 | 9.22k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 9.22k | return TyLoc.getLocalSourceRange(); \ | 47 | 9.22k | } |
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::VisitDependentExtIntTypeLoc(clang::DependentExtIntTypeLoc) Line | Count | Source | 45 | 18 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 18 | return TyLoc.getLocalSourceRange(); \ | 47 | 18 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc) Line | Count | Source | 45 | 4.19M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 4.19M | return TyLoc.getLocalSourceRange(); \ | 47 | 4.19M | } |
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 | 315k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 315k | return TyLoc.getLocalSourceRange(); \ | 47 | 315k | } |
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 | 656k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 656k | return TyLoc.getLocalSourceRange(); \ | 47 | 656k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitExtIntTypeLoc(clang::ExtIntTypeLoc) Line | Count | Source | 45 | 1.09k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 1.09k | return TyLoc.getLocalSourceRange(); \ | 47 | 1.09k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc) Line | Count | Source | 45 | 251 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 251 | return TyLoc.getLocalSourceRange(); \ | 47 | 251 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc) Line | Count | Source | 45 | 1.02M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 1.02M | return TyLoc.getLocalSourceRange(); \ | 47 | 1.02M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc) Line | Count | Source | 45 | 1.82M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 1.82M | return TyLoc.getLocalSourceRange(); \ | 47 | 1.82M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc) Line | Count | Source | 45 | 190 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 190 | return TyLoc.getLocalSourceRange(); \ | 47 | 190 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc) Line | Count | Source | 45 | 36 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 36 | return TyLoc.getLocalSourceRange(); \ | 47 | 36 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc) Line | Count | Source | 45 | 366 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 366 | return TyLoc.getLocalSourceRange(); \ | 47 | 366 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc) 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::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc) Line | Count | Source | 45 | 705k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 705k | return TyLoc.getLocalSourceRange(); \ | 47 | 705k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc) Line | Count | Source | 45 | 81.0k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 81.0k | return TyLoc.getLocalSourceRange(); \ | 47 | 81.0k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc) Line | Count | Source | 45 | 2.04M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 2.04M | return TyLoc.getLocalSourceRange(); \ | 47 | 2.04M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc) Line | Count | Source | 45 | 61.3k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 61.3k | return TyLoc.getLocalSourceRange(); \ | 47 | 61.3k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc) Line | Count | Source | 45 | 285k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 285k | return TyLoc.getLocalSourceRange(); \ | 47 | 285k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitParenTypeLoc(clang::ParenTypeLoc) Line | Count | Source | 45 | 103k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 103k | return TyLoc.getLocalSourceRange(); \ | 47 | 103k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPipeTypeLoc(clang::PipeTypeLoc) Line | Count | Source | 45 | 2 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 2 | return TyLoc.getLocalSourceRange(); \ | 47 | 2 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPointerTypeLoc(clang::PointerTypeLoc) Line | Count | Source | 45 | 1.61M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 1.61M | return TyLoc.getLocalSourceRange(); \ | 47 | 1.61M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc) Line | Count | Source | 45 | 1.39M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 1.39M | return TyLoc.getLocalSourceRange(); \ | 47 | 1.39M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc) Line | Count | Source | 45 | 460k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 460k | return TyLoc.getLocalSourceRange(); \ | 47 | 460k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc) Line | Count | Source | 45 | 252 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 252 | return TyLoc.getLocalSourceRange(); \ | 47 | 252 | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc) Line | Count | Source | 45 | 14.1M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 14.1M | return TyLoc.getLocalSourceRange(); \ | 47 | 14.1M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitEnumTypeLoc(clang::EnumTypeLoc) Line | Count | Source | 45 | 312k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 312k | return TyLoc.getLocalSourceRange(); \ | 47 | 312k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRecordTypeLoc(clang::RecordTypeLoc) Line | Count | Source | 45 | 10.5M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 10.5M | return TyLoc.getLocalSourceRange(); \ | 47 | 10.5M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc) Line | Count | Source | 45 | 98.0M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 98.0M | return TyLoc.getLocalSourceRange(); \ | 47 | 98.0M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc) Line | Count | Source | 45 | 29.9M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 29.9M | return TyLoc.getLocalSourceRange(); \ | 47 | 29.9M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc) Line | Count | Source | 45 | 6.62k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 6.62k | return TyLoc.getLocalSourceRange(); \ | 47 | 6.62k | } |
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 | 32.5M | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 32.5M | return TyLoc.getLocalSourceRange(); \ | 47 | 32.5M | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc) Line | Count | Source | 45 | 2.00k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 2.00k | return TyLoc.getLocalSourceRange(); \ | 47 | 2.00k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc) Line | Count | Source | 45 | 2.72k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 2.72k | return TyLoc.getLocalSourceRange(); \ | 47 | 2.72k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitVectorTypeLoc(clang::VectorTypeLoc) Line | Count | Source | 45 | 362k | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 362k | return TyLoc.getLocalSourceRange(); \ | 47 | 362k | } |
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc) Line | Count | Source | 45 | 94 | SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 46 | 94 | return TyLoc.getLocalSourceRange(); \ | 47 | 94 | } |
|
48 | | #include "clang/AST/TypeLocNodes.def" |
49 | | }; |
50 | | |
51 | | } // namespace |
52 | | |
53 | 212M | SourceRange TypeLoc::getLocalSourceRangeImpl(TypeLoc TL) { |
54 | 212M | if (TL.isNull()) return SourceRange()0 ; |
55 | 212M | return TypeLocRanger().Visit(TL); |
56 | 212M | } |
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 | 295M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ |
65 | 295M | return TyLoc.getLocalDataAlignment(); \ |
66 | 295M | } TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc) Line | Count | Source | 64 | 17.5M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 17.5M | return TyLoc.getLocalDataAlignment(); \ | 66 | 17.5M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc) Line | Count | Source | 64 | 29 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 29 | return TyLoc.getLocalDataAlignment(); \ | 66 | 29 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDecayedTypeLoc(clang::DecayedTypeLoc) Line | Count | Source | 64 | 6.11k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 6.11k | return TyLoc.getLocalDataAlignment(); \ | 66 | 6.11k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc) Line | Count | Source | 64 | 550k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 550k | return TyLoc.getLocalDataAlignment(); \ | 66 | 550k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc) Line | Count | Source | 64 | 41.8k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 41.8k | return TyLoc.getLocalDataAlignment(); \ | 66 | 41.8k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc) Line | Count | Source | 64 | 147k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 147k | return TyLoc.getLocalDataAlignment(); \ | 66 | 147k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc) Line | Count | Source | 64 | 47.9k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 47.9k | return TyLoc.getLocalDataAlignment(); \ | 66 | 47.9k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAtomicTypeLoc(clang::AtomicTypeLoc) Line | Count | Source | 64 | 7.59k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 7.59k | return TyLoc.getLocalDataAlignment(); \ | 66 | 7.59k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAttributedTypeLoc(clang::AttributedTypeLoc) Line | Count | Source | 64 | 5.79M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 5.79M | return TyLoc.getLocalDataAlignment(); \ | 66 | 5.79M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc) Line | Count | Source | 64 | 242k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 242k | return TyLoc.getLocalDataAlignment(); \ | 66 | 242k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc) Line | Count | Source | 64 | 32.1M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 32.1M | return TyLoc.getLocalDataAlignment(); \ | 66 | 32.1M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitComplexTypeLoc(clang::ComplexTypeLoc) Line | Count | Source | 64 | 26.0k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 26.0k | return TyLoc.getLocalDataAlignment(); \ | 66 | 26.0k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc) Line | Count | Source | 64 | 493k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 493k | return TyLoc.getLocalDataAlignment(); \ | 66 | 493k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAutoTypeLoc(clang::AutoTypeLoc) Line | Count | Source | 64 | 355k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 355k | return TyLoc.getLocalDataAlignment(); \ | 66 | 355k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc) Line | Count | Source | 64 | 3.62k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 3.62k | return TyLoc.getLocalDataAlignment(); \ | 66 | 3.62k | } |
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::VisitDependentExtIntTypeLoc(clang::DependentExtIntTypeLoc) Line | Count | Source | 64 | 13 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 13 | return TyLoc.getLocalDataAlignment(); \ | 66 | 13 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc) Line | Count | Source | 64 | 5.93M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 5.93M | return TyLoc.getLocalDataAlignment(); \ | 66 | 5.93M | } |
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 | 546k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 546k | return TyLoc.getLocalDataAlignment(); \ | 66 | 546k | } |
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.39M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 5.39M | return TyLoc.getLocalDataAlignment(); \ | 66 | 5.39M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitExtIntTypeLoc(clang::ExtIntTypeLoc) Line | Count | Source | 64 | 1.86k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 1.86k | return TyLoc.getLocalDataAlignment(); \ | 66 | 1.86k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc) Line | Count | Source | 64 | 27.4k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 27.4k | return TyLoc.getLocalDataAlignment(); \ | 66 | 27.4k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc) Line | Count | Source | 64 | 19.8M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 19.8M | return TyLoc.getLocalDataAlignment(); \ | 66 | 19.8M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc) Line | Count | Source | 64 | 3.07M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 3.07M | return TyLoc.getLocalDataAlignment(); \ | 66 | 3.07M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc) Line | Count | Source | 64 | 318k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 318k | return TyLoc.getLocalDataAlignment(); \ | 66 | 318k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc) Line | Count | Source | 64 | 359 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 359 | return TyLoc.getLocalDataAlignment(); \ | 66 | 359 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc) Line | Count | Source | 64 | 389 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 389 | return TyLoc.getLocalDataAlignment(); \ | 66 | 389 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc) Line | Count | Source | 64 | 56.6k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 56.6k | return TyLoc.getLocalDataAlignment(); \ | 66 | 56.6k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc) Line | Count | Source | 64 | 5.15M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 5.15M | return TyLoc.getLocalDataAlignment(); \ | 66 | 5.15M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc) Line | Count | Source | 64 | 1.68M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 1.68M | return TyLoc.getLocalDataAlignment(); \ | 66 | 1.68M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc) Line | Count | Source | 64 | 7.05M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 7.05M | return TyLoc.getLocalDataAlignment(); \ | 66 | 7.05M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc) Line | Count | Source | 64 | 295k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 295k | return TyLoc.getLocalDataAlignment(); \ | 66 | 295k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc) Line | Count | Source | 64 | 597k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 597k | return TyLoc.getLocalDataAlignment(); \ | 66 | 597k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitParenTypeLoc(clang::ParenTypeLoc) Line | Count | Source | 64 | 1.37M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 1.37M | return TyLoc.getLocalDataAlignment(); \ | 66 | 1.37M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPipeTypeLoc(clang::PipeTypeLoc) Line | Count | Source | 64 | 133 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 133 | return TyLoc.getLocalDataAlignment(); \ | 66 | 133 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPointerTypeLoc(clang::PointerTypeLoc) Line | Count | Source | 64 | 9.89M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 9.89M | return TyLoc.getLocalDataAlignment(); \ | 66 | 9.89M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc) Line | Count | Source | 64 | 5.89M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 5.89M | return TyLoc.getLocalDataAlignment(); \ | 66 | 5.89M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc) Line | Count | Source | 64 | 1.51M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 1.51M | return TyLoc.getLocalDataAlignment(); \ | 66 | 1.51M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc) Line | Count | Source | 64 | 98.7k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 98.7k | return TyLoc.getLocalDataAlignment(); \ | 66 | 98.7k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc) Line | Count | Source | 64 | 11.6M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 11.6M | return TyLoc.getLocalDataAlignment(); \ | 66 | 11.6M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitEnumTypeLoc(clang::EnumTypeLoc) Line | Count | Source | 64 | 938k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 938k | return TyLoc.getLocalDataAlignment(); \ | 66 | 938k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRecordTypeLoc(clang::RecordTypeLoc) Line | Count | Source | 64 | 9.66M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 9.66M | return TyLoc.getLocalDataAlignment(); \ | 66 | 9.66M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc) Line | Count | Source | 64 | 21.2M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 21.2M | return TyLoc.getLocalDataAlignment(); \ | 66 | 21.2M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc) Line | Count | Source | 64 | 24.1M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 24.1M | return TyLoc.getLocalDataAlignment(); \ | 66 | 24.1M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc) Line | Count | Source | 64 | 12.5k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 12.5k | return TyLoc.getLocalDataAlignment(); \ | 66 | 12.5k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc) Line | Count | Source | 64 | 119 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 119 | return TyLoc.getLocalDataAlignment(); \ | 66 | 119 | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypedefTypeLoc(clang::TypedefTypeLoc) Line | Count | Source | 64 | 100M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 100M | return TyLoc.getLocalDataAlignment(); \ | 66 | 100M | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc) Line | Count | Source | 64 | 3.42k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 3.42k | return TyLoc.getLocalDataAlignment(); \ | 66 | 3.42k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc) Line | Count | Source | 64 | 2.75k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 2.75k | return TyLoc.getLocalDataAlignment(); \ | 66 | 2.75k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVectorTypeLoc(clang::VectorTypeLoc) Line | Count | Source | 64 | 907k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 907k | return TyLoc.getLocalDataAlignment(); \ | 66 | 907k | } |
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc) Line | Count | Source | 64 | 2.97k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 65 | 2.97k | return TyLoc.getLocalDataAlignment(); \ | 66 | 2.97k | } |
|
67 | | #include "clang/AST/TypeLocNodes.def" |
68 | | }; |
69 | | |
70 | | } // namespace |
71 | | |
72 | | /// Returns the alignment of the type source info data block. |
73 | 295M | unsigned TypeLoc::getLocalAlignmentForType(QualType Ty) { |
74 | 295M | if (Ty.isNull()) return 10 ; |
75 | 295M | return TypeAligner().Visit(TypeLoc(Ty, nullptr)); |
76 | 295M | } |
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 | 183M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ |
85 | 183M | return TyLoc.getLocalDataSize(); \ |
86 | 183M | } TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc) Line | Count | Source | 84 | 6.30M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 6.30M | return TyLoc.getLocalDataSize(); \ | 86 | 6.30M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc) Line | Count | Source | 84 | 11 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 11 | return TyLoc.getLocalDataSize(); \ | 86 | 11 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDecayedTypeLoc(clang::DecayedTypeLoc) Line | Count | Source | 84 | 5.69k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 5.69k | return TyLoc.getLocalDataSize(); \ | 86 | 5.69k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc) Line | Count | Source | 84 | 419k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 419k | return TyLoc.getLocalDataSize(); \ | 86 | 419k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc) Line | Count | Source | 84 | 29.1k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 29.1k | return TyLoc.getLocalDataSize(); \ | 86 | 29.1k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc) Line | Count | Source | 84 | 78.7k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 78.7k | return TyLoc.getLocalDataSize(); \ | 86 | 78.7k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc) Line | Count | Source | 84 | 19.2k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 19.2k | return TyLoc.getLocalDataSize(); \ | 86 | 19.2k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAtomicTypeLoc(clang::AtomicTypeLoc) Line | Count | Source | 84 | 6.87k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 6.87k | return TyLoc.getLocalDataSize(); \ | 86 | 6.87k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAttributedTypeLoc(clang::AttributedTypeLoc) Line | Count | Source | 84 | 4.25M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 4.25M | return TyLoc.getLocalDataSize(); \ | 86 | 4.25M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc) Line | Count | Source | 84 | 78.9k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 78.9k | return TyLoc.getLocalDataSize(); \ | 86 | 78.9k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc) Line | Count | Source | 84 | 13.9M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 13.9M | return TyLoc.getLocalDataSize(); \ | 86 | 13.9M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitComplexTypeLoc(clang::ComplexTypeLoc) Line | Count | Source | 84 | 11.4k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 11.4k | return TyLoc.getLocalDataSize(); \ | 86 | 11.4k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc) Line | Count | Source | 84 | 355k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 355k | return TyLoc.getLocalDataSize(); \ | 86 | 355k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAutoTypeLoc(clang::AutoTypeLoc) Line | Count | Source | 84 | 219k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 219k | return TyLoc.getLocalDataSize(); \ | 86 | 219k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc) Line | Count | Source | 84 | 2.94k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 2.94k | return TyLoc.getLocalDataSize(); \ | 86 | 2.94k | } |
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::VisitDependentExtIntTypeLoc(clang::DependentExtIntTypeLoc) Line | Count | Source | 84 | 13 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 13 | return TyLoc.getLocalDataSize(); \ | 86 | 13 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc) Line | Count | Source | 84 | 4.60M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 4.60M | return TyLoc.getLocalDataSize(); \ | 86 | 4.60M | } |
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 | 536k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 536k | return TyLoc.getLocalDataSize(); \ | 86 | 536k | } |
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 | 3.97M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 3.97M | return TyLoc.getLocalDataSize(); \ | 86 | 3.97M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitExtIntTypeLoc(clang::ExtIntTypeLoc) Line | Count | Source | 84 | 926 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 926 | return TyLoc.getLocalDataSize(); \ | 86 | 926 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc) Line | Count | Source | 84 | 25.8k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 25.8k | return TyLoc.getLocalDataSize(); \ | 86 | 25.8k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc) Line | Count | Source | 84 | 18.6M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 18.6M | return TyLoc.getLocalDataSize(); \ | 86 | 18.6M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc) Line | Count | Source | 84 | 1.21M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 1.21M | return TyLoc.getLocalDataSize(); \ | 86 | 1.21M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc) Line | Count | Source | 84 | 316k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 316k | return TyLoc.getLocalDataSize(); \ | 86 | 316k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc) Line | Count | Source | 84 | 359 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 359 | return TyLoc.getLocalDataSize(); \ | 86 | 359 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc) Line | Count | Source | 84 | 389 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 389 | return TyLoc.getLocalDataSize(); \ | 86 | 389 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc) Line | Count | Source | 84 | 51.0k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 51.0k | return TyLoc.getLocalDataSize(); \ | 86 | 51.0k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc) Line | Count | Source | 84 | 1.68M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 1.68M | return TyLoc.getLocalDataSize(); \ | 86 | 1.68M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc) Line | Count | Source | 84 | 1.02M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 1.02M | return TyLoc.getLocalDataSize(); \ | 86 | 1.02M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc) Line | Count | Source | 84 | 2.50M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 2.50M | return TyLoc.getLocalDataSize(); \ | 86 | 2.50M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc) Line | Count | Source | 84 | 176k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 176k | return TyLoc.getLocalDataSize(); \ | 86 | 176k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc) Line | Count | Source | 84 | 597k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 597k | return TyLoc.getLocalDataSize(); \ | 86 | 597k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitParenTypeLoc(clang::ParenTypeLoc) Line | Count | Source | 84 | 398k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 398k | return TyLoc.getLocalDataSize(); \ | 86 | 398k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPipeTypeLoc(clang::PipeTypeLoc) Line | Count | Source | 84 | 129 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 129 | return TyLoc.getLocalDataSize(); \ | 86 | 129 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPointerTypeLoc(clang::PointerTypeLoc) Line | Count | Source | 84 | 7.01M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 7.01M | return TyLoc.getLocalDataSize(); \ | 86 | 7.01M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc) Line | Count | Source | 84 | 4.13M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 4.13M | return TyLoc.getLocalDataSize(); \ | 86 | 4.13M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc) Line | Count | Source | 84 | 1.08M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 1.08M | return TyLoc.getLocalDataSize(); \ | 86 | 1.08M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc) Line | Count | Source | 84 | 98.3k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 98.3k | return TyLoc.getLocalDataSize(); \ | 86 | 98.3k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc) Line | Count | Source | 84 | 9.76M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 9.76M | return TyLoc.getLocalDataSize(); \ | 86 | 9.76M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitEnumTypeLoc(clang::EnumTypeLoc) Line | Count | Source | 84 | 336k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 336k | return TyLoc.getLocalDataSize(); \ | 86 | 336k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitRecordTypeLoc(clang::RecordTypeLoc) Line | Count | Source | 84 | 4.50M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 4.50M | return TyLoc.getLocalDataSize(); \ | 86 | 4.50M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc) Line | Count | Source | 84 | 18.0M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 18.0M | return TyLoc.getLocalDataSize(); \ | 86 | 18.0M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc) Line | Count | Source | 84 | 16.1M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 16.1M | return TyLoc.getLocalDataSize(); \ | 86 | 16.1M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc) Line | Count | Source | 84 | 4.15k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 4.15k | return TyLoc.getLocalDataSize(); \ | 86 | 4.15k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc) Line | Count | Source | 84 | 111 | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 111 | return TyLoc.getLocalDataSize(); \ | 86 | 111 | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypedefTypeLoc(clang::TypedefTypeLoc) Line | Count | Source | 84 | 60.4M | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 60.4M | return TyLoc.getLocalDataSize(); \ | 86 | 60.4M | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc) Line | Count | Source | 84 | 3.41k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 3.41k | return TyLoc.getLocalDataSize(); \ | 86 | 3.41k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc) Line | Count | Source | 84 | 2.48k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 2.48k | return TyLoc.getLocalDataSize(); \ | 86 | 2.48k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVectorTypeLoc(clang::VectorTypeLoc) Line | Count | Source | 84 | 632k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 632k | return TyLoc.getLocalDataSize(); \ | 86 | 632k | } |
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc) Line | Count | Source | 84 | 2.97k | unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 85 | 2.97k | return TyLoc.getLocalDataSize(); \ | 86 | 2.97k | } |
|
87 | | #include "clang/AST/TypeLocNodes.def" |
88 | | }; |
89 | | |
90 | | } // namespace |
91 | | |
92 | | /// Returns the size of the type source info data block. |
93 | 132M | unsigned TypeLoc::getFullDataSizeForType(QualType Ty) { |
94 | 132M | unsigned Total = 0; |
95 | 132M | TypeLoc TyLoc(Ty, nullptr); |
96 | 132M | unsigned MaxAlign = 1; |
97 | 316M | while (!TyLoc.isNull()) { |
98 | 183M | unsigned Align = getLocalAlignmentForType(TyLoc.getType()); |
99 | 183M | MaxAlign = std::max(Align, MaxAlign); |
100 | 183M | Total = llvm::alignTo(Total, Align); |
101 | 183M | Total += TypeSizer().Visit(TyLoc); |
102 | 183M | TyLoc = TyLoc.getNextTypeLoc(); |
103 | 183M | } |
104 | 132M | Total = llvm::alignTo(Total, MaxAlign); |
105 | 132M | return Total; |
106 | 132M | } |
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 | 347M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ |
115 | 347M | return TyLoc.getNextTypeLoc(); \ |
116 | 347M | } TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc) Line | Count | Source | 114 | 9.10M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 9.10M | return TyLoc.getNextTypeLoc(); \ | 116 | 9.10M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc) Line | Count | Source | 114 | 14 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 14 | return TyLoc.getNextTypeLoc(); \ | 116 | 14 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDecayedTypeLoc(clang::DecayedTypeLoc) Line | Count | Source | 114 | 8.11k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 8.11k | return TyLoc.getNextTypeLoc(); \ | 116 | 8.11k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc) Line | Count | Source | 114 | 758k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 758k | return TyLoc.getNextTypeLoc(); \ | 116 | 758k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc) Line | Count | Source | 114 | 70.9k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 70.9k | return TyLoc.getNextTypeLoc(); \ | 116 | 70.9k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc) Line | Count | Source | 114 | 192k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 192k | return TyLoc.getNextTypeLoc(); \ | 116 | 192k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc) Line | Count | Source | 114 | 34.0k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 34.0k | return TyLoc.getNextTypeLoc(); \ | 116 | 34.0k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAtomicTypeLoc(clang::AtomicTypeLoc) Line | Count | Source | 114 | 9.41k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 9.41k | return TyLoc.getNextTypeLoc(); \ | 116 | 9.41k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAttributedTypeLoc(clang::AttributedTypeLoc) Line | Count | Source | 114 | 5.41M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 5.41M | return TyLoc.getNextTypeLoc(); \ | 116 | 5.41M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc) Line | Count | Source | 114 | 203k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 203k | return TyLoc.getNextTypeLoc(); \ | 116 | 203k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc) Line | Count | Source | 114 | 20.2M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 20.2M | return TyLoc.getNextTypeLoc(); \ | 116 | 20.2M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitComplexTypeLoc(clang::ComplexTypeLoc) Line | Count | Source | 114 | 20.7k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 20.7k | return TyLoc.getNextTypeLoc(); \ | 116 | 20.7k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc) Line | Count | Source | 114 | 617k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 617k | return TyLoc.getNextTypeLoc(); \ | 116 | 617k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAutoTypeLoc(clang::AutoTypeLoc) Line | Count | Source | 114 | 290k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 290k | return TyLoc.getNextTypeLoc(); \ | 116 | 290k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc) Line | Count | Source | 114 | 7.66k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 7.66k | return TyLoc.getNextTypeLoc(); \ | 116 | 7.66k | } |
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::VisitDependentExtIntTypeLoc(clang::DependentExtIntTypeLoc) Line | Count | Source | 114 | 22 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 22 | return TyLoc.getNextTypeLoc(); \ | 116 | 22 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc) Line | Count | Source | 114 | 7.20M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 7.20M | return TyLoc.getNextTypeLoc(); \ | 116 | 7.20M | } |
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 | 811k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 811k | return TyLoc.getNextTypeLoc(); \ | 116 | 811k | } |
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 | 5.50M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 5.50M | return TyLoc.getNextTypeLoc(); \ | 116 | 5.50M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitExtIntTypeLoc(clang::ExtIntTypeLoc) Line | Count | Source | 114 | 1.46k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 1.46k | return TyLoc.getNextTypeLoc(); \ | 116 | 1.46k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc) Line | Count | Source | 114 | 79.3k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 79.3k | return TyLoc.getNextTypeLoc(); \ | 116 | 79.3k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc) Line | Count | Source | 114 | 39.0M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 39.0M | return TyLoc.getNextTypeLoc(); \ | 116 | 39.0M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc) Line | Count | Source | 114 | 2.25M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 2.25M | return TyLoc.getNextTypeLoc(); \ | 116 | 2.25M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc) Line | Count | Source | 114 | 325k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 325k | return TyLoc.getNextTypeLoc(); \ | 116 | 325k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc) Line | Count | Source | 114 | 509 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 509 | return TyLoc.getNextTypeLoc(); \ | 116 | 509 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc) Line | Count | Source | 114 | 601 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 601 | return TyLoc.getNextTypeLoc(); \ | 116 | 601 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc) Line | Count | Source | 114 | 177k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 177k | return TyLoc.getNextTypeLoc(); \ | 116 | 177k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc) Line | Count | Source | 114 | 3.96M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 3.96M | return TyLoc.getNextTypeLoc(); \ | 116 | 3.96M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc) Line | Count | Source | 114 | 1.11M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 1.11M | return TyLoc.getNextTypeLoc(); \ | 116 | 1.11M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc) Line | Count | Source | 114 | 3.45M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 3.45M | return TyLoc.getNextTypeLoc(); \ | 116 | 3.45M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc) Line | Count | Source | 114 | 209k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 209k | return TyLoc.getNextTypeLoc(); \ | 116 | 209k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc) Line | Count | Source | 114 | 1.20M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 1.20M | return TyLoc.getNextTypeLoc(); \ | 116 | 1.20M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitParenTypeLoc(clang::ParenTypeLoc) Line | Count | Source | 114 | 942k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 942k | return TyLoc.getNextTypeLoc(); \ | 116 | 942k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPipeTypeLoc(clang::PipeTypeLoc) Line | Count | Source | 114 | 273 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 273 | return TyLoc.getNextTypeLoc(); \ | 116 | 273 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPointerTypeLoc(clang::PointerTypeLoc) Line | Count | Source | 114 | 14.7M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 14.7M | return TyLoc.getNextTypeLoc(); \ | 116 | 14.7M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc) Line | Count | Source | 114 | 7.94M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 7.94M | return TyLoc.getNextTypeLoc(); \ | 116 | 7.94M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc) Line | Count | Source | 114 | 2.04M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 2.04M | return TyLoc.getNextTypeLoc(); \ | 116 | 2.04M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc) Line | Count | Source | 114 | 147k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 147k | return TyLoc.getNextTypeLoc(); \ | 116 | 147k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc) Line | Count | Source | 114 | 20.4M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 20.4M | return TyLoc.getNextTypeLoc(); \ | 116 | 20.4M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitEnumTypeLoc(clang::EnumTypeLoc) Line | Count | Source | 114 | 524k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 524k | return TyLoc.getNextTypeLoc(); \ | 116 | 524k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitRecordTypeLoc(clang::RecordTypeLoc) Line | Count | Source | 114 | 10.5M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 10.5M | return TyLoc.getNextTypeLoc(); \ | 116 | 10.5M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc) Line | Count | Source | 114 | 74.4M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 74.4M | return TyLoc.getNextTypeLoc(); \ | 116 | 74.4M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc) Line | Count | Source | 114 | 33.7M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 33.7M | return TyLoc.getNextTypeLoc(); \ | 116 | 33.7M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc) Line | Count | Source | 114 | 7.66k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 7.66k | return TyLoc.getNextTypeLoc(); \ | 116 | 7.66k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc) Line | Count | Source | 114 | 177 | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 177 | return TyLoc.getNextTypeLoc(); \ | 116 | 177 | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypedefTypeLoc(clang::TypedefTypeLoc) Line | Count | Source | 114 | 78.9M | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 78.9M | return TyLoc.getNextTypeLoc(); \ | 116 | 78.9M | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc) Line | Count | Source | 114 | 5.48k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 5.48k | return TyLoc.getNextTypeLoc(); \ | 116 | 5.48k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc) Line | Count | Source | 114 | 4.73k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 4.73k | return TyLoc.getNextTypeLoc(); \ | 116 | 4.73k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVectorTypeLoc(clang::VectorTypeLoc) Line | Count | Source | 114 | 796k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 796k | return TyLoc.getNextTypeLoc(); \ | 116 | 796k | } |
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc) Line | Count | Source | 114 | 3.64k | TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 115 | 3.64k | return TyLoc.getNextTypeLoc(); \ | 116 | 3.64k | } |
|
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 | 347M | TypeLoc TypeLoc::getNextTypeLocImpl(TypeLoc TL) { |
125 | 347M | return NextLoc().Visit(TL); |
126 | 347M | } |
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 | 13.4M | SourceLocation Loc) { |
133 | 16.2M | while (true16.2M ) { |
134 | 16.2M | switch (TL.getTypeLocClass()) { |
135 | 0 | #define ABSTRACT_TYPELOC(CLASS, PARENT) |
136 | 0 | #define TYPELOC(CLASS, PARENT) \ |
137 | 2.79M | case CLASS: { \ |
138 | 2.79M | CLASS##TypeLoc TLCasted = TL.castAs<CLASS##TypeLoc>(); \ |
139 | 2.79M | TLCasted.initializeLocal(Context, Loc); \ |
140 | 2.79M | TL = TLCasted.getNextTypeLoc(); \ |
141 | 16.2M | if (!TL) return13.4M ; \ |
142 | 2.68k | continue; \ |
143 | 2.79M | } |
144 | 0 | #include "clang/AST/TypeLocNodes.def" |
145 | 16.2M | } |
146 | 16.2M | } |
147 | 13.4M | } |
148 | | |
149 | | namespace { |
150 | | |
151 | | class TypeLocCopier : public TypeLocVisitor<TypeLocCopier> { |
152 | | TypeLoc Source; |
153 | | |
154 | | public: |
155 | 2.08k | TypeLocCopier(TypeLoc source) : Source(source) {} |
156 | | |
157 | | #define ABSTRACT_TYPELOC(CLASS, PARENT) |
158 | | #define TYPELOC(CLASS, PARENT) \ |
159 | 2.08k | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ |
160 | 2.08k | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ |
161 | 2.08k | } 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::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc) TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc) Line | Count | Source | 159 | 685 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 685 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 685 | } |
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::VisitDependentExtIntTypeLoc(clang::DependentExtIntTypeLoc) 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::VisitExtIntTypeLoc(clang::ExtIntTypeLoc) 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 | 26 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 26 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 26 | } |
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 | 51 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 51 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 51 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc) TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc) Line | Count | Source | 159 | 405 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 405 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 405 | } |
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 | 864 | void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) { \ | 160 | 864 | dest.copyLocal(Source.castAs<CLASS##TypeLoc>()); \ | 161 | 864 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc) 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 | 228k | void TypeLoc::copy(TypeLoc other) { |
168 | 228k | 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 | 228k | if (reinterpret_cast<uintptr_t>(Data) == |
174 | 228k | llvm::alignTo(reinterpret_cast<uintptr_t>(Data), |
175 | 228k | TypeLocMaxDataAlign) && |
176 | 226k | reinterpret_cast<uintptr_t>(other.Data) == |
177 | 226k | llvm::alignTo(reinterpret_cast<uintptr_t>(other.Data), |
178 | 226k | TypeLocMaxDataAlign)) { |
179 | 226k | memcpy(Data, other.Data, getFullDataSize()); |
180 | 226k | return; |
181 | 226k | } |
182 | | |
183 | | // Copy each of the pieces. |
184 | 2.01k | TypeLoc TL(getType(), Data); |
185 | 2.08k | do { |
186 | 2.08k | TypeLocCopier(other).Visit(TL); |
187 | 2.08k | other = other.getNextTypeLoc(); |
188 | 2.08k | } while ((TL = TL.getNextTypeLoc())); |
189 | 2.01k | } |
190 | | |
191 | 96.2M | SourceLocation TypeLoc::getBeginLoc() const { |
192 | 96.2M | TypeLoc Cur = *this; |
193 | 96.2M | TypeLoc LeftMost = Cur; |
194 | 106M | while (true106M ) { |
195 | 106M | switch (Cur.getTypeLocClass()) { |
196 | 640k | case Elaborated: |
197 | 640k | LeftMost = Cur; |
198 | 640k | break; |
199 | 3.15M | case FunctionProto: |
200 | 3.15M | if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr() |
201 | 20.3k | ->hasTrailingReturn()) { |
202 | 20.3k | LeftMost = Cur; |
203 | 20.3k | break; |
204 | 20.3k | } |
205 | 3.13M | LLVM_FALLTHROUGH; |
206 | 3.16M | case FunctionNoProto: |
207 | 3.17M | case ConstantArray: |
208 | 3.19M | case DependentSizedArray: |
209 | 3.22M | case IncompleteArray: |
210 | 3.22M | case VariableArray: |
211 | | // FIXME: Currently QualifiedTypeLoc does not have a source range |
212 | 4.94M | case Qualified: |
213 | 4.94M | Cur = Cur.getNextTypeLoc(); |
214 | 4.94M | continue; |
215 | 100M | default: |
216 | 100M | if (Cur.getLocalSourceRange().getBegin().isValid()) |
217 | 99.9M | LeftMost = Cur; |
218 | 100M | Cur = Cur.getNextTypeLoc(); |
219 | 100M | if (Cur.isNull()) |
220 | 95.5M | break; |
221 | 5.09M | continue; |
222 | 96.2M | } // switch |
223 | 96.2M | break; |
224 | 96.2M | } // while |
225 | 96.2M | return LeftMost.getLocalSourceRange().getBegin(); |
226 | 96.2M | } |
227 | | |
228 | 15.2M | SourceLocation TypeLoc::getEndLoc() const { |
229 | 15.2M | TypeLoc Cur = *this; |
230 | 15.2M | TypeLoc Last; |
231 | 17.4M | while (true) { |
232 | 17.4M | switch (Cur.getTypeLocClass()) { |
233 | 15.2M | default: |
234 | 15.2M | if (!Last) |
235 | 13.8M | Last = Cur; |
236 | 15.2M | return Last.getLocalSourceRange().getEnd(); |
237 | 28.8k | case Paren: |
238 | 32.2k | case ConstantArray: |
239 | 38.3k | case DependentSizedArray: |
240 | 52.3k | case IncompleteArray: |
241 | 52.4k | case VariableArray: |
242 | 52.6k | case FunctionNoProto: |
243 | 52.6k | Last = Cur; |
244 | 52.6k | break; |
245 | 491k | case FunctionProto: |
246 | 491k | if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr()->hasTrailingReturn()) |
247 | 4.39k | Last = TypeLoc(); |
248 | 487k | else |
249 | 487k | Last = Cur; |
250 | 491k | break; |
251 | 510k | case Pointer: |
252 | 511k | case BlockPointer: |
253 | 548k | case MemberPointer: |
254 | 754k | case LValueReference: |
255 | 826k | case RValueReference: |
256 | 959k | case PackExpansion: |
257 | 959k | if (!Last) |
258 | 868k | Last = Cur; |
259 | 959k | break; |
260 | 296k | case Qualified: |
261 | 702k | case Elaborated: |
262 | 702k | break; |
263 | 2.20M | } |
264 | 2.20M | Cur = Cur.getNextTypeLoc(); |
265 | 2.20M | } |
266 | 15.2M | } |
267 | | |
268 | | namespace { |
269 | | |
270 | | struct TSTChecker : public TypeLocVisitor<TSTChecker, bool> { |
271 | | // Overload resolution does the real work for us. |
272 | 1.35M | static bool isTypeSpec(TypeSpecTypeLoc _) { return true; } |
273 | 0 | static bool isTypeSpec(TypeLoc _) { return false; } |
274 | | |
275 | | #define ABSTRACT_TYPELOC(CLASS, PARENT) |
276 | | #define TYPELOC(CLASS, PARENT) \ |
277 | 1.35M | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ |
278 | 1.35M | return isTypeSpec(TyLoc); \ |
279 | 1.35M | } 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::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 | 277 | 61 | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 278 | 61 | return isTypeSpec(TyLoc); \ | 279 | 61 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentExtIntTypeLoc(clang::DependentExtIntTypeLoc) 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::VisitExtIntTypeLoc(clang::ExtIntTypeLoc) 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 | 277 | 6.62k | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 278 | 6.62k | return isTypeSpec(TyLoc); \ | 279 | 6.62k | } |
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 | 277 | 10.0k | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 278 | 10.0k | return isTypeSpec(TyLoc); \ | 279 | 10.0k | } |
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitRecordTypeLoc(clang::RecordTypeLoc) Line | Count | Source | 277 | 557k | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 278 | 557k | return isTypeSpec(TyLoc); \ | 279 | 557k | } |
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 | 277 | 780k | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 278 | 780k | return isTypeSpec(TyLoc); \ | 279 | 780k | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc) TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc) Line | Count | Source | 277 | 176 | bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \ | 278 | 176 | return isTypeSpec(TyLoc); \ | 279 | 176 | } |
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitVectorTypeLoc(clang::VectorTypeLoc) Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc) |
280 | | #include "clang/AST/TypeLocNodes.def" |
281 | | }; |
282 | | |
283 | | } // namespace |
284 | | |
285 | | /// Determines if the given type loc corresponds to a |
286 | | /// TypeSpecTypeLoc. Since there is not actually a TypeSpecType in |
287 | | /// the type hierarchy, this is made somewhat complicated. |
288 | | /// |
289 | | /// There are a lot of types that currently use TypeSpecTypeLoc |
290 | | /// because it's a convenient base class. Ideally we would not accept |
291 | | /// those here, but ideally we would have better implementations for |
292 | | /// them. |
293 | 1.35M | bool TypeSpecTypeLoc::isKind(const TypeLoc &TL) { |
294 | 1.35M | if (TL.getType().hasLocalQualifiers()) return false0 ; |
295 | 1.35M | return TSTChecker().Visit(TL); |
296 | 1.35M | } |
297 | | |
298 | 773 | bool TagTypeLoc::isDefinition() const { |
299 | 773 | TagDecl *D = getDecl(); |
300 | 773 | return D->isCompleteDefinition() && |
301 | 723 | (D->getIdentifier() == nullptr || D->getLocation() == getNameLoc()686 ); |
302 | 773 | } |
303 | | |
304 | | // Reimplemented to account for GNU/C++ extension |
305 | | // typeof unary-expression |
306 | | // where there are no parentheses. |
307 | 6.62k | SourceRange TypeOfExprTypeLoc::getLocalSourceRange() const { |
308 | 6.62k | if (getRParenLoc().isValid()) |
309 | 6.62k | return SourceRange(getTypeofLoc(), getRParenLoc()); |
310 | 0 | else |
311 | 0 | return SourceRange(getTypeofLoc(), |
312 | 0 | getUnderlyingExpr()->getSourceRange().getEnd()); |
313 | 6.62k | } |
314 | | |
315 | | |
316 | 317k | TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const { |
317 | 317k | if (needsExtraLocalData()) |
318 | 317k | return static_cast<TypeSpecifierType>(getWrittenBuiltinSpecs().Type); |
319 | 0 | switch (getTypePtr()->getKind()) { |
320 | 0 | case BuiltinType::Void: |
321 | 0 | return TST_void; |
322 | 0 | case BuiltinType::Bool: |
323 | 0 | return TST_bool; |
324 | 0 | case BuiltinType::Char_U: |
325 | 0 | case BuiltinType::Char_S: |
326 | 0 | return TST_char; |
327 | 0 | case BuiltinType::Char8: |
328 | 0 | return TST_char8; |
329 | 0 | case BuiltinType::Char16: |
330 | 0 | return TST_char16; |
331 | 0 | case BuiltinType::Char32: |
332 | 0 | return TST_char32; |
333 | 0 | case BuiltinType::WChar_S: |
334 | 0 | case BuiltinType::WChar_U: |
335 | 0 | return TST_wchar; |
336 | 0 | case BuiltinType::UChar: |
337 | 0 | case BuiltinType::UShort: |
338 | 0 | case BuiltinType::UInt: |
339 | 0 | case BuiltinType::ULong: |
340 | 0 | case BuiltinType::ULongLong: |
341 | 0 | case BuiltinType::UInt128: |
342 | 0 | case BuiltinType::SChar: |
343 | 0 | case BuiltinType::Short: |
344 | 0 | case BuiltinType::Int: |
345 | 0 | case BuiltinType::Long: |
346 | 0 | case BuiltinType::LongLong: |
347 | 0 | case BuiltinType::Int128: |
348 | 0 | case BuiltinType::Half: |
349 | 0 | case BuiltinType::Float: |
350 | 0 | case BuiltinType::Double: |
351 | 0 | case BuiltinType::LongDouble: |
352 | 0 | case BuiltinType::Float16: |
353 | 0 | case BuiltinType::Float128: |
354 | 0 | case BuiltinType::ShortAccum: |
355 | 0 | case BuiltinType::Accum: |
356 | 0 | case BuiltinType::LongAccum: |
357 | 0 | case BuiltinType::UShortAccum: |
358 | 0 | case BuiltinType::UAccum: |
359 | 0 | case BuiltinType::ULongAccum: |
360 | 0 | case BuiltinType::ShortFract: |
361 | 0 | case BuiltinType::Fract: |
362 | 0 | case BuiltinType::LongFract: |
363 | 0 | case BuiltinType::UShortFract: |
364 | 0 | case BuiltinType::UFract: |
365 | 0 | case BuiltinType::ULongFract: |
366 | 0 | case BuiltinType::SatShortAccum: |
367 | 0 | case BuiltinType::SatAccum: |
368 | 0 | case BuiltinType::SatLongAccum: |
369 | 0 | case BuiltinType::SatUShortAccum: |
370 | 0 | case BuiltinType::SatUAccum: |
371 | 0 | case BuiltinType::SatULongAccum: |
372 | 0 | case BuiltinType::SatShortFract: |
373 | 0 | case BuiltinType::SatFract: |
374 | 0 | case BuiltinType::SatLongFract: |
375 | 0 | case BuiltinType::SatUShortFract: |
376 | 0 | case BuiltinType::SatUFract: |
377 | 0 | case BuiltinType::SatULongFract: |
378 | 0 | case BuiltinType::BFloat16: |
379 | 0 | llvm_unreachable("Builtin type needs extra local data!"); |
380 | | // Fall through, if the impossible happens. |
381 | |
|
382 | 0 | case BuiltinType::NullPtr: |
383 | 0 | case BuiltinType::Overload: |
384 | 0 | case BuiltinType::Dependent: |
385 | 0 | case BuiltinType::BoundMember: |
386 | 0 | case BuiltinType::UnknownAny: |
387 | 0 | case BuiltinType::ARCUnbridgedCast: |
388 | 0 | case BuiltinType::PseudoObject: |
389 | 0 | case BuiltinType::ObjCId: |
390 | 0 | case BuiltinType::ObjCClass: |
391 | 0 | case BuiltinType::ObjCSel: |
392 | 0 | #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ |
393 | 0 | case BuiltinType::Id: |
394 | 0 | #include "clang/Basic/OpenCLImageTypes.def" |
395 | 0 | #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \ |
396 | 0 | case BuiltinType::Id: |
397 | 0 | #include "clang/Basic/OpenCLExtensionTypes.def" |
398 | 0 | case BuiltinType::OCLSampler: |
399 | 0 | case BuiltinType::OCLEvent: |
400 | 0 | case BuiltinType::OCLClkEvent: |
401 | 0 | case BuiltinType::OCLQueue: |
402 | 0 | case BuiltinType::OCLReserveID: |
403 | 0 | #define SVE_TYPE(Name, Id, SingletonId) \ |
404 | 0 | case BuiltinType::Id: |
405 | 0 | #include "clang/Basic/AArch64SVEACLETypes.def" |
406 | 0 | #define PPC_VECTOR_TYPE(Name, Id, Size) \ |
407 | 0 | case BuiltinType::Id: |
408 | 0 | #include "clang/Basic/PPCTypes.def" |
409 | 0 | case BuiltinType::BuiltinFn: |
410 | 0 | case BuiltinType::IncompleteMatrixIdx: |
411 | 0 | case BuiltinType::OMPArraySection: |
412 | 0 | case BuiltinType::OMPArrayShaping: |
413 | 0 | case BuiltinType::OMPIterator: |
414 | 0 | return TST_unspecified; |
415 | 0 | } |
416 | | |
417 | 0 | llvm_unreachable("Invalid BuiltinType Kind!"); |
418 | 0 | } |
419 | | |
420 | 162 | TypeLoc TypeLoc::IgnoreParensImpl(TypeLoc TL) { |
421 | 324 | while (ParenTypeLoc PTL = TL.getAs<ParenTypeLoc>()) |
422 | 162 | TL = PTL.getInnerLoc(); |
423 | 162 | return TL; |
424 | 162 | } |
425 | | |
426 | 25 | SourceLocation TypeLoc::findNullabilityLoc() const { |
427 | 25 | if (auto ATL = getAs<AttributedTypeLoc>()) { |
428 | 25 | const Attr *A = ATL.getAttr(); |
429 | 25 | if (A && (isa<TypeNullableAttr>(A) || isa<TypeNonNullAttr>(A) || |
430 | 0 | isa<TypeNullUnspecifiedAttr>(A))) |
431 | 25 | return A->getLocation(); |
432 | 0 | } |
433 | | |
434 | 0 | return {}; |
435 | 0 | } |
436 | | |
437 | 210k | TypeLoc TypeLoc::findExplicitQualifierLoc() const { |
438 | | // Qualified types. |
439 | 210k | if (auto qual = getAs<QualifiedTypeLoc>()) |
440 | 9 | return qual; |
441 | | |
442 | 210k | TypeLoc loc = IgnoreParens(); |
443 | | |
444 | | // Attributed types. |
445 | 210k | if (auto attr = loc.getAs<AttributedTypeLoc>()) { |
446 | 23 | if (attr.isQualifier()) return attr; |
447 | 0 | return attr.getModifiedLoc().findExplicitQualifierLoc(); |
448 | 0 | } |
449 | | |
450 | | // C11 _Atomic types. |
451 | 210k | if (auto atomic = loc.getAs<AtomicTypeLoc>()) { |
452 | 0 | return atomic; |
453 | 0 | } |
454 | | |
455 | 210k | return {}; |
456 | 210k | } |
457 | | |
458 | | void ObjCTypeParamTypeLoc::initializeLocal(ASTContext &Context, |
459 | 173k | SourceLocation Loc) { |
460 | 173k | setNameLoc(Loc); |
461 | 173k | if (!getNumProtocols()) return170k ; |
462 | | |
463 | 2.33k | setProtocolLAngleLoc(Loc); |
464 | 2.33k | setProtocolRAngleLoc(Loc); |
465 | 4.67k | for (unsigned i = 0, e = getNumProtocols(); i != e; ++i2.33k ) |
466 | 2.33k | setProtocolLoc(i, Loc); |
467 | 2.33k | } |
468 | | |
469 | | void ObjCObjectTypeLoc::initializeLocal(ASTContext &Context, |
470 | 51.0k | SourceLocation Loc) { |
471 | 51.0k | setHasBaseTypeAsWritten(true); |
472 | 51.0k | setTypeArgsLAngleLoc(Loc); |
473 | 51.0k | setTypeArgsRAngleLoc(Loc); |
474 | 51.2k | for (unsigned i = 0, e = getNumTypeArgs(); i != e; ++i169 ) { |
475 | 169 | setTypeArgTInfo(i, |
476 | 169 | Context.getTrivialTypeSourceInfo( |
477 | 169 | getTypePtr()->getTypeArgsAsWritten()[i], Loc)); |
478 | 169 | } |
479 | 51.0k | setProtocolLAngleLoc(Loc); |
480 | 51.0k | setProtocolRAngleLoc(Loc); |
481 | 51.0k | for (unsigned i = 0, e = getNumProtocols(); i != e; ++i11 ) |
482 | 11 | setProtocolLoc(i, Loc); |
483 | 51.0k | } |
484 | | |
485 | 1.01M | SourceRange AttributedTypeLoc::getLocalSourceRange() const { |
486 | | // Note that this does *not* include the range of the attribute |
487 | | // enclosure, e.g.: |
488 | | // __attribute__((foo(bar))) |
489 | | // ^~~~~~~~~~~~~~~ ~~ |
490 | | // or |
491 | | // [[foo(bar)]] |
492 | | // ^~ ~~ |
493 | | // That enclosure doesn't necessarily belong to a single attribute |
494 | | // anyway. |
495 | 1.01M | return getAttr() ? getAttr()->getRange() : SourceRange()78 ; |
496 | 1.01M | } |
497 | | |
498 | | void TypeOfTypeLoc::initializeLocal(ASTContext &Context, |
499 | 2 | SourceLocation Loc) { |
500 | 2 | TypeofLikeTypeLoc<TypeOfTypeLoc, TypeOfType, TypeOfTypeLocInfo> |
501 | 2 | ::initializeLocal(Context, Loc); |
502 | 2 | this->getLocalData()->UnderlyingTInfo = Context.getTrivialTypeSourceInfo( |
503 | 2 | getUnderlyingType(), Loc); |
504 | 2 | } |
505 | | |
506 | | void UnaryTransformTypeLoc::initializeLocal(ASTContext &Context, |
507 | 93 | SourceLocation Loc) { |
508 | 93 | setKWLoc(Loc); |
509 | 93 | setRParenLoc(Loc); |
510 | 93 | setLParenLoc(Loc); |
511 | 93 | this->setUnderlyingTInfo( |
512 | 93 | Context.getTrivialTypeSourceInfo(getTypePtr()->getBaseType(), Loc)); |
513 | 93 | } |
514 | | |
515 | | void ElaboratedTypeLoc::initializeLocal(ASTContext &Context, |
516 | 56.4k | SourceLocation Loc) { |
517 | 56.4k | setElaboratedKeywordLoc(Loc); |
518 | 56.4k | NestedNameSpecifierLocBuilder Builder; |
519 | 56.4k | Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc); |
520 | 56.4k | setQualifierLoc(Builder.getWithLocInContext(Context)); |
521 | 56.4k | } |
522 | | |
523 | | void DependentNameTypeLoc::initializeLocal(ASTContext &Context, |
524 | 295k | SourceLocation Loc) { |
525 | 295k | setElaboratedKeywordLoc(Loc); |
526 | 295k | NestedNameSpecifierLocBuilder Builder; |
527 | 295k | Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc); |
528 | 295k | setQualifierLoc(Builder.getWithLocInContext(Context)); |
529 | 295k | setNameLoc(Loc); |
530 | 295k | } |
531 | | |
532 | | void |
533 | | DependentTemplateSpecializationTypeLoc::initializeLocal(ASTContext &Context, |
534 | 136k | SourceLocation Loc) { |
535 | 136k | setElaboratedKeywordLoc(Loc); |
536 | 136k | if (getTypePtr()->getQualifier()) { |
537 | 136k | NestedNameSpecifierLocBuilder Builder; |
538 | 136k | Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc); |
539 | 136k | setQualifierLoc(Builder.getWithLocInContext(Context)); |
540 | 0 | } else { |
541 | 0 | setQualifierLoc(NestedNameSpecifierLoc()); |
542 | 0 | } |
543 | 136k | setTemplateKeywordLoc(Loc); |
544 | 136k | setTemplateNameLoc(Loc); |
545 | 136k | setLAngleLoc(Loc); |
546 | 136k | setRAngleLoc(Loc); |
547 | 136k | TemplateSpecializationTypeLoc::initializeArgLocs(Context, getNumArgs(), |
548 | 136k | getTypePtr()->getArgs(), |
549 | 136k | getArgInfos(), Loc); |
550 | 136k | } |
551 | | |
552 | | void TemplateSpecializationTypeLoc::initializeArgLocs(ASTContext &Context, |
553 | | unsigned NumArgs, |
554 | | const TemplateArgument *Args, |
555 | | TemplateArgumentLocInfo *ArgInfos, |
556 | 1.39M | SourceLocation Loc) { |
557 | 3.50M | for (unsigned i = 0, e = NumArgs; i != e; ++i2.11M ) { |
558 | 2.11M | switch (Args[i].getKind()) { |
559 | 0 | case TemplateArgument::Null: |
560 | 0 | llvm_unreachable("Impossible TemplateArgument"); |
561 | | |
562 | 15 | case TemplateArgument::Integral: |
563 | 18 | case TemplateArgument::Declaration: |
564 | 21 | case TemplateArgument::NullPtr: |
565 | 21 | ArgInfos[i] = TemplateArgumentLocInfo(); |
566 | 21 | break; |
567 | | |
568 | 775k | case TemplateArgument::Expression: |
569 | 775k | ArgInfos[i] = TemplateArgumentLocInfo(Args[i].getAsExpr()); |
570 | 775k | break; |
571 | | |
572 | 1.31M | case TemplateArgument::Type: |
573 | 1.31M | ArgInfos[i] = TemplateArgumentLocInfo( |
574 | 1.31M | Context.getTrivialTypeSourceInfo(Args[i].getAsType(), |
575 | 1.31M | Loc)); |
576 | 1.31M | break; |
577 | | |
578 | 5.69k | case TemplateArgument::Template: |
579 | 5.70k | case TemplateArgument::TemplateExpansion: { |
580 | 5.70k | NestedNameSpecifierLocBuilder Builder; |
581 | 5.70k | TemplateName Template = Args[i].getAsTemplateOrTemplatePattern(); |
582 | 5.70k | if (DependentTemplateName *DTN = Template.getAsDependentTemplateName()) |
583 | 160 | Builder.MakeTrivial(Context, DTN->getQualifier(), Loc); |
584 | 5.54k | else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName()) |
585 | 64 | Builder.MakeTrivial(Context, QTN->getQualifier(), Loc); |
586 | | |
587 | 5.70k | ArgInfos[i] = TemplateArgumentLocInfo( |
588 | 5.70k | Context, Builder.getWithLocInContext(Context), Loc, |
589 | 5.69k | Args[i].getKind() == TemplateArgument::Template ? SourceLocation() |
590 | 3 | : Loc); |
591 | 5.70k | break; |
592 | 5.69k | } |
593 | | |
594 | 17.2k | case TemplateArgument::Pack: |
595 | 17.2k | ArgInfos[i] = TemplateArgumentLocInfo(); |
596 | 17.2k | break; |
597 | 2.11M | } |
598 | 2.11M | } |
599 | 1.39M | } |
600 | | |
601 | 2 | DeclarationNameInfo AutoTypeLoc::getConceptNameInfo() const { |
602 | 2 | return DeclarationNameInfo(getNamedConcept()->getDeclName(), |
603 | 2 | getLocalData()->ConceptNameLoc); |
604 | 2 | } |
605 | | |
606 | 25.2k | void AutoTypeLoc::initializeLocal(ASTContext &Context, SourceLocation Loc) { |
607 | 25.2k | setNestedNameSpecifierLoc(NestedNameSpecifierLoc()); |
608 | 25.2k | setTemplateKWLoc(Loc); |
609 | 25.2k | setConceptNameLoc(Loc); |
610 | 25.2k | setFoundDecl(nullptr); |
611 | 25.2k | setRAngleLoc(Loc); |
612 | 25.2k | setLAngleLoc(Loc); |
613 | 25.2k | TemplateSpecializationTypeLoc::initializeArgLocs(Context, getNumArgs(), |
614 | 25.2k | getTypePtr()->getArgs(), |
615 | 25.2k | getArgInfos(), Loc); |
616 | 25.2k | setNameLoc(Loc); |
617 | 25.2k | } |
618 | | |
619 | | |
620 | | namespace { |
621 | | |
622 | | class GetContainedAutoTypeLocVisitor : |
623 | | public TypeLocVisitor<GetContainedAutoTypeLocVisitor, TypeLoc> { |
624 | | public: |
625 | | using TypeLocVisitor<GetContainedAutoTypeLocVisitor, TypeLoc>::Visit; |
626 | | |
627 | 181 | TypeLoc VisitAutoTypeLoc(AutoTypeLoc TL) { |
628 | 181 | return TL; |
629 | 181 | } |
630 | | |
631 | | // Only these types can contain the desired 'auto' type. |
632 | | |
633 | 93 | TypeLoc VisitElaboratedTypeLoc(ElaboratedTypeLoc T) { |
634 | 93 | return Visit(T.getNamedTypeLoc()); |
635 | 93 | } |
636 | | |
637 | 210 | TypeLoc VisitQualifiedTypeLoc(QualifiedTypeLoc T) { |
638 | 210 | return Visit(T.getUnqualifiedLoc()); |
639 | 210 | } |
640 | | |
641 | 596 | TypeLoc VisitPointerTypeLoc(PointerTypeLoc T) { |
642 | 596 | return Visit(T.getPointeeLoc()); |
643 | 596 | } |
644 | | |
645 | 0 | TypeLoc VisitBlockPointerTypeLoc(BlockPointerTypeLoc T) { |
646 | 0 | return Visit(T.getPointeeLoc()); |
647 | 0 | } |
648 | | |
649 | 3.71k | TypeLoc VisitReferenceTypeLoc(ReferenceTypeLoc T) { |
650 | 3.71k | return Visit(T.getPointeeLoc()); |
651 | 3.71k | } |
652 | | |
653 | 94 | TypeLoc VisitMemberPointerTypeLoc(MemberPointerTypeLoc T) { |
654 | 94 | return Visit(T.getPointeeLoc()); |
655 | 94 | } |
656 | | |
657 | 66 | TypeLoc VisitArrayTypeLoc(ArrayTypeLoc T) { |
658 | 66 | return Visit(T.getElementLoc()); |
659 | 66 | } |
660 | | |
661 | 305 | TypeLoc VisitFunctionTypeLoc(FunctionTypeLoc T) { |
662 | 305 | return Visit(T.getReturnLoc()); |
663 | 305 | } |
664 | | |
665 | 308 | TypeLoc VisitParenTypeLoc(ParenTypeLoc T) { |
666 | 308 | return Visit(T.getInnerLoc()); |
667 | 308 | } |
668 | | |
669 | 2 | TypeLoc VisitAttributedTypeLoc(AttributedTypeLoc T) { |
670 | 2 | return Visit(T.getModifiedLoc()); |
671 | 2 | } |
672 | | |
673 | 0 | TypeLoc VisitMacroQualifiedTypeLoc(MacroQualifiedTypeLoc T) { |
674 | 0 | return Visit(T.getInnerLoc()); |
675 | 0 | } |
676 | | |
677 | 0 | TypeLoc VisitAdjustedTypeLoc(AdjustedTypeLoc T) { |
678 | 0 | return Visit(T.getOriginalLoc()); |
679 | 0 | } |
680 | | |
681 | 98 | TypeLoc VisitPackExpansionTypeLoc(PackExpansionTypeLoc T) { |
682 | 98 | return Visit(T.getPatternLoc()); |
683 | 98 | } |
684 | | }; |
685 | | |
686 | | } // namespace |
687 | | |
688 | 319k | AutoTypeLoc TypeLoc::getContainedAutoTypeLoc() const { |
689 | 319k | TypeLoc Res = GetContainedAutoTypeLocVisitor().Visit(*this); |
690 | 319k | if (Res.isNull()) |
691 | 319k | return AutoTypeLoc(); |
692 | 181 | return Res.getAs<AutoTypeLoc>(); |
693 | 181 | } |