Coverage Report

Created: 2020-02-25 14:32

/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
208M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
208M
    return TyLoc.getLocalSourceRange(); \
47
208M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
45
7.44k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
7.44k
    return TyLoc.getLocalSourceRange(); \
47
7.44k
  }
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
3.56k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
3.56k
    return TyLoc.getLocalSourceRange(); \
47
3.56k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
45
8.55k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
8.55k
    return TyLoc.getLocalSourceRange(); \
47
8.55k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
45
15.1k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
15.1k
    return TyLoc.getLocalSourceRange(); \
47
15.1k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
45
59
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
59
    return TyLoc.getLocalSourceRange(); \
47
59
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
45
702
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
702
    return TyLoc.getLocalSourceRange(); \
47
702
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
45
977k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
977k
    return TyLoc.getLocalSourceRange(); \
47
977k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
45
41.0k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
41.0k
    return TyLoc.getLocalSourceRange(); \
47
41.0k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
45
8.86M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
8.86M
    return TyLoc.getLocalSourceRange(); \
47
8.86M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
45
2.57k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
2.57k
    return TyLoc.getLocalSourceRange(); \
47
2.57k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
45
472k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
472k
    return TyLoc.getLocalSourceRange(); \
47
472k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
45
39.9k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
39.9k
    return TyLoc.getLocalSourceRange(); \
47
39.9k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
45
7.49k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
7.49k
    return TyLoc.getLocalSourceRange(); \
47
7.49k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Line
Count
Source
45
44
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
44
    return TyLoc.getLocalSourceRange(); \
47
44
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
45
4.22M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
4.22M
    return TyLoc.getLocalSourceRange(); \
47
4.22M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Line
Count
Source
45
54
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
54
    return TyLoc.getLocalSourceRange(); \
47
54
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Line
Count
Source
45
259k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
259k
    return TyLoc.getLocalSourceRange(); \
47
259k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Line
Count
Source
45
130
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
130
    return TyLoc.getLocalSourceRange(); \
47
130
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Line
Count
Source
45
643k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
643k
    return TyLoc.getLocalSourceRange(); \
47
643k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
45
33
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
33
    return TyLoc.getLocalSourceRange(); \
47
33
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
45
918k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
918k
    return TyLoc.getLocalSourceRange(); \
47
918k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
45
1.59M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.59M
    return TyLoc.getLocalSourceRange(); \
47
1.59M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
45
171
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
171
    return TyLoc.getLocalSourceRange(); \
47
171
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
45
69.8k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
69.8k
    return TyLoc.getLocalSourceRange(); \
47
69.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
45
682k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
682k
    return TyLoc.getLocalSourceRange(); \
47
682k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
45
74.4k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
74.4k
    return TyLoc.getLocalSourceRange(); \
47
74.4k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
45
1.95M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.95M
    return TyLoc.getLocalSourceRange(); \
47
1.95M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
45
58.2k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
58.2k
    return TyLoc.getLocalSourceRange(); \
47
58.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
45
262k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
262k
    return TyLoc.getLocalSourceRange(); \
47
262k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
45
102k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
102k
    return TyLoc.getLocalSourceRange(); \
47
102k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
45
2
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
2
    return TyLoc.getLocalSourceRange(); \
47
2
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
45
1.47M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.47M
    return TyLoc.getLocalSourceRange(); \
47
1.47M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
45
1.24M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.24M
    return TyLoc.getLocalSourceRange(); \
47
1.24M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
45
510k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
510k
    return TyLoc.getLocalSourceRange(); \
47
510k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
45
248
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
248
    return TyLoc.getLocalSourceRange(); \
47
248
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
45
13.8M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
13.8M
    return TyLoc.getLocalSourceRange(); \
47
13.8M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
45
327k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
327k
    return TyLoc.getLocalSourceRange(); \
47
327k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
45
10.1M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
10.1M
    return TyLoc.getLocalSourceRange(); \
47
10.1M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
45
99.8M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
99.8M
    return TyLoc.getLocalSourceRange(); \
47
99.8M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
45
29.7M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
29.7M
    return TyLoc.getLocalSourceRange(); \
47
29.7M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
45
6.20k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
6.20k
    return TyLoc.getLocalSourceRange(); \
47
6.20k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
Line
Count
Source
45
53
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
53
    return TyLoc.getLocalSourceRange(); \
47
53
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
45
29.7M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
29.7M
    return TyLoc.getLocalSourceRange(); \
47
29.7M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
45
1.66k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.66k
    return TyLoc.getLocalSourceRange(); \
47
1.66k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
45
1.62k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.62k
    return TyLoc.getLocalSourceRange(); \
47
1.62k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
45
414k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
414k
    return TyLoc.getLocalSourceRange(); \
47
414k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
45
72
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
72
    return TyLoc.getLocalSourceRange(); \
47
72
  }
48
#include "clang/AST/TypeLocNodes.def"
49
};
50
51
} // namespace
52
53
208M
SourceRange TypeLoc::getLocalSourceRangeImpl(TypeLoc TL) {
54
208M
  if (TL.isNull()) 
return SourceRange()0
;
55
208M
  return TypeLocRanger().Visit(TL);
56
208M
}
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
220M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
220M
    return TyLoc.getLocalDataAlignment(); \
66
220M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
64
13.8M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
13.8M
    return TyLoc.getLocalDataAlignment(); \
66
13.8M
  }
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.41k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
6.41k
    return TyLoc.getLocalDataAlignment(); \
66
6.41k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
64
470k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
470k
    return TyLoc.getLocalDataAlignment(); \
66
470k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
64
39.5k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
39.5k
    return TyLoc.getLocalDataAlignment(); \
66
39.5k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
64
136k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
136k
    return TyLoc.getLocalDataAlignment(); \
66
136k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
64
35.5k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
35.5k
    return TyLoc.getLocalDataAlignment(); \
66
35.5k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
64
7.21k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
7.21k
    return TyLoc.getLocalDataAlignment(); \
66
7.21k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
64
5.54M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
5.54M
    return TyLoc.getLocalDataAlignment(); \
66
5.54M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
64
221k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
221k
    return TyLoc.getLocalDataAlignment(); \
66
221k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
64
25.7M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
25.7M
    return TyLoc.getLocalDataAlignment(); \
66
25.7M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
64
25.7k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
25.7k
    return TyLoc.getLocalDataAlignment(); \
66
25.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
64
636k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
636k
    return TyLoc.getLocalDataAlignment(); \
66
636k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
64
244k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
244k
    return TyLoc.getLocalDataAlignment(); \
66
244k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
64
2.53k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
2.53k
    return TyLoc.getLocalDataAlignment(); \
66
2.53k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Line
Count
Source
64
237
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
237
    return TyLoc.getLocalDataAlignment(); \
66
237
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
64
6.01M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
6.01M
    return TyLoc.getLocalDataAlignment(); \
66
6.01M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Line
Count
Source
64
53
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
53
    return TyLoc.getLocalDataAlignment(); \
66
53
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Line
Count
Source
64
449k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
449k
    return TyLoc.getLocalDataAlignment(); \
66
449k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Line
Count
Source
64
85
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
85
    return TyLoc.getLocalDataAlignment(); \
66
85
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Line
Count
Source
64
4.97M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
4.97M
    return TyLoc.getLocalDataAlignment(); \
66
4.97M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
64
23.4k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
23.4k
    return TyLoc.getLocalDataAlignment(); \
66
23.4k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
64
11.6M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
11.6M
    return TyLoc.getLocalDataAlignment(); \
66
11.6M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
64
2.55M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
2.55M
    return TyLoc.getLocalDataAlignment(); \
66
2.55M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
64
357k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
357k
    return TyLoc.getLocalDataAlignment(); \
66
357k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
64
61.2k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
61.2k
    return TyLoc.getLocalDataAlignment(); \
66
61.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
64
4.96M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
4.96M
    return TyLoc.getLocalDataAlignment(); \
66
4.96M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
64
1.56M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.56M
    return TyLoc.getLocalDataAlignment(); \
66
1.56M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
64
6.75M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
6.75M
    return TyLoc.getLocalDataAlignment(); \
66
6.75M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
64
266k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
266k
    return TyLoc.getLocalDataAlignment(); \
66
266k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
64
557k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
557k
    return TyLoc.getLocalDataAlignment(); \
66
557k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
64
1.30M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.30M
    return TyLoc.getLocalDataAlignment(); \
66
1.30M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
64
97
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
97
    return TyLoc.getLocalDataAlignment(); \
66
97
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
64
8.15M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
8.15M
    return TyLoc.getLocalDataAlignment(); \
66
8.15M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
64
5.11M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
5.11M
    return TyLoc.getLocalDataAlignment(); \
66
5.11M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
64
1.61M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.61M
    return TyLoc.getLocalDataAlignment(); \
66
1.61M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
64
121k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
121k
    return TyLoc.getLocalDataAlignment(); \
66
121k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
64
11.1M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
11.1M
    return TyLoc.getLocalDataAlignment(); \
66
11.1M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
64
548k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
548k
    return TyLoc.getLocalDataAlignment(); \
66
548k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
64
8.34M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
8.34M
    return TyLoc.getLocalDataAlignment(); \
66
8.34M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
64
19.0M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
19.0M
    return TyLoc.getLocalDataAlignment(); \
66
19.0M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
64
22.6M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
22.6M
    return TyLoc.getLocalDataAlignment(); \
66
22.6M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
64
11.3k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
11.3k
    return TyLoc.getLocalDataAlignment(); \
66
11.3k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
Line
Count
Source
64
119
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
119
    return TyLoc.getLocalDataAlignment(); \
66
119
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
64
54.3M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
54.3M
    return TyLoc.getLocalDataAlignment(); \
66
54.3M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
64
3.13k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
3.13k
    return TyLoc.getLocalDataAlignment(); \
66
3.13k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
64
1.66k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.66k
    return TyLoc.getLocalDataAlignment(); \
66
1.66k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
64
777k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
777k
    return TyLoc.getLocalDataAlignment(); \
66
777k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
64
2.63k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
2.63k
    return TyLoc.getLocalDataAlignment(); \
66
2.63k
  }
67
#include "clang/AST/TypeLocNodes.def"
68
};
69
70
} // namespace
71
72
/// Returns the alignment of the type source info data block.
73
220M
unsigned TypeLoc::getLocalAlignmentForType(QualType Ty) {
74
220M
  if (Ty.isNull()) 
return 10
;
75
220M
  return TypeAligner().Visit(TypeLoc(Ty, nullptr));
76
220M
}
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
134M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
134M
    return TyLoc.getLocalDataSize(); \
86
134M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
84
5.02M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
5.02M
    return TyLoc.getLocalDataSize(); \
86
5.02M
  }
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.84k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
5.84k
    return TyLoc.getLocalDataSize(); \
86
5.84k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
84
356k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
356k
    return TyLoc.getLocalDataSize(); \
86
356k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
84
28.7k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
28.7k
    return TyLoc.getLocalDataSize(); \
86
28.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
84
74.2k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
74.2k
    return TyLoc.getLocalDataSize(); \
86
74.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
84
13.8k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
13.8k
    return TyLoc.getLocalDataSize(); \
86
13.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
84
6.49k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
6.49k
    return TyLoc.getLocalDataSize(); \
86
6.49k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
84
4.00M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
4.00M
    return TyLoc.getLocalDataSize(); \
86
4.00M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
84
71.8k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
71.8k
    return TyLoc.getLocalDataSize(); \
86
71.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
84
11.4M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
11.4M
    return TyLoc.getLocalDataSize(); \
86
11.4M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
84
10.9k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
10.9k
    return TyLoc.getLocalDataSize(); \
86
10.9k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
84
445k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
445k
    return TyLoc.getLocalDataSize(); \
86
445k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
84
153k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
153k
    return TyLoc.getLocalDataSize(); \
86
153k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
84
1.90k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.90k
    return TyLoc.getLocalDataSize(); \
86
1.90k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Line
Count
Source
84
79
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
79
    return TyLoc.getLocalDataSize(); \
86
79
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
84
4.55M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
4.55M
    return TyLoc.getLocalDataSize(); \
86
4.55M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Line
Count
Source
84
53
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
53
    return TyLoc.getLocalDataSize(); \
86
53
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Line
Count
Source
84
426k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
426k
    return TyLoc.getLocalDataSize(); \
86
426k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Line
Count
Source
84
85
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
85
    return TyLoc.getLocalDataSize(); \
86
85
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Line
Count
Source
84
3.62M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
3.62M
    return TyLoc.getLocalDataSize(); \
86
3.62M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
84
20.8k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
20.8k
    return TyLoc.getLocalDataSize(); \
86
20.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
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::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
84
1.01M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.01M
    return TyLoc.getLocalDataSize(); \
86
1.01M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
84
355k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
355k
    return TyLoc.getLocalDataSize(); \
86
355k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
84
55.7k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
55.7k
    return TyLoc.getLocalDataSize(); \
86
55.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
84
1.62M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.62M
    return TyLoc.getLocalDataSize(); \
86
1.62M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
84
952k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
952k
    return TyLoc.getLocalDataSize(); \
86
952k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
84
2.38M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
2.38M
    return TyLoc.getLocalDataSize(); \
86
2.38M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
84
155k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
155k
    return TyLoc.getLocalDataSize(); \
86
155k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
84
557k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
557k
    return TyLoc.getLocalDataSize(); \
86
557k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
84
377k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
377k
    return TyLoc.getLocalDataSize(); \
86
377k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
84
93
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
93
    return TyLoc.getLocalDataSize(); \
86
93
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
84
5.53M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
5.53M
    return TyLoc.getLocalDataSize(); \
86
5.53M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
84
3.60M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
3.60M
    return TyLoc.getLocalDataSize(); \
86
3.60M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
84
1.13M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.13M
    return TyLoc.getLocalDataSize(); \
86
1.13M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
84
121k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
121k
    return TyLoc.getLocalDataSize(); \
86
121k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
84
9.30M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
9.30M
    return TyLoc.getLocalDataSize(); \
86
9.30M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
84
203k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
203k
    return TyLoc.getLocalDataSize(); \
86
203k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
84
3.86M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
3.86M
    return TyLoc.getLocalDataSize(); \
86
3.86M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
84
16.4M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
16.4M
    return TyLoc.getLocalDataSize(); \
86
16.4M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
84
14.6M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
14.6M
    return TyLoc.getLocalDataSize(); \
86
14.6M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
84
3.73k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
3.73k
    return TyLoc.getLocalDataSize(); \
86
3.73k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
Line
Count
Source
84
111
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
111
    return TyLoc.getLocalDataSize(); \
86
111
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
84
30.6M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
30.6M
    return TyLoc.getLocalDataSize(); \
86
30.6M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
84
3.12k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
3.12k
    return TyLoc.getLocalDataSize(); \
86
3.12k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
84
1.37k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.37k
    return TyLoc.getLocalDataSize(); \
86
1.37k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
84
542k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
542k
    return TyLoc.getLocalDataSize(); \
86
542k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
84
2.63k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
2.63k
    return TyLoc.getLocalDataSize(); \
86
2.63k
  }
87
#include "clang/AST/TypeLocNodes.def"
88
};
89
90
} // namespace
91
92
/// Returns the size of the type source info data block.
93
96.3M
unsigned TypeLoc::getFullDataSizeForType(QualType Ty) {
94
96.3M
  unsigned Total = 0;
95
96.3M
  TypeLoc TyLoc(Ty, nullptr);
96
96.3M
  unsigned MaxAlign = 1;
97
230M
  while (!TyLoc.isNull()) {
98
134M
    unsigned Align = getLocalAlignmentForType(TyLoc.getType());
99
134M
    MaxAlign = std::max(Align, MaxAlign);
100
134M
    Total = llvm::alignTo(Total, Align);
101
134M
    Total += TypeSizer().Visit(TyLoc);
102
134M
    TyLoc = TyLoc.getNextTypeLoc();
103
134M
  }
104
96.3M
  Total = llvm::alignTo(Total, MaxAlign);
105
96.3M
  return Total;
106
96.3M
}
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
283M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
283M
    return TyLoc.getNextTypeLoc(); \
116
283M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
114
7.36M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
7.36M
    return TyLoc.getNextTypeLoc(); \
116
7.36M
  }
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.22k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
8.22k
    return TyLoc.getNextTypeLoc(); \
116
8.22k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
114
645k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
645k
    return TyLoc.getNextTypeLoc(); \
116
645k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
114
76.6k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
76.6k
    return TyLoc.getNextTypeLoc(); \
116
76.6k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
114
186k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
186k
    return TyLoc.getNextTypeLoc(); \
116
186k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
114
24.3k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
24.3k
    return TyLoc.getNextTypeLoc(); \
116
24.3k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
114
9.05k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
9.05k
    return TyLoc.getNextTypeLoc(); \
116
9.05k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
114
5.14M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
5.14M
    return TyLoc.getNextTypeLoc(); \
116
5.14M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
114
187k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
187k
    return TyLoc.getNextTypeLoc(); \
116
187k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
114
16.8M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
16.8M
    return TyLoc.getNextTypeLoc(); \
116
16.8M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
114
20.4k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
20.4k
    return TyLoc.getNextTypeLoc(); \
116
20.4k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
114
775k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
775k
    return TyLoc.getNextTypeLoc(); \
116
775k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
114
202k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
202k
    return TyLoc.getNextTypeLoc(); \
116
202k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
114
5.66k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
5.66k
    return TyLoc.getNextTypeLoc(); \
116
5.66k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Line
Count
Source
114
137
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
137
    return TyLoc.getNextTypeLoc(); \
116
137
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
114
7.07M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
7.07M
    return TyLoc.getNextTypeLoc(); \
116
7.07M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Line
Count
Source
114
91
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
91
    return TyLoc.getNextTypeLoc(); \
116
91
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Line
Count
Source
114
646k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
646k
    return TyLoc.getNextTypeLoc(); \
116
646k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Line
Count
Source
114
150
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
150
    return TyLoc.getNextTypeLoc(); \
116
150
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Line
Count
Source
114
5.18M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
5.18M
    return TyLoc.getNextTypeLoc(); \
116
5.18M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
114
64.3k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
64.3k
    return TyLoc.getNextTypeLoc(); \
116
64.3k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
114
22.8M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
22.8M
    return TyLoc.getNextTypeLoc(); \
116
22.8M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
114
1.89M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.89M
    return TyLoc.getNextTypeLoc(); \
116
1.89M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
114
367k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
367k
    return TyLoc.getNextTypeLoc(); \
116
367k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
114
199k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
199k
    return TyLoc.getNextTypeLoc(); \
116
199k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
114
3.83M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
3.83M
    return TyLoc.getNextTypeLoc(); \
116
3.83M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
114
1.03M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.03M
    return TyLoc.getNextTypeLoc(); \
116
1.03M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
114
3.30M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
3.30M
    return TyLoc.getNextTypeLoc(); \
116
3.30M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
114
186k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
186k
    return TyLoc.getNextTypeLoc(); \
116
186k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
114
1.12M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.12M
    return TyLoc.getNextTypeLoc(); \
116
1.12M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
114
908k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
908k
    return TyLoc.getNextTypeLoc(); \
116
908k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
114
198
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
198
    return TyLoc.getNextTypeLoc(); \
116
198
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
114
11.8M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
11.8M
    return TyLoc.getNextTypeLoc(); \
116
11.8M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
114
6.98M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
6.98M
    return TyLoc.getNextTypeLoc(); \
116
6.98M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
114
2.16M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
2.16M
    return TyLoc.getNextTypeLoc(); \
116
2.16M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
114
181k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
181k
    return TyLoc.getNextTypeLoc(); \
116
181k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
114
19.6M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
19.6M
    return TyLoc.getNextTypeLoc(); \
116
19.6M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
114
397k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
397k
    return TyLoc.getNextTypeLoc(); \
116
397k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
114
9.61M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
9.61M
    return TyLoc.getNextTypeLoc(); \
116
9.61M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
114
73.0M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
73.0M
    return TyLoc.getNextTypeLoc(); \
116
73.0M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
114
31.2M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
31.2M
    return TyLoc.getNextTypeLoc(); \
116
31.2M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
114
6.96k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
6.96k
    return TyLoc.getNextTypeLoc(); \
116
6.96k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
Line
Count
Source
114
170
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
170
    return TyLoc.getNextTypeLoc(); \
116
170
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
114
47.4M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
47.4M
    return TyLoc.getNextTypeLoc(); \
116
47.4M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
114
4.89k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
4.89k
    return TyLoc.getNextTypeLoc(); \
116
4.89k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
114
2.60k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
2.60k
    return TyLoc.getNextTypeLoc(); \
116
2.60k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
114
683k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
683k
    return TyLoc.getNextTypeLoc(); \
116
683k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
114
3.10k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
3.10k
    return TyLoc.getNextTypeLoc(); \
116
3.10k
  }
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
283M
TypeLoc TypeLoc::getNextTypeLocImpl(TypeLoc TL) {
125
283M
  return NextLoc().Visit(TL);
126
283M
}
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
10.4M
                             SourceLocation Loc) {
133
11.6M
  while (true) {
134
11.6M
    switch (TL.getTypeLocClass()) {
135
0
#define ABSTRACT_TYPELOC(CLASS, PARENT)
136
0
#define TYPELOC(CLASS, PARENT)        \
137
1.23M
    case CLASS: {                     \
138
1.23M
      CLASS##TypeLoc TLCasted = TL.castAs<CLASS##TypeLoc>(); \
139
1.23M
      TLCasted.initializeLocal(Context, Loc);  \
140
1.23M
      TL = TLCasted.getNextTypeLoc(); \
141
11.6M
      if (!TL) 
return10.4M
; \
142
1.23M
      
continue0
; \
143
1.23M
    }
144
0
#include "clang/AST/TypeLocNodes.def"
145
11.6M
    }
146
11.6M
  }
147
10.4M
}
148
149
namespace {
150
151
class TypeLocCopier : public TypeLocVisitor<TypeLocCopier> {
152
  TypeLoc Source;
153
154
public:
155
2.25k
  TypeLocCopier(TypeLoc source) : Source(source) {}
156
157
#define ABSTRACT_TYPELOC(CLASS, PARENT)
158
#define TYPELOC(CLASS, PARENT)                          \
159
2.25k
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
2.25k
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
2.25k
  }
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
729
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
729
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
729
  }
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::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
159
3
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
3
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
3
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
159
18
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
18
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
18
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
159
18
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
18
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
18
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
159
3
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
3
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
3
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPipeTypeLoc(clang::PipeTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
159
26
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
26
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
26
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitEnumTypeLoc(clang::EnumTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
159
51
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
51
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
51
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
159
368
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
368
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
368
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
159
1
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
1
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
1
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
159
1.02k
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
1.02k
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
1.02k
  }
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
216k
void TypeLoc::copy(TypeLoc other) {
168
216k
  assert(getFullDataSize() == other.getFullDataSize());
169
216k
170
216k
  // If both data pointers are aligned to the maximum alignment, we
171
216k
  // can memcpy because getFullDataSize() accurately reflects the
172
216k
  // layout of the data.
173
216k
  if (reinterpret_cast<uintptr_t>(Data) ==
174
216k
          llvm::alignTo(reinterpret_cast<uintptr_t>(Data),
175
216k
                        TypeLocMaxDataAlign) &&
176
216k
      reinterpret_cast<uintptr_t>(other.Data) ==
177
214k
          llvm::alignTo(reinterpret_cast<uintptr_t>(other.Data),
178
214k
                        TypeLocMaxDataAlign)) {
179
214k
    memcpy(Data, other.Data, getFullDataSize());
180
214k
    return;
181
214k
  }
182
2.17k
183
2.17k
  // Copy each of the pieces.
184
2.17k
  TypeLoc TL(getType(), Data);
185
2.25k
  do {
186
2.25k
    TypeLocCopier(other).Visit(TL);
187
2.25k
    other = other.getNextTypeLoc();
188
2.25k
  } while ((TL = TL.getNextTypeLoc()));
189
2.17k
}
190
191
94.8M
SourceLocation TypeLoc::getBeginLoc() const {
192
94.8M
  TypeLoc Cur = *this;
193
94.8M
  TypeLoc LeftMost = Cur;
194
103M
  while (
true103M
) {
195
103M
    switch (Cur.getTypeLocClass()) {
196
628k
    case Elaborated:
197
628k
      LeftMost = Cur;
198
628k
      break;
199
2.78M
    case FunctionProto:
200
2.78M
      if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr()
201
2.78M
              ->hasTrailingReturn()) {
202
19.8k
        LeftMost = Cur;
203
19.8k
        break;
204
19.8k
      }
205
2.76M
      LLVM_FALLTHROUGH;
206
4.36M
    case FunctionNoProto:
207
4.36M
    case ConstantArray:
208
4.36M
    case DependentSizedArray:
209
4.36M
    case IncompleteArray:
210
4.36M
    case VariableArray:
211
4.36M
      // FIXME: Currently QualifiedTypeLoc does not have a source range
212
4.36M
    case Qualified:
213
4.36M
      Cur = Cur.getNextTypeLoc();
214
4.36M
      continue;
215
98.8M
    default:
216
98.8M
      if (Cur.getLocalSourceRange().getBegin().isValid())
217
98.2M
        LeftMost = Cur;
218
98.8M
      Cur = Cur.getNextTypeLoc();
219
98.8M
      if (Cur.isNull())
220
94.1M
        break;
221
4.60M
      continue;
222
94.8M
    } // switch
223
94.8M
    break;
224
94.8M
  } // while
225
94.8M
  return LeftMost.getLocalSourceRange().getBegin();
226
94.8M
}
227
228
14.8M
SourceLocation TypeLoc::getEndLoc() const {
229
14.8M
  TypeLoc Cur = *this;
230
14.8M
  TypeLoc Last;
231
16.9M
  while (true) {
232
16.9M
    switch (Cur.getTypeLocClass()) {
233
14.8M
    default:
234
14.8M
      if (!Last)
235
13.5M
        Last = Cur;
236
14.8M
      return Last.getLocalSourceRange().getEnd();
237
57.3k
    case Paren:
238
57.3k
    case ConstantArray:
239
57.3k
    case DependentSizedArray:
240
57.3k
    case IncompleteArray:
241
57.3k
    case VariableArray:
242
57.3k
    case FunctionNoProto:
243
57.3k
      Last = Cur;
244
57.3k
      break;
245
459k
    case FunctionProto:
246
459k
      if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr()->hasTrailingReturn())
247
2.42k
        Last = TypeLoc();
248
456k
      else
249
456k
        Last = Cur;
250
459k
      break;
251
943k
    case Pointer:
252
943k
    case BlockPointer:
253
943k
    case MemberPointer:
254
943k
    case LValueReference:
255
943k
    case RValueReference:
256
943k
    case PackExpansion:
257
943k
      if (!Last)
258
863k
        Last = Cur;
259
943k
      break;
260
943k
    case Qualified:
261
722k
    case Elaborated:
262
722k
      break;
263
2.18M
    }
264
2.18M
    Cur = Cur.getNextTypeLoc();
265
2.18M
  }
266
14.8M
}
267
268
namespace {
269
270
struct TSTChecker : public TypeLocVisitor<TSTChecker, bool> {
271
  // Overload resolution does the real work for us.
272
1.33M
  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.33M
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
1.33M
    return isTypeSpec(TyLoc); \
279
1.33M
  }
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
56
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
56
    return isTypeSpec(TyLoc); \
279
56
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
277
5.85k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
5.85k
    return isTypeSpec(TyLoc); \
279
5.85k
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
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
8.94k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
8.94k
    return isTypeSpec(TyLoc); \
279
8.94k
  }
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
277
518k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
518k
    return isTypeSpec(TyLoc); \
279
518k
  }
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
801k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
801k
    return isTypeSpec(TyLoc); \
279
801k
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
277
173
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
278
173
    return isTypeSpec(TyLoc); \
279
173
  }
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.33M
bool TypeSpecTypeLoc::isKind(const TypeLoc &TL) {
294
1.33M
  if (TL.getType().hasLocalQualifiers()) 
return false0
;
295
1.33M
  return TSTChecker().Visit(TL);
296
1.33M
}
297
298
768
bool TagTypeLoc::isDefinition() const {
299
768
  TagDecl *D = getDecl();
300
768
  return D->isCompleteDefinition() &&
301
768
         
(718
D->getIdentifier() == nullptr718
||
D->getLocation() == getNameLoc()681
);
302
768
}
303
304
// Reimplemented to account for GNU/C++ extension
305
//     typeof unary-expression
306
// where there are no parentheses.
307
6.20k
SourceRange TypeOfExprTypeLoc::getLocalSourceRange() const {
308
6.20k
  if (getRParenLoc().isValid())
309
6.20k
    return SourceRange(getTypeofLoc(), getRParenLoc());
310
0
  else
311
0
    return SourceRange(getTypeofLoc(),
312
0
                       getUnderlyingExpr()->getSourceRange().getEnd());
313
6.20k
}
314
315
316
339k
TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const {
317
339k
  if (needsExtraLocalData())
318
339k
    return static_cast<TypeSpecifierType>(getWrittenBuiltinSpecs().Type);
319
0
  switch (getTypePtr()->getKind()) {
320
0
  case BuiltinType::Void:
321
0
    return TST_void;
322
0
  case BuiltinType::Bool:
323
0
    return TST_bool;
324
0
  case BuiltinType::Char_U:
325
0
  case BuiltinType::Char_S:
326
0
    return TST_char;
327
0
  case BuiltinType::Char8:
328
0
    return TST_char8;
329
0
  case BuiltinType::Char16:
330
0
    return TST_char16;
331
0
  case BuiltinType::Char32:
332
0
    return TST_char32;
333
0
  case BuiltinType::WChar_S:
334
0
  case BuiltinType::WChar_U:
335
0
    return TST_wchar;
336
0
  case BuiltinType::UChar:
337
0
  case BuiltinType::UShort:
338
0
  case BuiltinType::UInt:
339
0
  case BuiltinType::ULong:
340
0
  case BuiltinType::ULongLong:
341
0
  case BuiltinType::UInt128:
342
0
  case BuiltinType::SChar:
343
0
  case BuiltinType::Short:
344
0
  case BuiltinType::Int:
345
0
  case BuiltinType::Long:
346
0
  case BuiltinType::LongLong:
347
0
  case BuiltinType::Int128:
348
0
  case BuiltinType::Half:
349
0
  case BuiltinType::Float:
350
0
  case BuiltinType::Double:
351
0
  case BuiltinType::LongDouble:
352
0
  case BuiltinType::Float16:
353
0
  case BuiltinType::Float128:
354
0
  case BuiltinType::ShortAccum:
355
0
  case BuiltinType::Accum:
356
0
  case BuiltinType::LongAccum:
357
0
  case BuiltinType::UShortAccum:
358
0
  case BuiltinType::UAccum:
359
0
  case BuiltinType::ULongAccum:
360
0
  case BuiltinType::ShortFract:
361
0
  case BuiltinType::Fract:
362
0
  case BuiltinType::LongFract:
363
0
  case BuiltinType::UShortFract:
364
0
  case BuiltinType::UFract:
365
0
  case BuiltinType::ULongFract:
366
0
  case BuiltinType::SatShortAccum:
367
0
  case BuiltinType::SatAccum:
368
0
  case BuiltinType::SatLongAccum:
369
0
  case BuiltinType::SatUShortAccum:
370
0
  case BuiltinType::SatUAccum:
371
0
  case BuiltinType::SatULongAccum:
372
0
  case BuiltinType::SatShortFract:
373
0
  case BuiltinType::SatFract:
374
0
  case BuiltinType::SatLongFract:
375
0
  case BuiltinType::SatUShortFract:
376
0
  case BuiltinType::SatUFract:
377
0
  case BuiltinType::SatULongFract:
378
0
    llvm_unreachable("Builtin type needs extra local data!");
379
0
    // Fall through, if the impossible happens.
380
0
381
0
  case BuiltinType::NullPtr:
382
0
  case BuiltinType::Overload:
383
0
  case BuiltinType::Dependent:
384
0
  case BuiltinType::BoundMember:
385
0
  case BuiltinType::UnknownAny:
386
0
  case BuiltinType::ARCUnbridgedCast:
387
0
  case BuiltinType::PseudoObject:
388
0
  case BuiltinType::ObjCId:
389
0
  case BuiltinType::ObjCClass:
390
0
  case BuiltinType::ObjCSel:
391
0
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
392
0
  case BuiltinType::Id:
393
0
#include "clang/Basic/OpenCLImageTypes.def"
394
0
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
395
0
  case BuiltinType::Id:
396
0
#include "clang/Basic/OpenCLExtensionTypes.def"
397
0
  case BuiltinType::OCLSampler:
398
0
  case BuiltinType::OCLEvent:
399
0
  case BuiltinType::OCLClkEvent:
400
0
  case BuiltinType::OCLQueue:
401
0
  case BuiltinType::OCLReserveID:
402
0
#define SVE_TYPE(Name, Id, SingletonId) \
403
0
  case BuiltinType::Id:
404
0
#include "clang/Basic/AArch64SVEACLETypes.def"
405
0
  case BuiltinType::BuiltinFn:
406
0
  case BuiltinType::OMPArraySection:
407
0
    return TST_unspecified;
408
0
  }
409
0
410
0
  llvm_unreachable("Invalid BuiltinType Kind!");
411
0
}
412
413
154
TypeLoc TypeLoc::IgnoreParensImpl(TypeLoc TL) {
414
308
  while (ParenTypeLoc PTL = TL.getAs<ParenTypeLoc>())
415
154
    TL = PTL.getInnerLoc();
416
154
  return TL;
417
154
}
418
419
21
SourceLocation TypeLoc::findNullabilityLoc() const {
420
21
  if (auto ATL = getAs<AttributedTypeLoc>()) {
421
21
    const Attr *A = ATL.getAttr();
422
21
    if (A && (isa<TypeNullableAttr>(A) || isa<TypeNonNullAttr>(A) ||
423
21
              
isa<TypeNullUnspecifiedAttr>(A)0
))
424
21
      return A->getLocation();
425
0
  }
426
0
427
0
  return {};
428
0
}
429
430
198k
TypeLoc TypeLoc::findExplicitQualifierLoc() const {
431
198k
  // Qualified types.
432
198k
  if (auto qual = getAs<QualifiedTypeLoc>())
433
9
    return qual;
434
198k
435
198k
  TypeLoc loc = IgnoreParens();
436
198k
437
198k
  // Attributed types.
438
198k
  if (auto attr = loc.getAs<AttributedTypeLoc>()) {
439
23
    if (attr.isQualifier()) return attr;
440
0
    return attr.getModifiedLoc().findExplicitQualifierLoc();
441
0
  }
442
198k
443
198k
  // C11 _Atomic types.
444
198k
  if (auto atomic = loc.getAs<AtomicTypeLoc>()) {
445
0
    return atomic;
446
0
  }
447
198k
448
198k
  return {};
449
198k
}
450
451
void ObjCTypeParamTypeLoc::initializeLocal(ASTContext &Context,
452
151k
                                           SourceLocation Loc) {
453
151k
  setNameLoc(Loc);
454
151k
  if (!getNumProtocols()) 
return149k
;
455
2.30k
456
2.30k
  setProtocolLAngleLoc(Loc);
457
2.30k
  setProtocolRAngleLoc(Loc);
458
4.62k
  for (unsigned i = 0, e = getNumProtocols(); i != e; 
++i2.31k
)
459
2.31k
    setProtocolLoc(i, Loc);
460
2.30k
}
461
462
void ObjCObjectTypeLoc::initializeLocal(ASTContext &Context,
463
43.8k
                                        SourceLocation Loc) {
464
43.8k
  setHasBaseTypeAsWritten(true);
465
43.8k
  setTypeArgsLAngleLoc(Loc);
466
43.8k
  setTypeArgsRAngleLoc(Loc);
467
43.8k
  for (unsigned i = 0, e = getNumTypeArgs(); i != e; 
++i49
) {
468
49
    setTypeArgTInfo(i,
469
49
                   Context.getTrivialTypeSourceInfo(
470
49
                     getTypePtr()->getTypeArgsAsWritten()[i], Loc));
471
49
  }
472
43.8k
  setProtocolLAngleLoc(Loc);
473
43.8k
  setProtocolRAngleLoc(Loc);
474
43.8k
  for (unsigned i = 0, e = getNumProtocols(); i != e; 
++i9
)
475
9
    setProtocolLoc(i, Loc);
476
43.8k
}
477
478
977k
SourceRange AttributedTypeLoc::getLocalSourceRange() const {
479
977k
  // Note that this does *not* include the range of the attribute
480
977k
  // enclosure, e.g.:
481
977k
  //    __attribute__((foo(bar)))
482
977k
  //    ^~~~~~~~~~~~~~~        ~~
483
977k
  // or
484
977k
  //    [[foo(bar)]]
485
977k
  //    ^~        ~~
486
977k
  // That enclosure doesn't necessarily belong to a single attribute
487
977k
  // anyway.
488
977k
  return getAttr() ? 
getAttr()->getRange()977k
:
SourceRange()75
;
489
977k
}
490
491
void TypeOfTypeLoc::initializeLocal(ASTContext &Context,
492
2
                                       SourceLocation Loc) {
493
2
  TypeofLikeTypeLoc<TypeOfTypeLoc, TypeOfType, TypeOfTypeLocInfo>
494
2
      ::initializeLocal(Context, Loc);
495
2
  this->getLocalData()->UnderlyingTInfo = Context.getTrivialTypeSourceInfo(
496
2
      getUnderlyingType(), Loc);
497
2
}
498
499
void UnaryTransformTypeLoc::initializeLocal(ASTContext &Context,
500
5
                                       SourceLocation Loc) {
501
5
    setKWLoc(Loc);
502
5
    setRParenLoc(Loc);
503
5
    setLParenLoc(Loc);
504
5
    this->setUnderlyingTInfo(
505
5
        Context.getTrivialTypeSourceInfo(getTypePtr()->getBaseType(), Loc));
506
5
}
507
508
void ElaboratedTypeLoc::initializeLocal(ASTContext &Context,
509
4.59k
                                        SourceLocation Loc) {
510
4.59k
  setElaboratedKeywordLoc(Loc);
511
4.59k
  NestedNameSpecifierLocBuilder Builder;
512
4.59k
  Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
513
4.59k
  setQualifierLoc(Builder.getWithLocInContext(Context));
514
4.59k
}
515
516
void DependentNameTypeLoc::initializeLocal(ASTContext &Context,
517
217k
                                           SourceLocation Loc) {
518
217k
  setElaboratedKeywordLoc(Loc);
519
217k
  NestedNameSpecifierLocBuilder Builder;
520
217k
  Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
521
217k
  setQualifierLoc(Builder.getWithLocInContext(Context));
522
217k
  setNameLoc(Loc);
523
217k
}
524
525
void
526
DependentTemplateSpecializationTypeLoc::initializeLocal(ASTContext &Context,
527
103k
                                                        SourceLocation Loc) {
528
103k
  setElaboratedKeywordLoc(Loc);
529
103k
  if (getTypePtr()->getQualifier()) {
530
103k
    NestedNameSpecifierLocBuilder Builder;
531
103k
    Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
532
103k
    setQualifierLoc(Builder.getWithLocInContext(Context));
533
103k
  } else {
534
0
    setQualifierLoc(NestedNameSpecifierLoc());
535
0
  }
536
103k
  setTemplateKeywordLoc(Loc);
537
103k
  setTemplateNameLoc(Loc);
538
103k
  setLAngleLoc(Loc);
539
103k
  setRAngleLoc(Loc);
540
103k
  TemplateSpecializationTypeLoc::initializeArgLocs(Context, getNumArgs(),
541
103k
                                                   getTypePtr()->getArgs(),
542
103k
                                                   getArgInfos(), Loc);
543
103k
}
544
545
void TemplateSpecializationTypeLoc::initializeArgLocs(ASTContext &Context,
546
                                                      unsigned NumArgs,
547
                                                  const TemplateArgument *Args,
548
                                              TemplateArgumentLocInfo *ArgInfos,
549
839k
                                                      SourceLocation Loc) {
550
2.06M
  for (unsigned i = 0, e = NumArgs; i != e; 
++i1.22M
) {
551
1.22M
    switch (Args[i].getKind()) {
552
0
    case TemplateArgument::Null:
553
0
      llvm_unreachable("Impossible TemplateArgument");
554
0
555
14
    case TemplateArgument::Integral:
556
14
    case TemplateArgument::Declaration:
557
14
    case TemplateArgument::NullPtr:
558
14
      ArgInfos[i] = TemplateArgumentLocInfo();
559
14
      break;
560
14
561
596k
    case TemplateArgument::Expression:
562
596k
      ArgInfos[i] = TemplateArgumentLocInfo(Args[i].getAsExpr());
563
596k
      break;
564
14
565
608k
    case TemplateArgument::Type:
566
608k
      ArgInfos[i] = TemplateArgumentLocInfo(
567
608k
                          Context.getTrivialTypeSourceInfo(Args[i].getAsType(),
568
608k
                                                           Loc));
569
608k
      break;
570
14
571
5.20k
    case TemplateArgument::Template:
572
5.20k
    case TemplateArgument::TemplateExpansion: {
573
5.20k
      NestedNameSpecifierLocBuilder Builder;
574
5.20k
      TemplateName Template = Args[i].getAsTemplateOrTemplatePattern();
575
5.20k
      if (DependentTemplateName *DTN = Template.getAsDependentTemplateName())
576
34
        Builder.MakeTrivial(Context, DTN->getQualifier(), Loc);
577
5.16k
      else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName())
578
1
        Builder.MakeTrivial(Context, QTN->getQualifier(), Loc);
579
5.20k
580
5.20k
      ArgInfos[i] = TemplateArgumentLocInfo(
581
5.20k
          Builder.getWithLocInContext(Context), Loc,
582
5.20k
          Args[i].getKind() == TemplateArgument::Template ? 
SourceLocation()5.19k
583
5.20k
                                                          : 
Loc3
);
584
5.20k
      break;
585
5.20k
    }
586
5.20k
587
16.3k
    case TemplateArgument::Pack:
588
16.3k
      ArgInfos[i] = TemplateArgumentLocInfo();
589
16.3k
      break;
590
1.22M
    }
591
1.22M
  }
592
839k
}
593
594
2
DeclarationNameInfo AutoTypeLoc::getConceptNameInfo() const {
595
2
  return DeclarationNameInfo(getNamedConcept()->getDeclName(),
596
2
                             getLocalData()->ConceptNameLoc);
597
2
}
598
599
16.6k
void AutoTypeLoc::initializeLocal(ASTContext &Context, SourceLocation Loc) {
600
16.6k
  setNestedNameSpecifierLoc(NestedNameSpecifierLoc());
601
16.6k
  setTemplateKWLoc(Loc);
602
16.6k
  setConceptNameLoc(Loc);
603
16.6k
  setFoundDecl(nullptr);
604
16.6k
  setRAngleLoc(Loc);
605
16.6k
  setLAngleLoc(Loc);
606
16.6k
  TemplateSpecializationTypeLoc::initializeArgLocs(Context, getNumArgs(),
607
16.6k
                                                   getTypePtr()->getArgs(),
608
16.6k
                                                   getArgInfos(), Loc);
609
16.6k
  setNameLoc(Loc);
610
16.6k
}
611
612
613
namespace {
614
615
  class GetContainedAutoTypeLocVisitor :
616
    public TypeLocVisitor<GetContainedAutoTypeLocVisitor, TypeLoc> {
617
  public:
618
    using TypeLocVisitor<GetContainedAutoTypeLocVisitor, TypeLoc>::Visit;
619
620
149
    TypeLoc VisitAutoTypeLoc(AutoTypeLoc TL) {
621
149
      return TL;
622
149
    }
623
624
    // Only these types can contain the desired 'auto' type.
625
626
104
    TypeLoc VisitElaboratedTypeLoc(ElaboratedTypeLoc T) {
627
104
      return Visit(T.getNamedTypeLoc());
628
104
    }
629
630
140
    TypeLoc VisitQualifiedTypeLoc(QualifiedTypeLoc T) {
631
140
      return Visit(T.getUnqualifiedLoc());
632
140
    }
633
634
510
    TypeLoc VisitPointerTypeLoc(PointerTypeLoc T) {
635
510
      return Visit(T.getPointeeLoc());
636
510
    }
637
638
0
    TypeLoc VisitBlockPointerTypeLoc(BlockPointerTypeLoc T) {
639
0
      return Visit(T.getPointeeLoc());
640
0
    }
641
642
3.69k
    TypeLoc VisitReferenceTypeLoc(ReferenceTypeLoc T) {
643
3.69k
      return Visit(T.getPointeeLoc());
644
3.69k
    }
645
646
93
    TypeLoc VisitMemberPointerTypeLoc(MemberPointerTypeLoc T) {
647
93
      return Visit(T.getPointeeLoc());
648
93
    }
649
650
52
    TypeLoc VisitArrayTypeLoc(ArrayTypeLoc T) {
651
52
      return Visit(T.getElementLoc());
652
52
    }
653
654
288
    TypeLoc VisitFunctionTypeLoc(FunctionTypeLoc T) {
655
288
      return Visit(T.getReturnLoc());
656
288
    }
657
658
280
    TypeLoc VisitParenTypeLoc(ParenTypeLoc T) {
659
280
      return Visit(T.getInnerLoc());
660
280
    }
661
662
2
    TypeLoc VisitAttributedTypeLoc(AttributedTypeLoc T) {
663
2
      return Visit(T.getModifiedLoc());
664
2
    }
665
666
0
    TypeLoc VisitMacroQualifiedTypeLoc(MacroQualifiedTypeLoc T) {
667
0
      return Visit(T.getInnerLoc());
668
0
    }
669
670
0
    TypeLoc VisitAdjustedTypeLoc(AdjustedTypeLoc T) {
671
0
      return Visit(T.getOriginalLoc());
672
0
    }
673
674
75
    TypeLoc VisitPackExpansionTypeLoc(PackExpansionTypeLoc T) {
675
75
      return Visit(T.getPatternLoc());
676
75
    }
677
  };
678
679
} // namespace
680
681
324k
AutoTypeLoc TypeLoc::getContainedAutoTypeLoc() const {
682
324k
  TypeLoc Res = GetContainedAutoTypeLocVisitor().Visit(*this);
683
324k
  if (Res.isNull())
684
324k
    return AutoTypeLoc();
685
149
  return Res.getAs<AutoTypeLoc>();
686
149
}