Coverage Report

Created: 2021-09-21 08:58

/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
218M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
218M
    return TyLoc.getLocalSourceRange(); \
47
218M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
45
9.32k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
9.32k
    return TyLoc.getLocalSourceRange(); \
47
9.32k
  }
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.06k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.06k
    return TyLoc.getLocalSourceRange(); \
47
1.06k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
45
4.11k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
4.11k
    return TyLoc.getLocalSourceRange(); \
47
4.11k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
45
6.15k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
6.15k
    return TyLoc.getLocalSourceRange(); \
47
6.15k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
45
14.4k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
14.4k
    return TyLoc.getLocalSourceRange(); \
47
14.4k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
45
55
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
55
    return TyLoc.getLocalSourceRange(); \
47
55
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
45
895
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
895
    return TyLoc.getLocalSourceRange(); \
47
895
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
45
768k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
768k
    return TyLoc.getLocalSourceRange(); \
47
768k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
45
32.9k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
32.9k
    return TyLoc.getLocalSourceRange(); \
47
32.9k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
45
10.4M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
10.4M
    return TyLoc.getLocalSourceRange(); \
47
10.4M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
45
3.25k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
3.25k
    return TyLoc.getLocalSourceRange(); \
47
3.25k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
45
525k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
525k
    return TyLoc.getLocalSourceRange(); \
47
525k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
45
65.4k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
65.4k
    return TyLoc.getLocalSourceRange(); \
47
65.4k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
45
9.47k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
9.47k
    return TyLoc.getLocalSourceRange(); \
47
9.47k
  }
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.35M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
4.35M
    return TyLoc.getLocalSourceRange(); \
47
4.35M
  }
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
92.4k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
92.4k
    return TyLoc.getLocalSourceRange(); \
47
92.4k
  }
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
645k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
645k
    return TyLoc.getLocalSourceRange(); \
47
645k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitExtIntTypeLoc(clang::ExtIntTypeLoc)
Line
Count
Source
45
1.13k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.13k
    return TyLoc.getLocalSourceRange(); \
47
1.13k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
45
265
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
265
    return TyLoc.getLocalSourceRange(); \
47
265
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
45
1.06M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.06M
    return TyLoc.getLocalSourceRange(); \
47
1.06M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
45
1.83M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.83M
    return TyLoc.getLocalSourceRange(); \
47
1.83M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
45
402
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
402
    return TyLoc.getLocalSourceRange(); \
47
402
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Line
Count
Source
45
294
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
294
    return TyLoc.getLocalSourceRange(); \
47
294
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Line
Count
Source
45
454
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
454
    return TyLoc.getLocalSourceRange(); \
47
454
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
45
61.8k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
61.8k
    return TyLoc.getLocalSourceRange(); \
47
61.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
45
535k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
535k
    return TyLoc.getLocalSourceRange(); \
47
535k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
45
61.7k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
61.7k
    return TyLoc.getLocalSourceRange(); \
47
61.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
45
1.55M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.55M
    return TyLoc.getLocalSourceRange(); \
47
1.55M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
45
45.8k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
45.8k
    return TyLoc.getLocalSourceRange(); \
47
45.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
45
458k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
458k
    return TyLoc.getLocalSourceRange(); \
47
458k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
45
96.0k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
96.0k
    return TyLoc.getLocalSourceRange(); \
47
96.0k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
45
6
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
6
    return TyLoc.getLocalSourceRange(); \
47
6
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
45
1.80M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.80M
    return TyLoc.getLocalSourceRange(); \
47
1.80M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
45
1.52M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.52M
    return TyLoc.getLocalSourceRange(); \
47
1.52M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
45
486k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
486k
    return TyLoc.getLocalSourceRange(); \
47
486k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
45
22.7k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
22.7k
    return TyLoc.getLocalSourceRange(); \
47
22.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
45
16.1M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
16.1M
    return TyLoc.getLocalSourceRange(); \
47
16.1M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
45
340k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
340k
    return TyLoc.getLocalSourceRange(); \
47
340k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
45
10.8M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
10.8M
    return TyLoc.getLocalSourceRange(); \
47
10.8M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
45
99.3M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
99.3M
    return TyLoc.getLocalSourceRange(); \
47
99.3M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
45
32.1M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
32.1M
    return TyLoc.getLocalSourceRange(); \
47
32.1M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
45
6.85k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
6.85k
    return TyLoc.getLocalSourceRange(); \
47
6.85k
  }
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.9M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
32.9M
    return TyLoc.getLocalSourceRange(); \
47
32.9M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
45
2.20k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
2.20k
    return TyLoc.getLocalSourceRange(); \
47
2.20k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
45
2.79k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
2.79k
    return TyLoc.getLocalSourceRange(); \
47
2.79k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
45
461k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
461k
    return TyLoc.getLocalSourceRange(); \
47
461k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
45
354
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
354
    return TyLoc.getLocalSourceRange(); \
47
354
  }
48
#include "clang/AST/TypeLocNodes.def"
49
};
50
51
} // namespace
52
53
218M
SourceRange TypeLoc::getLocalSourceRangeImpl(TypeLoc TL) {
54
218M
  if (TL.isNull()) 
return SourceRange()0
;
55
218M
  return TypeLocRanger().Visit(TL);
56
218M
}
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
438M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
438M
    return TyLoc.getLocalDataAlignment(); \
66
438M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
64
22.7M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
22.7M
    return TyLoc.getLocalDataAlignment(); \
66
22.7M
  }
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.10k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
6.10k
    return TyLoc.getLocalDataAlignment(); \
66
6.10k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
64
532k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
532k
    return TyLoc.getLocalDataAlignment(); \
66
532k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
64
48.0k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
48.0k
    return TyLoc.getLocalDataAlignment(); \
66
48.0k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
64
133k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
133k
    return TyLoc.getLocalDataAlignment(); \
66
133k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
64
46.8k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
46.8k
    return TyLoc.getLocalDataAlignment(); \
66
46.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
64
9.60k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
9.60k
    return TyLoc.getLocalDataAlignment(); \
66
9.60k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
64
4.35M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
4.35M
    return TyLoc.getLocalDataAlignment(); \
66
4.35M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
64
187k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
187k
    return TyLoc.getLocalDataAlignment(); \
66
187k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
64
37.8M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
37.8M
    return TyLoc.getLocalDataAlignment(); \
66
37.8M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
64
26.5k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
26.5k
    return TyLoc.getLocalDataAlignment(); \
66
26.5k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
64
765k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
765k
    return TyLoc.getLocalDataAlignment(); \
66
765k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
64
398k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
398k
    return TyLoc.getLocalDataAlignment(); \
66
398k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
64
3.86k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
3.86k
    return TyLoc.getLocalDataAlignment(); \
66
3.86k
  }
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
6.64M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
6.64M
    return TyLoc.getLocalDataAlignment(); \
66
6.64M
  }
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
153k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
153k
    return TyLoc.getLocalDataAlignment(); \
66
153k
  }
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.42M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
5.42M
    return TyLoc.getLocalDataAlignment(); \
66
5.42M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitExtIntTypeLoc(clang::ExtIntTypeLoc)
Line
Count
Source
64
1.88k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.88k
    return TyLoc.getLocalDataAlignment(); \
66
1.88k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
64
116k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
116k
    return TyLoc.getLocalDataAlignment(); \
66
116k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
64
37.5M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
37.5M
    return TyLoc.getLocalDataAlignment(); \
66
37.5M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
64
3.18M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
3.18M
    return TyLoc.getLocalDataAlignment(); \
66
3.18M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
64
212k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
212k
    return TyLoc.getLocalDataAlignment(); \
66
212k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Line
Count
Source
64
981
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
981
    return TyLoc.getLocalDataAlignment(); \
66
981
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Line
Count
Source
64
510
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
510
    return TyLoc.getLocalDataAlignment(); \
66
510
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
64
57.3k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
57.3k
    return TyLoc.getLocalDataAlignment(); \
66
57.3k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
64
3.94M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
3.94M
    return TyLoc.getLocalDataAlignment(); \
66
3.94M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
64
1.40M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.40M
    return TyLoc.getLocalDataAlignment(); \
66
1.40M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
64
5.36M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
5.36M
    return TyLoc.getLocalDataAlignment(); \
66
5.36M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
64
220k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
220k
    return TyLoc.getLocalDataAlignment(); \
66
220k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
64
918k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
918k
    return TyLoc.getLocalDataAlignment(); \
66
918k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
64
1.19M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.19M
    return TyLoc.getLocalDataAlignment(); \
66
1.19M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
64
269
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
269
    return TyLoc.getLocalDataAlignment(); \
66
269
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
64
13.1M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
13.1M
    return TyLoc.getLocalDataAlignment(); \
66
13.1M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
64
6.05M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
6.05M
    return TyLoc.getLocalDataAlignment(); \
66
6.05M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
64
1.63M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.63M
    return TyLoc.getLocalDataAlignment(); \
66
1.63M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
64
93.6k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
93.6k
    return TyLoc.getLocalDataAlignment(); \
66
93.6k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
64
12.8M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
12.8M
    return TyLoc.getLocalDataAlignment(); \
66
12.8M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
64
1.71M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.71M
    return TyLoc.getLocalDataAlignment(); \
66
1.71M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
64
9.41M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
9.41M
    return TyLoc.getLocalDataAlignment(); \
66
9.41M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
64
23.2M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
23.2M
    return TyLoc.getLocalDataAlignment(); \
66
23.2M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
64
25.9M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
25.9M
    return TyLoc.getLocalDataAlignment(); \
66
25.9M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
64
12.9k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
12.9k
    return TyLoc.getLocalDataAlignment(); \
66
12.9k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
Line
Count
Source
64
126
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
126
    return TyLoc.getLocalDataAlignment(); \
66
126
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
64
210M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
210M
    return TyLoc.getLocalDataAlignment(); \
66
210M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
64
3.70k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
3.70k
    return TyLoc.getLocalDataAlignment(); \
66
3.70k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
64
2.82k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
2.82k
    return TyLoc.getLocalDataAlignment(); \
66
2.82k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
64
1.15M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.15M
    return TyLoc.getLocalDataAlignment(); \
66
1.15M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
64
4.73k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
4.73k
    return TyLoc.getLocalDataAlignment(); \
66
4.73k
  }
67
#include "clang/AST/TypeLocNodes.def"
68
};
69
70
} // namespace
71
72
/// Returns the alignment of the type source info data block.
73
438M
unsigned TypeLoc::getLocalAlignmentForType(QualType Ty) {
74
438M
  if (Ty.isNull()) 
return 10
;
75
438M
  return TypeAligner().Visit(TypeLoc(Ty, nullptr));
76
438M
}
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
282M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
282M
    return TyLoc.getLocalDataSize(); \
86
282M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
84
7.96M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
7.96M
    return TyLoc.getLocalDataSize(); \
86
7.96M
  }
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.67k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
5.67k
    return TyLoc.getLocalDataSize(); \
86
5.67k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
84
402k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
402k
    return TyLoc.getLocalDataSize(); \
86
402k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
84
31.3k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
31.3k
    return TyLoc.getLocalDataSize(); \
86
31.3k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
84
71.7k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
71.7k
    return TyLoc.getLocalDataSize(); \
86
71.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
84
17.7k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
17.7k
    return TyLoc.getLocalDataSize(); \
86
17.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
84
8.62k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
8.62k
    return TyLoc.getLocalDataSize(); \
86
8.62k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
84
3.24M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
3.24M
    return TyLoc.getLocalDataSize(); \
86
3.24M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
84
61.9k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
61.9k
    return TyLoc.getLocalDataSize(); \
86
61.9k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
84
16.0M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
16.0M
    return TyLoc.getLocalDataSize(); \
86
16.0M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
84
11.7k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
11.7k
    return TyLoc.getLocalDataSize(); \
86
11.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
84
588k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
588k
    return TyLoc.getLocalDataSize(); \
86
588k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
84
244k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
244k
    return TyLoc.getLocalDataSize(); \
86
244k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
84
3.17k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
3.17k
    return TyLoc.getLocalDataSize(); \
86
3.17k
  }
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
5.15M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
5.15M
    return TyLoc.getLocalDataSize(); \
86
5.15M
  }
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
147k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
147k
    return TyLoc.getLocalDataSize(); \
86
147k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Line
Count
Source
84
130
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
130
    return TyLoc.getLocalDataSize(); \
86
130
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Line
Count
Source
84
4.07M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
4.07M
    return TyLoc.getLocalDataSize(); \
86
4.07M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitExtIntTypeLoc(clang::ExtIntTypeLoc)
Line
Count
Source
84
968
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
968
    return TyLoc.getLocalDataSize(); \
86
968
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
84
114k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
114k
    return TyLoc.getLocalDataSize(); \
86
114k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
84
36.5M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
36.5M
    return TyLoc.getLocalDataSize(); \
86
36.5M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
84
1.24M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.24M
    return TyLoc.getLocalDataSize(); \
86
1.24M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
84
212k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
212k
    return TyLoc.getLocalDataSize(); \
86
212k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Line
Count
Source
84
981
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
981
    return TyLoc.getLocalDataSize(); \
86
981
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Line
Count
Source
84
510
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
510
    return TyLoc.getLocalDataSize(); \
86
510
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
84
52.3k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
52.3k
    return TyLoc.getLocalDataSize(); \
86
52.3k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
84
1.32M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.32M
    return TyLoc.getLocalDataSize(); \
86
1.32M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
84
818k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
818k
    return TyLoc.getLocalDataSize(); \
86
818k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
84
1.90M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.90M
    return TyLoc.getLocalDataSize(); \
86
1.90M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
84
131k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
131k
    return TyLoc.getLocalDataSize(); \
86
131k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
84
918k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
918k
    return TyLoc.getLocalDataSize(); \
86
918k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
84
347k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
347k
    return TyLoc.getLocalDataSize(); \
86
347k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
84
257
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
257
    return TyLoc.getLocalDataSize(); \
86
257
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
84
10.4M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
10.4M
    return TyLoc.getLocalDataSize(); \
86
10.4M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
84
4.26M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
4.26M
    return TyLoc.getLocalDataSize(); \
86
4.26M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
84
1.17M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.17M
    return TyLoc.getLocalDataSize(); \
86
1.17M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
84
89.2k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
89.2k
    return TyLoc.getLocalDataSize(); \
86
89.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
84
10.5M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
10.5M
    return TyLoc.getLocalDataSize(); \
86
10.5M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
84
596k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
596k
    return TyLoc.getLocalDataSize(); \
86
596k
  }
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
19.4M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
19.4M
    return TyLoc.getLocalDataSize(); \
86
19.4M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
84
17.2M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
17.2M
    return TyLoc.getLocalDataSize(); \
86
17.2M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
84
4.24k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
4.24k
    return TyLoc.getLocalDataSize(); \
86
4.24k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
Line
Count
Source
84
118
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
118
    return TyLoc.getLocalDataSize(); \
86
118
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
84
131M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
131M
    return TyLoc.getLocalDataSize(); \
86
131M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
84
3.68k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
3.68k
    return TyLoc.getLocalDataSize(); \
86
3.68k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
84
2.54k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
2.54k
    return TyLoc.getLocalDataSize(); \
86
2.54k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
84
807k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
807k
    return TyLoc.getLocalDataSize(); \
86
807k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
84
4.73k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
4.73k
    return TyLoc.getLocalDataSize(); \
86
4.73k
  }
87
#include "clang/AST/TypeLocNodes.def"
88
};
89
90
} // namespace
91
92
/// Returns the size of the type source info data block.
93
209M
unsigned TypeLoc::getFullDataSizeForType(QualType Ty) {
94
209M
  unsigned Total = 0;
95
209M
  TypeLoc TyLoc(Ty, nullptr);
96
209M
  unsigned MaxAlign = 1;
97
492M
  while (!TyLoc.isNull()) {
98
282M
    unsigned Align = getLocalAlignmentForType(TyLoc.getType());
99
282M
    MaxAlign = std::max(Align, MaxAlign);
100
282M
    Total = llvm::alignTo(Total, Align);
101
282M
    Total += TypeSizer().Visit(TyLoc);
102
282M
    TyLoc = TyLoc.getNextTypeLoc();
103
282M
  }
104
209M
  Total = llvm::alignTo(Total, MaxAlign);
105
209M
  return Total;
106
209M
}
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
471M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
471M
    return TyLoc.getNextTypeLoc(); \
116
471M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
114
10.8M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
10.8M
    return TyLoc.getNextTypeLoc(); \
116
10.8M
  }
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.08k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
8.08k
    return TyLoc.getNextTypeLoc(); \
116
8.08k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
114
708k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
708k
    return TyLoc.getNextTypeLoc(); \
116
708k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
114
75.7k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
75.7k
    return TyLoc.getNextTypeLoc(); \
116
75.7k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
114
177k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
177k
    return TyLoc.getNextTypeLoc(); \
116
177k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
114
30.8k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
30.8k
    return TyLoc.getNextTypeLoc(); \
116
30.8k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
114
11.2k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
11.2k
    return TyLoc.getNextTypeLoc(); \
116
11.2k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
114
4.13M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
4.13M
    return TyLoc.getNextTypeLoc(); \
116
4.13M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
114
158k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
158k
    return TyLoc.getNextTypeLoc(); \
116
158k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
114
22.5M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
22.5M
    return TyLoc.getNextTypeLoc(); \
116
22.5M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
114
21.0k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
21.0k
    return TyLoc.getNextTypeLoc(); \
116
21.0k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
114
972k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
972k
    return TyLoc.getNextTypeLoc(); \
116
972k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
114
324k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
324k
    return TyLoc.getNextTypeLoc(); \
116
324k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
114
8.01k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
8.01k
    return TyLoc.getNextTypeLoc(); \
116
8.01k
  }
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.93M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
7.93M
    return TyLoc.getNextTypeLoc(); \
116
7.93M
  }
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
228k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
228k
    return TyLoc.getNextTypeLoc(); \
116
228k
  }
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.58M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
5.58M
    return TyLoc.getNextTypeLoc(); \
116
5.58M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitExtIntTypeLoc(clang::ExtIntTypeLoc)
Line
Count
Source
114
1.51k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.51k
    return TyLoc.getNextTypeLoc(); \
116
1.51k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
114
259k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
259k
    return TyLoc.getNextTypeLoc(); \
116
259k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
114
75.0M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
75.0M
    return TyLoc.getNextTypeLoc(); \
116
75.0M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
114
2.29M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
2.29M
    return TyLoc.getNextTypeLoc(); \
116
2.29M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
114
220k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
220k
    return TyLoc.getNextTypeLoc(); \
116
220k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Line
Count
Source
114
1.42k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.42k
    return TyLoc.getNextTypeLoc(); \
116
1.42k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Line
Count
Source
114
777
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
777
    return TyLoc.getNextTypeLoc(); \
116
777
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
114
182k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
182k
    return TyLoc.getNextTypeLoc(); \
116
182k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
114
3.05M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
3.05M
    return TyLoc.getNextTypeLoc(); \
116
3.05M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
114
886k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
886k
    return TyLoc.getNextTypeLoc(); \
116
886k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
114
2.63M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
2.63M
    return TyLoc.getNextTypeLoc(); \
116
2.63M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
114
156k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
156k
    return TyLoc.getNextTypeLoc(); \
116
156k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
114
1.87M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.87M
    return TyLoc.getNextTypeLoc(); \
116
1.87M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
114
825k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
825k
    return TyLoc.getNextTypeLoc(); \
116
825k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
114
529
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
529
    return TyLoc.getNextTypeLoc(); \
116
529
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
114
21.5M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
21.5M
    return TyLoc.getNextTypeLoc(); \
116
21.5M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
114
8.27M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
8.27M
    return TyLoc.getNextTypeLoc(); \
116
8.27M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
114
2.22M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
2.22M
    return TyLoc.getNextTypeLoc(); \
116
2.22M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
114
140k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
140k
    return TyLoc.getNextTypeLoc(); \
116
140k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
114
22.5M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
22.5M
    return TyLoc.getNextTypeLoc(); \
116
22.5M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
114
800k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
800k
    return TyLoc.getNextTypeLoc(); \
116
800k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
114
10.7M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
10.7M
    return TyLoc.getNextTypeLoc(); \
116
10.7M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
114
76.8M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
76.8M
    return TyLoc.getNextTypeLoc(); \
116
76.8M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
114
35.9M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
35.9M
    return TyLoc.getNextTypeLoc(); \
116
35.9M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
114
7.87k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
7.87k
    return TyLoc.getNextTypeLoc(); \
116
7.87k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
Line
Count
Source
114
184
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
184
    return TyLoc.getNextTypeLoc(); \
116
184
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
114
150M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
150M
    return TyLoc.getNextTypeLoc(); \
116
150M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
114
5.97k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
5.97k
    return TyLoc.getNextTypeLoc(); \
116
5.97k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
114
4.83k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
4.83k
    return TyLoc.getNextTypeLoc(); \
116
4.83k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
114
1.01M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.01M
    return TyLoc.getNextTypeLoc(); \
116
1.01M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
114
5.52k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
5.52k
    return TyLoc.getNextTypeLoc(); \
116
5.52k
  }
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
471M
TypeLoc TypeLoc::getNextTypeLocImpl(TypeLoc TL) {
125
471M
  return NextLoc().Visit(TL);
126
471M
}
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
14.1M
                             SourceLocation Loc) {
133
17.2M
  while (
true17.2M
) {
134
17.2M
    switch (TL.getTypeLocClass()) {
135
0
#define ABSTRACT_TYPELOC(CLASS, PARENT)
136
0
#define TYPELOC(CLASS, PARENT)        \
137
3.08M
    case CLASS: {                     \
138
3.08M
      CLASS##TypeLoc TLCasted = TL.castAs<CLASS##TypeLoc>(); \
139
3.08M
      TLCasted.initializeLocal(Context, Loc);  \
140
3.08M
      TL = TLCasted.getNextTypeLoc(); \
141
17.2M
      if (!TL) 
return14.1M
; \
142
3.08M
      continue;                       \
143
3.08M
    }
144
17.2M
#include 
"clang/AST/TypeLocNodes.def"0
145
17.2M
    }
146
17.2M
  }
147
14.1M
}
148
149
namespace {
150
151
class TypeLocCopier : public TypeLocVisitor<TypeLocCopier> {
152
  TypeLoc Source;
153
154
public:
155
2.28k
  TypeLocCopier(TypeLoc source) : Source(source) {}
156
157
#define ABSTRACT_TYPELOC(CLASS, PARENT)
158
#define TYPELOC(CLASS, PARENT)                          \
159
2.28k
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
2.28k
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
2.28k
  }
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
758
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
758
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
758
  }
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
32
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
32
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
32
  }
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
55
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
55
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
55
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
159
422
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
422
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
422
  }
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
962
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
962
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
962
  }
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
183k
void TypeLoc::copy(TypeLoc other) {
168
183k
  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
183k
  if (reinterpret_cast<uintptr_t>(Data) ==
174
183k
          llvm::alignTo(reinterpret_cast<uintptr_t>(Data),
175
183k
                        TypeLocMaxDataAlign) &&
176
183k
      reinterpret_cast<uintptr_t>(other.Data) ==
177
180k
          llvm::alignTo(reinterpret_cast<uintptr_t>(other.Data),
178
180k
                        TypeLocMaxDataAlign)) {
179
180k
    memcpy(Data, other.Data, getFullDataSize());
180
180k
    return;
181
180k
  }
182
183
  // Copy each of the pieces.
184
2.20k
  TypeLoc TL(getType(), Data);
185
2.28k
  do {
186
2.28k
    TypeLocCopier(other).Visit(TL);
187
2.28k
    other = other.getNextTypeLoc();
188
2.28k
  } while ((TL = TL.getNextTypeLoc()));
189
2.20k
}
190
191
98.9M
SourceLocation TypeLoc::getBeginLoc() const {
192
98.9M
  TypeLoc Cur = *this;
193
98.9M
  TypeLoc LeftMost = Cur;
194
109M
  while (true) {
195
109M
    switch (Cur.getTypeLocClass()) {
196
628k
    case Elaborated:
197
628k
      LeftMost = Cur;
198
628k
      break;
199
3.44M
    case FunctionProto:
200
3.44M
      if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr()
201
3.44M
              ->hasTrailingReturn()) {
202
14.2k
        LeftMost = Cur;
203
14.2k
        break;
204
14.2k
      }
205
3.44M
      
LLVM_FALLTHROUGH3.43M
;3.43M
206
3.46M
    case FunctionNoProto:
207
3.47M
    case ConstantArray:
208
3.49M
    case DependentSizedArray:
209
3.52M
    case IncompleteArray:
210
3.52M
    case VariableArray:
211
      // FIXME: Currently QualifiedTypeLoc does not have a source range
212
5.30M
    case Qualified:
213
5.30M
      Cur = Cur.getNextTypeLoc();
214
5.30M
      continue;
215
103M
    default:
216
103M
      if (Cur.getLocalSourceRange().getBegin().isValid())
217
102M
        LeftMost = Cur;
218
103M
      Cur = Cur.getNextTypeLoc();
219
103M
      if (Cur.isNull())
220
98.3M
        break;
221
5.00M
      continue;
222
109M
    } // switch
223
98.9M
    break;
224
109M
  } // while
225
98.9M
  return LeftMost.getLocalSourceRange().getBegin();
226
98.9M
}
227
228
16.5M
SourceLocation TypeLoc::getEndLoc() const {
229
16.5M
  TypeLoc Cur = *this;
230
16.5M
  TypeLoc Last;
231
18.9M
  while (true) {
232
18.9M
    switch (Cur.getTypeLocClass()) {
233
16.5M
    default:
234
16.5M
      if (!Last)
235
14.9M
        Last = Cur;
236
16.5M
      return Last.getLocalSourceRange().getEnd();
237
29.9k
    case Paren:
238
33.4k
    case ConstantArray:
239
39.5k
    case DependentSizedArray:
240
54.0k
    case IncompleteArray:
241
54.0k
    case VariableArray:
242
54.3k
    case FunctionNoProto:
243
54.3k
      Last = Cur;
244
54.3k
      break;
245
510k
    case FunctionProto:
246
510k
      if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr()->hasTrailingReturn())
247
4.34k
        Last = TypeLoc();
248
506k
      else
249
506k
        Last = Cur;
250
510k
      break;
251
581k
    case Pointer:
252
583k
    case BlockPointer:
253
621k
    case MemberPointer:
254
862k
    case LValueReference:
255
938k
    case RValueReference:
256
1.15M
    case PackExpansion:
257
1.15M
      if (!Last)
258
1.06M
        Last = Cur;
259
1.15M
      break;
260
330k
    case Qualified:
261
720k
    case Elaborated:
262
720k
      break;
263
18.9M
    }
264
2.44M
    Cur = Cur.getNextTypeLoc();
265
2.44M
  }
266
16.5M
}
267
268
namespace {
269
270
struct TSTChecker : public TypeLocVisitor<TSTChecker, bool> {
271
  // Overload resolution does the real work for us.
272
1.39M
  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.39M
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
1.39M
    return isTypeSpec(TyLoc); \
279
1.39M
  }
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
63
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
63
    return isTypeSpec(TyLoc); \
279
63
  }
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.09k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
6.09k
    return isTypeSpec(TyLoc); \
279
6.09k
  }
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.2k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
10.2k
    return isTypeSpec(TyLoc); \
279
10.2k
  }
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
277
576k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
576k
    return isTypeSpec(TyLoc); \
279
576k
  }
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
803k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
803k
    return isTypeSpec(TyLoc); \
279
803k
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
277
179
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
179
    return isTypeSpec(TyLoc); \
279
179
  }
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.39M
bool TypeSpecTypeLoc::isKind(const TypeLoc &TL) {
294
1.39M
  if (TL.getType().hasLocalQualifiers()) 
return false0
;
295
1.39M
  return TSTChecker().Visit(TL);
296
1.39M
}
297
298
779
bool TagTypeLoc::isDefinition() const {
299
779
  TagDecl *D = getDecl();
300
779
  return D->isCompleteDefinition() &&
301
779
         
(729
D->getIdentifier() == nullptr729
||
D->getLocation() == getNameLoc()690
);
302
779
}
303
304
// Reimplemented to account for GNU/C++ extension
305
//     typeof unary-expression
306
// where there are no parentheses.
307
6.85k
SourceRange TypeOfExprTypeLoc::getLocalSourceRange() const {
308
6.85k
  if (getRParenLoc().isValid())
309
6.85k
    return SourceRange(getTypeofLoc(), getRParenLoc());
310
0
  else
311
0
    return SourceRange(getTypeofLoc(),
312
0
                       getUnderlyingExpr()->getSourceRange().getEnd());
313
6.85k
}
314
315
316
315k
TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const {
317
315k
  if (needsExtraLocalData())
318
315k
    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::Ibm128:
355
0
  case BuiltinType::ShortAccum:
356
0
  case BuiltinType::Accum:
357
0
  case BuiltinType::LongAccum:
358
0
  case BuiltinType::UShortAccum:
359
0
  case BuiltinType::UAccum:
360
0
  case BuiltinType::ULongAccum:
361
0
  case BuiltinType::ShortFract:
362
0
  case BuiltinType::Fract:
363
0
  case BuiltinType::LongFract:
364
0
  case BuiltinType::UShortFract:
365
0
  case BuiltinType::UFract:
366
0
  case BuiltinType::ULongFract:
367
0
  case BuiltinType::SatShortAccum:
368
0
  case BuiltinType::SatAccum:
369
0
  case BuiltinType::SatLongAccum:
370
0
  case BuiltinType::SatUShortAccum:
371
0
  case BuiltinType::SatUAccum:
372
0
  case BuiltinType::SatULongAccum:
373
0
  case BuiltinType::SatShortFract:
374
0
  case BuiltinType::SatFract:
375
0
  case BuiltinType::SatLongFract:
376
0
  case BuiltinType::SatUShortFract:
377
0
  case BuiltinType::SatUFract:
378
0
  case BuiltinType::SatULongFract:
379
0
  case BuiltinType::BFloat16:
380
0
    llvm_unreachable("Builtin type needs extra local data!");
381
    // Fall through, if the impossible happens.
382
383
0
  case BuiltinType::NullPtr:
384
0
  case BuiltinType::Overload:
385
0
  case BuiltinType::Dependent:
386
0
  case BuiltinType::BoundMember:
387
0
  case BuiltinType::UnknownAny:
388
0
  case BuiltinType::ARCUnbridgedCast:
389
0
  case BuiltinType::PseudoObject:
390
0
  case BuiltinType::ObjCId:
391
0
  case BuiltinType::ObjCClass:
392
0
  case BuiltinType::ObjCSel:
393
0
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
394
0
  case BuiltinType::Id:
395
0
#include "clang/Basic/OpenCLImageTypes.def"
396
0
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
397
0
  case BuiltinType::Id:
398
0
#include "clang/Basic/OpenCLExtensionTypes.def"
399
0
  case BuiltinType::OCLSampler:
400
0
  case BuiltinType::OCLEvent:
401
0
  case BuiltinType::OCLClkEvent:
402
0
  case BuiltinType::OCLQueue:
403
0
  case BuiltinType::OCLReserveID:
404
0
#define SVE_TYPE(Name, Id, SingletonId) \
405
0
  case BuiltinType::Id:
406
0
#include "clang/Basic/AArch64SVEACLETypes.def"
407
0
#define PPC_VECTOR_TYPE(Name, Id, Size) \
408
0
  case BuiltinType::Id:
409
0
#include "clang/Basic/PPCTypes.def"
410
0
#define RVV_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
411
0
#include "clang/Basic/RISCVVTypes.def"
412
0
  case BuiltinType::BuiltinFn:
413
0
  case BuiltinType::IncompleteMatrixIdx:
414
0
  case BuiltinType::OMPArraySection:
415
0
  case BuiltinType::OMPArrayShaping:
416
0
  case BuiltinType::OMPIterator:
417
0
    return TST_unspecified;
418
0
  }
419
420
0
  llvm_unreachable("Invalid BuiltinType Kind!");
421
0
}
422
423
162
TypeLoc TypeLoc::IgnoreParensImpl(TypeLoc TL) {
424
324
  while (ParenTypeLoc PTL = TL.getAs<ParenTypeLoc>())
425
162
    TL = PTL.getInnerLoc();
426
162
  return TL;
427
162
}
428
429
25
SourceLocation TypeLoc::findNullabilityLoc() const {
430
25
  if (auto ATL = getAs<AttributedTypeLoc>()) {
431
25
    const Attr *A = ATL.getAttr();
432
25
    if (A && (isa<TypeNullableAttr>(A) || isa<TypeNonNullAttr>(A) ||
433
25
              
isa<TypeNullUnspecifiedAttr>(A)0
))
434
25
      return A->getLocation();
435
25
  }
436
437
0
  return {};
438
25
}
439
440
159k
TypeLoc TypeLoc::findExplicitQualifierLoc() const {
441
  // Qualified types.
442
159k
  if (auto qual = getAs<QualifiedTypeLoc>())
443
9
    return qual;
444
445
159k
  TypeLoc loc = IgnoreParens();
446
447
  // Attributed types.
448
159k
  if (auto attr = loc.getAs<AttributedTypeLoc>()) {
449
23
    if (attr.isQualifier()) return attr;
450
0
    return attr.getModifiedLoc().findExplicitQualifierLoc();
451
23
  }
452
453
  // C11 _Atomic types.
454
159k
  if (auto atomic = loc.getAs<AtomicTypeLoc>()) {
455
0
    return atomic;
456
0
  }
457
458
159k
  return {};
459
159k
}
460
461
void ObjCTypeParamTypeLoc::initializeLocal(ASTContext &Context,
462
129k
                                           SourceLocation Loc) {
463
129k
  setNameLoc(Loc);
464
129k
  if (!getNumProtocols()) 
return127k
;
465
466
1.74k
  setProtocolLAngleLoc(Loc);
467
1.74k
  setProtocolRAngleLoc(Loc);
468
3.48k
  for (unsigned i = 0, e = getNumProtocols(); i != e; 
++i1.74k
)
469
1.74k
    setProtocolLoc(i, Loc);
470
1.74k
}
471
472
void ObjCObjectTypeLoc::initializeLocal(ASTContext &Context,
473
77.8k
                                        SourceLocation Loc) {
474
77.8k
  setHasBaseTypeAsWritten(true);
475
77.8k
  setTypeArgsLAngleLoc(Loc);
476
77.8k
  setTypeArgsRAngleLoc(Loc);
477
78.0k
  for (unsigned i = 0, e = getNumTypeArgs(); i != e; 
++i169
) {
478
169
    setTypeArgTInfo(i,
479
169
                   Context.getTrivialTypeSourceInfo(
480
169
                     getTypePtr()->getTypeArgsAsWritten()[i], Loc));
481
169
  }
482
77.8k
  setProtocolLAngleLoc(Loc);
483
77.8k
  setProtocolRAngleLoc(Loc);
484
77.9k
  for (unsigned i = 0, e = getNumProtocols(); i != e; 
++i11
)
485
11
    setProtocolLoc(i, Loc);
486
77.8k
}
487
488
768k
SourceRange AttributedTypeLoc::getLocalSourceRange() const {
489
  // Note that this does *not* include the range of the attribute
490
  // enclosure, e.g.:
491
  //    __attribute__((foo(bar)))
492
  //    ^~~~~~~~~~~~~~~        ~~
493
  // or
494
  //    [[foo(bar)]]
495
  //    ^~        ~~
496
  // That enclosure doesn't necessarily belong to a single attribute
497
  // anyway.
498
768k
  return getAttr() ? 
getAttr()->getRange()768k
:
SourceRange()78
;
499
768k
}
500
501
void TypeOfTypeLoc::initializeLocal(ASTContext &Context,
502
2
                                       SourceLocation Loc) {
503
2
  TypeofLikeTypeLoc<TypeOfTypeLoc, TypeOfType, TypeOfTypeLocInfo>
504
2
      ::initializeLocal(Context, Loc);
505
2
  this->getLocalData()->UnderlyingTInfo = Context.getTrivialTypeSourceInfo(
506
2
      getUnderlyingType(), Loc);
507
2
}
508
509
void UnaryTransformTypeLoc::initializeLocal(ASTContext &Context,
510
134
                                       SourceLocation Loc) {
511
134
    setKWLoc(Loc);
512
134
    setRParenLoc(Loc);
513
134
    setLParenLoc(Loc);
514
134
    this->setUnderlyingTInfo(
515
134
        Context.getTrivialTypeSourceInfo(getTypePtr()->getBaseType(), Loc));
516
134
}
517
518
void ElaboratedTypeLoc::initializeLocal(ASTContext &Context,
519
51.7k
                                        SourceLocation Loc) {
520
51.7k
  setElaboratedKeywordLoc(Loc);
521
51.7k
  NestedNameSpecifierLocBuilder Builder;
522
51.7k
  Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
523
51.7k
  setQualifierLoc(Builder.getWithLocInContext(Context));
524
51.7k
}
525
526
void DependentNameTypeLoc::initializeLocal(ASTContext &Context,
527
479k
                                           SourceLocation Loc) {
528
479k
  setElaboratedKeywordLoc(Loc);
529
479k
  NestedNameSpecifierLocBuilder Builder;
530
479k
  Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
531
479k
  setQualifierLoc(Builder.getWithLocInContext(Context));
532
479k
  setNameLoc(Loc);
533
479k
}
534
535
void
536
DependentTemplateSpecializationTypeLoc::initializeLocal(ASTContext &Context,
537
25.6k
                                                        SourceLocation Loc) {
538
25.6k
  setElaboratedKeywordLoc(Loc);
539
25.6k
  if (getTypePtr()->getQualifier()) {
540
25.6k
    NestedNameSpecifierLocBuilder Builder;
541
25.6k
    Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
542
25.6k
    setQualifierLoc(Builder.getWithLocInContext(Context));
543
25.6k
  } else {
544
0
    setQualifierLoc(NestedNameSpecifierLoc());
545
0
  }
546
25.6k
  setTemplateKeywordLoc(Loc);
547
25.6k
  setTemplateNameLoc(Loc);
548
25.6k
  setLAngleLoc(Loc);
549
25.6k
  setRAngleLoc(Loc);
550
25.6k
  TemplateSpecializationTypeLoc::initializeArgLocs(Context, getNumArgs(),
551
25.6k
                                                   getTypePtr()->getArgs(),
552
25.6k
                                                   getArgInfos(), Loc);
553
25.6k
}
554
555
void TemplateSpecializationTypeLoc::initializeArgLocs(ASTContext &Context,
556
                                                      unsigned NumArgs,
557
                                                  const TemplateArgument *Args,
558
                                              TemplateArgumentLocInfo *ArgInfos,
559
1.30M
                                                      SourceLocation Loc) {
560
3.48M
  for (unsigned i = 0, e = NumArgs; i != e; 
++i2.17M
) {
561
2.17M
    switch (Args[i].getKind()) {
562
0
    case TemplateArgument::Null:
563
0
      llvm_unreachable("Impossible TemplateArgument");
564
565
16
    case TemplateArgument::Integral:
566
19
    case TemplateArgument::Declaration:
567
22
    case TemplateArgument::NullPtr:
568
22
      ArgInfos[i] = TemplateArgumentLocInfo();
569
22
      break;
570
571
786k
    case TemplateArgument::Expression:
572
786k
      ArgInfos[i] = TemplateArgumentLocInfo(Args[i].getAsExpr());
573
786k
      break;
574
575
1.36M
    case TemplateArgument::Type:
576
1.36M
      ArgInfos[i] = TemplateArgumentLocInfo(
577
1.36M
                          Context.getTrivialTypeSourceInfo(Args[i].getAsType(),
578
1.36M
                                                           Loc));
579
1.36M
      break;
580
581
5.70k
    case TemplateArgument::Template:
582
5.71k
    case TemplateArgument::TemplateExpansion: {
583
5.71k
      NestedNameSpecifierLocBuilder Builder;
584
5.71k
      TemplateName Template = Args[i].getAsTemplateOrTemplatePattern();
585
5.71k
      if (DependentTemplateName *DTN = Template.getAsDependentTemplateName())
586
36
        Builder.MakeTrivial(Context, DTN->getQualifier(), Loc);
587
5.67k
      else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName())
588
2
        Builder.MakeTrivial(Context, QTN->getQualifier(), Loc);
589
590
5.71k
      ArgInfos[i] = TemplateArgumentLocInfo(
591
5.71k
          Context, Builder.getWithLocInContext(Context), Loc,
592
5.71k
          Args[i].getKind() == TemplateArgument::Template ? 
SourceLocation()5.70k
593
5.71k
                                                          : 
Loc3
);
594
5.71k
      break;
595
5.70k
    }
596
597
17.9k
    case TemplateArgument::Pack:
598
17.9k
      ArgInfos[i] = TemplateArgumentLocInfo();
599
17.9k
      break;
600
2.17M
    }
601
2.17M
  }
602
1.30M
}
603
604
8
DeclarationNameInfo AutoTypeLoc::getConceptNameInfo() const {
605
8
  return DeclarationNameInfo(getNamedConcept()->getDeclName(),
606
8
                             getLocalData()->ConceptNameLoc);
607
8
}
608
609
28.2k
void AutoTypeLoc::initializeLocal(ASTContext &Context, SourceLocation Loc) {
610
28.2k
  setNestedNameSpecifierLoc(NestedNameSpecifierLoc());
611
28.2k
  setTemplateKWLoc(Loc);
612
28.2k
  setConceptNameLoc(Loc);
613
28.2k
  setFoundDecl(nullptr);
614
28.2k
  setRAngleLoc(Loc);
615
28.2k
  setLAngleLoc(Loc);
616
28.2k
  TemplateSpecializationTypeLoc::initializeArgLocs(Context, getNumArgs(),
617
28.2k
                                                   getTypePtr()->getArgs(),
618
28.2k
                                                   getArgInfos(), Loc);
619
28.2k
  setNameLoc(Loc);
620
28.2k
}
621
622
623
namespace {
624
625
  class GetContainedAutoTypeLocVisitor :
626
    public TypeLocVisitor<GetContainedAutoTypeLocVisitor, TypeLoc> {
627
  public:
628
    using TypeLocVisitor<GetContainedAutoTypeLocVisitor, TypeLoc>::Visit;
629
630
242
    TypeLoc VisitAutoTypeLoc(AutoTypeLoc TL) {
631
242
      return TL;
632
242
    }
633
634
    // Only these types can contain the desired 'auto' type.
635
636
97
    TypeLoc VisitElaboratedTypeLoc(ElaboratedTypeLoc T) {
637
97
      return Visit(T.getNamedTypeLoc());
638
97
    }
639
640
230
    TypeLoc VisitQualifiedTypeLoc(QualifiedTypeLoc T) {
641
230
      return Visit(T.getUnqualifiedLoc());
642
230
    }
643
644
13.6k
    TypeLoc VisitPointerTypeLoc(PointerTypeLoc T) {
645
13.6k
      return Visit(T.getPointeeLoc());
646
13.6k
    }
647
648
0
    TypeLoc VisitBlockPointerTypeLoc(BlockPointerTypeLoc T) {
649
0
      return Visit(T.getPointeeLoc());
650
0
    }
651
652
2.23k
    TypeLoc VisitReferenceTypeLoc(ReferenceTypeLoc T) {
653
2.23k
      return Visit(T.getPointeeLoc());
654
2.23k
    }
655
656
111
    TypeLoc VisitMemberPointerTypeLoc(MemberPointerTypeLoc T) {
657
111
      return Visit(T.getPointeeLoc());
658
111
    }
659
660
71
    TypeLoc VisitArrayTypeLoc(ArrayTypeLoc T) {
661
71
      return Visit(T.getElementLoc());
662
71
    }
663
664
341
    TypeLoc VisitFunctionTypeLoc(FunctionTypeLoc T) {
665
341
      return Visit(T.getReturnLoc());
666
341
    }
667
668
336
    TypeLoc VisitParenTypeLoc(ParenTypeLoc T) {
669
336
      return Visit(T.getInnerLoc());
670
336
    }
671
672
2
    TypeLoc VisitAttributedTypeLoc(AttributedTypeLoc T) {
673
2
      return Visit(T.getModifiedLoc());
674
2
    }
675
676
0
    TypeLoc VisitMacroQualifiedTypeLoc(MacroQualifiedTypeLoc T) {
677
0
      return Visit(T.getInnerLoc());
678
0
    }
679
680
0
    TypeLoc VisitAdjustedTypeLoc(AdjustedTypeLoc T) {
681
0
      return Visit(T.getOriginalLoc());
682
0
    }
683
684
98
    TypeLoc VisitPackExpansionTypeLoc(PackExpansionTypeLoc T) {
685
98
      return Visit(T.getPatternLoc());
686
98
    }
687
  };
688
689
} // namespace
690
691
331k
AutoTypeLoc TypeLoc::getContainedAutoTypeLoc() const {
692
331k
  TypeLoc Res = GetContainedAutoTypeLocVisitor().Visit(*this);
693
331k
  if (Res.isNull())
694
331k
    return AutoTypeLoc();
695
242
  return Res.getAs<AutoTypeLoc>();
696
331k
}