Coverage Report

Created: 2022-01-18 06:27

/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
220M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
220M
    return TyLoc.getLocalSourceRange(); \
47
220M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
45
8.31k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
8.31k
    return TyLoc.getLocalSourceRange(); \
47
8.31k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc)
Line
Count
Source
45
3
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
3
    return TyLoc.getLocalSourceRange(); \
47
3
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDecayedTypeLoc(clang::DecayedTypeLoc)
Line
Count
Source
45
1.07k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.07k
    return TyLoc.getLocalSourceRange(); \
47
1.07k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
45
4.08k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
4.08k
    return TyLoc.getLocalSourceRange(); \
47
4.08k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
45
6.21k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
6.21k
    return TyLoc.getLocalSourceRange(); \
47
6.21k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
45
14.6k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
14.6k
    return TyLoc.getLocalSourceRange(); \
47
14.6k
  }
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
813
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
813
    return TyLoc.getLocalSourceRange(); \
47
813
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
45
763k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
763k
    return TyLoc.getLocalSourceRange(); \
47
763k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBitIntTypeLoc(clang::BitIntTypeLoc)
Line
Count
Source
45
1.31k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.31k
    return TyLoc.getLocalSourceRange(); \
47
1.31k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
45
32.8k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
32.8k
    return TyLoc.getLocalSourceRange(); \
47
32.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
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::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
45
2.87k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
2.87k
    return TyLoc.getLocalSourceRange(); \
47
2.87k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
45
530k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
530k
    return TyLoc.getLocalSourceRange(); \
47
530k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
45
78.0k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
78.0k
    return TyLoc.getLocalSourceRange(); \
47
78.0k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
45
9.53k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
9.53k
    return TyLoc.getLocalSourceRange(); \
47
9.53k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Line
Count
Source
45
46
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
46
    return TyLoc.getLocalSourceRange(); \
47
46
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentBitIntTypeLoc(clang::DependentBitIntTypeLoc)
Line
Count
Source
45
66
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
66
    return TyLoc.getLocalSourceRange(); \
47
66
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
45
4.36M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
4.36M
    return TyLoc.getLocalSourceRange(); \
47
4.36M
  }
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
95.4k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
95.4k
    return TyLoc.getLocalSourceRange(); \
47
95.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
660k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
660k
    return TyLoc.getLocalSourceRange(); \
47
660k
  }
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.33M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.33M
    return TyLoc.getLocalSourceRange(); \
47
1.33M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
45
1.76M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.76M
    return TyLoc.getLocalSourceRange(); \
47
1.76M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
45
419
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
419
    return TyLoc.getLocalSourceRange(); \
47
419
  }
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
488
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
488
    return TyLoc.getLocalSourceRange(); \
47
488
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
45
62.6k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
62.6k
    return TyLoc.getLocalSourceRange(); \
47
62.6k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
45
532k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
532k
    return TyLoc.getLocalSourceRange(); \
47
532k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
45
61.4k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
61.4k
    return TyLoc.getLocalSourceRange(); \
47
61.4k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
45
1.54M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.54M
    return TyLoc.getLocalSourceRange(); \
47
1.54M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
45
45.7k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
45.7k
    return TyLoc.getLocalSourceRange(); \
47
45.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
45
465k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
465k
    return TyLoc.getLocalSourceRange(); \
47
465k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
45
96.3k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
96.3k
    return TyLoc.getLocalSourceRange(); \
47
96.3k
  }
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.58M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.58M
    return TyLoc.getLocalSourceRange(); \
47
1.58M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
45
1.57M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.57M
    return TyLoc.getLocalSourceRange(); \
47
1.57M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
45
488k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
488k
    return TyLoc.getLocalSourceRange(); \
47
488k
  }
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
15.8M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
15.8M
    return TyLoc.getLocalSourceRange(); \
47
15.8M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
45
318k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
318k
    return TyLoc.getLocalSourceRange(); \
47
318k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
45
10.6M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
10.6M
    return TyLoc.getLocalSourceRange(); \
47
10.6M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
45
100M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
100M
    return TyLoc.getLocalSourceRange(); \
47
100M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
45
32.5M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
32.5M
    return TyLoc.getLocalSourceRange(); \
47
32.5M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
45
5.92k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
5.92k
    return TyLoc.getLocalSourceRange(); \
47
5.92k
  }
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.3M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
32.3M
    return TyLoc.getLocalSourceRange(); \
47
32.3M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
45
2.22k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
2.22k
    return TyLoc.getLocalSourceRange(); \
47
2.22k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
45
2.37k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
2.37k
    return TyLoc.getLocalSourceRange(); \
47
2.37k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUsingTypeLoc(clang::UsingTypeLoc)
Line
Count
Source
45
716k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
716k
    return TyLoc.getLocalSourceRange(); \
47
716k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
45
60.5k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
60.5k
    return TyLoc.getLocalSourceRange(); \
47
60.5k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
45
72
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
72
    return TyLoc.getLocalSourceRange(); \
47
72
  }
48
#include "clang/AST/TypeLocNodes.def"
49
};
50
51
} // namespace
52
53
220M
SourceRange TypeLoc::getLocalSourceRangeImpl(TypeLoc TL) {
54
220M
  if (TL.isNull()) 
return SourceRange()0
;
55
220M
  return TypeLocRanger().Visit(TL);
56
220M
}
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
404M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
404M
    return TyLoc.getLocalDataAlignment(); \
66
404M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
64
21.7M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
21.7M
    return TyLoc.getLocalDataAlignment(); \
66
21.7M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc)
Line
Count
Source
64
30
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
30
    return TyLoc.getLocalDataAlignment(); \
66
30
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDecayedTypeLoc(clang::DecayedTypeLoc)
Line
Count
Source
64
6.13k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
6.13k
    return TyLoc.getLocalDataAlignment(); \
66
6.13k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
64
521k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
521k
    return TyLoc.getLocalDataAlignment(); \
66
521k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
64
49.4k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
49.4k
    return TyLoc.getLocalDataAlignment(); \
66
49.4k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
64
134k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
134k
    return TyLoc.getLocalDataAlignment(); \
66
134k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
64
46.9k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
46.9k
    return TyLoc.getLocalDataAlignment(); \
66
46.9k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
64
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.34M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
4.34M
    return TyLoc.getLocalDataAlignment(); \
66
4.34M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBitIntTypeLoc(clang::BitIntTypeLoc)
Line
Count
Source
64
2.19k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
2.19k
    return TyLoc.getLocalDataAlignment(); \
66
2.19k
  }
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
35.5M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
35.5M
    return TyLoc.getLocalDataAlignment(); \
66
35.5M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
64
26.2k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
26.2k
    return TyLoc.getLocalDataAlignment(); \
66
26.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
64
803k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
803k
    return TyLoc.getLocalDataAlignment(); \
66
803k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
64
492k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
492k
    return TyLoc.getLocalDataAlignment(); \
66
492k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
64
3.91k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
3.91k
    return TyLoc.getLocalDataAlignment(); \
66
3.91k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Line
Count
Source
64
250
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
250
    return TyLoc.getLocalDataAlignment(); \
66
250
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentBitIntTypeLoc(clang::DependentBitIntTypeLoc)
Line
Count
Source
64
37
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
37
    return TyLoc.getLocalDataAlignment(); \
66
37
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
64
6.85M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
6.85M
    return TyLoc.getLocalDataAlignment(); \
66
6.85M
  }
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
158k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
158k
    return TyLoc.getLocalDataAlignment(); \
66
158k
  }
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.51M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
5.51M
    return TyLoc.getLocalDataAlignment(); \
66
5.51M
  }
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
34.6M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
34.6M
    return TyLoc.getLocalDataAlignment(); \
66
34.6M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
64
3.17M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
3.17M
    return TyLoc.getLocalDataAlignment(); \
66
3.17M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
64
211k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
211k
    return TyLoc.getLocalDataAlignment(); \
66
211k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Line
Count
Source
64
1.02k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.02k
    return TyLoc.getLocalDataAlignment(); \
66
1.02k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Line
Count
Source
64
543
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
543
    return TyLoc.getLocalDataAlignment(); \
66
543
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
64
57.8k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
57.8k
    return TyLoc.getLocalDataAlignment(); \
66
57.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
64
3.90M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
3.90M
    return TyLoc.getLocalDataAlignment(); \
66
3.90M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
64
1.33M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.33M
    return TyLoc.getLocalDataAlignment(); \
66
1.33M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
64
5.33M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
5.33M
    return TyLoc.getLocalDataAlignment(); \
66
5.33M
  }
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
933k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
933k
    return TyLoc.getLocalDataAlignment(); \
66
933k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
64
1.21M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.21M
    return TyLoc.getLocalDataAlignment(); \
66
1.21M
  }
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
11.8M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
11.8M
    return TyLoc.getLocalDataAlignment(); \
66
11.8M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
64
6.38M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
6.38M
    return TyLoc.getLocalDataAlignment(); \
66
6.38M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
64
1.65M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.65M
    return TyLoc.getLocalDataAlignment(); \
66
1.65M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
64
94.3k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
94.3k
    return TyLoc.getLocalDataAlignment(); \
66
94.3k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
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::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
64
1.72M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.72M
    return TyLoc.getLocalDataAlignment(); \
66
1.72M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
64
9.50M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
9.50M
    return TyLoc.getLocalDataAlignment(); \
66
9.50M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
64
23.7M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
23.7M
    return TyLoc.getLocalDataAlignment(); \
66
23.7M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
64
26.2M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
26.2M
    return TyLoc.getLocalDataAlignment(); \
66
26.2M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
64
12.6k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
12.6k
    return TyLoc.getLocalDataAlignment(); \
66
12.6k
  }
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
181M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
181M
    return TyLoc.getLocalDataAlignment(); \
66
181M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
64
3.73k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
3.73k
    return TyLoc.getLocalDataAlignment(); \
66
3.73k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
64
2.43k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
2.43k
    return TyLoc.getLocalDataAlignment(); \
66
2.43k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUsingTypeLoc(clang::UsingTypeLoc)
Line
Count
Source
64
915k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
915k
    return TyLoc.getLocalDataAlignment(); \
66
915k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
64
189k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
189k
    return TyLoc.getLocalDataAlignment(); \
66
189k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
64
4.28k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
4.28k
    return TyLoc.getLocalDataAlignment(); \
66
4.28k
  }
67
#include "clang/AST/TypeLocNodes.def"
68
};
69
70
} // namespace
71
72
/// Returns the alignment of the type source info data block.
73
404M
unsigned TypeLoc::getLocalAlignmentForType(QualType Ty) {
74
404M
  if (Ty.isNull()) 
return 10
;
75
404M
  return TypeAligner().Visit(TypeLoc(Ty, nullptr));
76
404M
}
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
258M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
258M
    return TyLoc.getLocalDataSize(); \
86
258M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
84
7.61M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
7.61M
    return TyLoc.getLocalDataSize(); \
86
7.61M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc)
Line
Count
Source
84
12
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
12
    return TyLoc.getLocalDataSize(); \
86
12
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDecayedTypeLoc(clang::DecayedTypeLoc)
Line
Count
Source
84
5.68k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
5.68k
    return TyLoc.getLocalDataSize(); \
86
5.68k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
84
390k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
390k
    return TyLoc.getLocalDataSize(); \
86
390k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
84
32.2k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
32.2k
    return TyLoc.getLocalDataSize(); \
86
32.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
84
72.2k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
72.2k
    return TyLoc.getLocalDataSize(); \
86
72.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
84
17.8k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
17.8k
    return TyLoc.getLocalDataSize(); \
86
17.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
84
8.59k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
8.59k
    return TyLoc.getLocalDataSize(); \
86
8.59k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
84
3.23M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
3.23M
    return TyLoc.getLocalDataSize(); \
86
3.23M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBitIntTypeLoc(clang::BitIntTypeLoc)
Line
Count
Source
84
1.22k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.22k
    return TyLoc.getLocalDataSize(); \
86
1.22k
  }
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
15.2M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
15.2M
    return TyLoc.getLocalDataSize(); \
86
15.2M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
84
11.4k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
11.4k
    return TyLoc.getLocalDataSize(); \
86
11.4k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
84
602k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
602k
    return TyLoc.getLocalDataSize(); \
86
602k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
84
329k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
329k
    return TyLoc.getLocalDataSize(); \
86
329k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
84
3.20k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
3.20k
    return TyLoc.getLocalDataSize(); \
86
3.20k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Line
Count
Source
84
82
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
82
    return TyLoc.getLocalDataSize(); \
86
82
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentBitIntTypeLoc(clang::DependentBitIntTypeLoc)
Line
Count
Source
84
37
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
37
    return TyLoc.getLocalDataSize(); \
86
37
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
84
5.34M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
5.34M
    return TyLoc.getLocalDataSize(); \
86
5.34M
  }
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
152k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
152k
    return TyLoc.getLocalDataSize(); \
86
152k
  }
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.10M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
4.10M
    return TyLoc.getLocalDataSize(); \
86
4.10M
  }
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
33.6M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
33.6M
    return TyLoc.getLocalDataSize(); \
86
33.6M
  }
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
211k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
211k
    return TyLoc.getLocalDataSize(); \
86
211k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Line
Count
Source
84
1.02k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.02k
    return TyLoc.getLocalDataSize(); \
86
1.02k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Line
Count
Source
84
543
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
543
    return TyLoc.getLocalDataSize(); \
86
543
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
84
53.0k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
53.0k
    return TyLoc.getLocalDataSize(); \
86
53.0k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
84
1.29M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.29M
    return TyLoc.getLocalDataSize(); \
86
1.29M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
84
792k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
792k
    return TyLoc.getLocalDataSize(); \
86
792k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
84
1.89M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.89M
    return TyLoc.getLocalDataSize(); \
86
1.89M
  }
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
933k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
933k
    return TyLoc.getLocalDataSize(); \
86
933k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
84
348k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
348k
    return TyLoc.getLocalDataSize(); \
86
348k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
84
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
9.06M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
9.06M
    return TyLoc.getLocalDataSize(); \
86
9.06M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
84
4.39M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
4.39M
    return TyLoc.getLocalDataSize(); \
86
4.39M
  }
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.9k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
89.9k
    return TyLoc.getLocalDataSize(); \
86
89.9k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
84
10.8M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
10.8M
    return TyLoc.getLocalDataSize(); \
86
10.8M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
84
598k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
598k
    return TyLoc.getLocalDataSize(); \
86
598k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
84
4.45M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
4.45M
    return TyLoc.getLocalDataSize(); \
86
4.45M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
84
19.8M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
19.8M
    return TyLoc.getLocalDataSize(); \
86
19.8M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
84
17.5M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
17.5M
    return TyLoc.getLocalDataSize(); \
86
17.5M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
84
3.85k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
3.85k
    return TyLoc.getLocalDataSize(); \
86
3.85k
  }
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
111M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
111M
    return TyLoc.getLocalDataSize(); \
86
111M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
84
3.72k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
3.72k
    return TyLoc.getLocalDataSize(); \
86
3.72k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
84
2.16k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
2.16k
    return TyLoc.getLocalDataSize(); \
86
2.16k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUsingTypeLoc(clang::UsingTypeLoc)
Line
Count
Source
84
533k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
533k
    return TyLoc.getLocalDataSize(); \
86
533k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
84
138k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
138k
    return TyLoc.getLocalDataSize(); \
86
138k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
84
4.28k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
4.28k
    return TyLoc.getLocalDataSize(); \
86
4.28k
  }
87
#include "clang/AST/TypeLocNodes.def"
88
};
89
90
} // namespace
91
92
/// Returns the size of the type source info data block.
93
190M
unsigned TypeLoc::getFullDataSizeForType(QualType Ty) {
94
190M
  unsigned Total = 0;
95
190M
  TypeLoc TyLoc(Ty, nullptr);
96
190M
  unsigned MaxAlign = 1;
97
448M
  while (!TyLoc.isNull()) {
98
258M
    unsigned Align = getLocalAlignmentForType(TyLoc.getType());
99
258M
    MaxAlign = std::max(Align, MaxAlign);
100
258M
    Total = llvm::alignTo(Total, Align);
101
258M
    Total += TypeSizer().Visit(TyLoc);
102
258M
    TyLoc = TyLoc.getNextTypeLoc();
103
258M
  }
104
190M
  Total = llvm::alignTo(Total, MaxAlign);
105
190M
  return Total;
106
190M
}
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
442M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
442M
    return TyLoc.getNextTypeLoc(); \
116
442M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
114
10.4M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
10.4M
    return TyLoc.getNextTypeLoc(); \
116
10.4M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc)
Line
Count
Source
114
16
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
16
    return TyLoc.getNextTypeLoc(); \
116
16
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDecayedTypeLoc(clang::DecayedTypeLoc)
Line
Count
Source
114
8.10k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
8.10k
    return TyLoc.getNextTypeLoc(); \
116
8.10k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
114
694k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
694k
    return TyLoc.getNextTypeLoc(); \
116
694k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
114
77.6k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
77.6k
    return TyLoc.getNextTypeLoc(); \
116
77.6k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
114
181k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
181k
    return TyLoc.getNextTypeLoc(); \
116
181k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
114
31.0k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
31.0k
    return TyLoc.getNextTypeLoc(); \
116
31.0k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
114
11.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::VisitBitIntTypeLoc(clang::BitIntTypeLoc)
Line
Count
Source
114
1.88k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.88k
    return TyLoc.getNextTypeLoc(); \
116
1.88k
  }
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
21.9M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
21.9M
    return TyLoc.getNextTypeLoc(); \
116
21.9M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
114
20.6k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
20.6k
    return TyLoc.getNextTypeLoc(); \
116
20.6k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
114
996k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
996k
    return TyLoc.getNextTypeLoc(); \
116
996k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
114
437k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
437k
    return TyLoc.getNextTypeLoc(); \
116
437k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
114
8.06k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
8.06k
    return TyLoc.getNextTypeLoc(); \
116
8.06k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Line
Count
Source
114
144
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
144
    return TyLoc.getNextTypeLoc(); \
116
144
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentBitIntTypeLoc(clang::DependentBitIntTypeLoc)
Line
Count
Source
114
70
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
70
    return TyLoc.getNextTypeLoc(); \
116
70
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
114
8.14M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
8.14M
    return TyLoc.getNextTypeLoc(); \
116
8.14M
  }
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
236k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
236k
    return TyLoc.getNextTypeLoc(); \
116
236k
  }
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.60M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
5.60M
    return TyLoc.getNextTypeLoc(); \
116
5.60M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
114
258k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
258k
    return TyLoc.getNextTypeLoc(); \
116
258k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
114
68.4M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
68.4M
    return TyLoc.getNextTypeLoc(); \
116
68.4M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
114
2.26M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
2.26M
    return TyLoc.getNextTypeLoc(); \
116
2.26M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
114
219k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
219k
    return TyLoc.getNextTypeLoc(); \
116
219k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Line
Count
Source
114
1.48k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.48k
    return TyLoc.getNextTypeLoc(); \
116
1.48k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Line
Count
Source
114
829
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
829
    return TyLoc.getNextTypeLoc(); \
116
829
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
114
184k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
184k
    return TyLoc.getNextTypeLoc(); \
116
184k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
114
3.02M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
3.02M
    return TyLoc.getNextTypeLoc(); \
116
3.02M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
114
860k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
860k
    return TyLoc.getNextTypeLoc(); \
116
860k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
114
2.62M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
2.62M
    return TyLoc.getNextTypeLoc(); \
116
2.62M
  }
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.90M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.90M
    return TyLoc.getNextTypeLoc(); \
116
1.90M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
114
827k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
827k
    return TyLoc.getNextTypeLoc(); \
116
827k
  }
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
18.7M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
18.7M
    return TyLoc.getNextTypeLoc(); \
116
18.7M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
114
8.45M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
8.45M
    return TyLoc.getNextTypeLoc(); \
116
8.45M
  }
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
141k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
141k
    return TyLoc.getNextTypeLoc(); \
116
141k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
114
22.6M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
22.6M
    return TyLoc.getNextTypeLoc(); \
116
22.6M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
114
789k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
789k
    return TyLoc.getNextTypeLoc(); \
116
789k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
114
10.6M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
10.6M
    return TyLoc.getNextTypeLoc(); \
116
10.6M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
114
77.8M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
77.8M
    return TyLoc.getNextTypeLoc(); \
116
77.8M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
114
36.5M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
36.5M
    return TyLoc.getNextTypeLoc(); \
116
36.5M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
114
7.18k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
7.18k
    return TyLoc.getNextTypeLoc(); \
116
7.18k
  }
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
129M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
129M
    return TyLoc.getNextTypeLoc(); \
116
129M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
114
6.02k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
6.02k
    return TyLoc.getNextTypeLoc(); \
116
6.02k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
114
4.18k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
4.18k
    return TyLoc.getNextTypeLoc(); \
116
4.18k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUsingTypeLoc(clang::UsingTypeLoc)
Line
Count
Source
114
1.00M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.00M
    return TyLoc.getNextTypeLoc(); \
116
1.00M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
114
168k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
168k
    return TyLoc.getNextTypeLoc(); \
116
168k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
114
4.92k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
4.92k
    return TyLoc.getNextTypeLoc(); \
116
4.92k
  }
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
442M
TypeLoc TypeLoc::getNextTypeLocImpl(TypeLoc TL) {
125
442M
  return NextLoc().Visit(TL);
126
442M
}
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
15.2M
                             SourceLocation Loc) {
133
18.7M
  while (
true18.7M
) {
134
18.7M
    switch (TL.getTypeLocClass()) {
135
0
#define ABSTRACT_TYPELOC(CLASS, PARENT)
136
0
#define TYPELOC(CLASS, PARENT)        \
137
3.54M
    case CLASS: {                     \
138
3.54M
      CLASS##TypeLoc TLCasted = TL.castAs<CLASS##TypeLoc>(); \
139
3.54M
      TLCasted.initializeLocal(Context, Loc);  \
140
3.54M
      TL = TLCasted.getNextTypeLoc(); \
141
18.7M
      if (!TL) 
return15.2M
; \
142
3.54M
      continue;                       \
143
3.54M
    }
144
18.7M
#include 
"clang/AST/TypeLocNodes.def"0
145
18.7M
    }
146
18.7M
  }
147
15.2M
}
148
149
namespace {
150
151
class TypeLocCopier : public TypeLocVisitor<TypeLocCopier> {
152
  TypeLoc Source;
153
154
public:
155
2.21k
  TypeLocCopier(TypeLoc source) : Source(source) {}
156
157
#define ABSTRACT_TYPELOC(CLASS, PARENT)
158
#define TYPELOC(CLASS, PARENT)                          \
159
2.21k
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
2.21k
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
2.21k
  }
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::VisitBitIntTypeLoc(clang::BitIntTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
159
734
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
734
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
734
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
159
4
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
4
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
4
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitAutoTypeLoc(clang::AutoTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentBitIntTypeLoc(clang::DependentBitIntTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
159
3
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
3
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
3
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
159
18
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
18
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
18
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
159
18
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
18
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
18
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
159
3
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
3
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
3
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPipeTypeLoc(clang::PipeTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
159
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
429
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
429
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
429
  }
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
914
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
914
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
914
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitUsingTypeLoc(clang::UsingTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
159
2
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
2
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
2
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
162
#include "clang/AST/TypeLocNodes.def"
163
};
164
165
} // namespace
166
167
182k
void TypeLoc::copy(TypeLoc other) {
168
182k
  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
182k
  if (reinterpret_cast<uintptr_t>(Data) ==
174
182k
          llvm::alignTo(reinterpret_cast<uintptr_t>(Data),
175
182k
                        TypeLocMaxDataAlign) &&
176
182k
      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.13k
  TypeLoc TL(getType(), Data);
185
2.21k
  do {
186
2.21k
    TypeLocCopier(other).Visit(TL);
187
2.21k
    other = other.getNextTypeLoc();
188
2.21k
  } while ((TL = TL.getNextTypeLoc()));
189
2.13k
}
190
191
99.6M
SourceLocation TypeLoc::getBeginLoc() const {
192
99.6M
  TypeLoc Cur = *this;
193
99.6M
  TypeLoc LeftMost = Cur;
194
110M
  while (true) {
195
110M
    switch (Cur.getTypeLocClass()) {
196
644k
    case Elaborated:
197
644k
      LeftMost = Cur;
198
644k
      break;
199
3.72M
    case FunctionProto:
200
3.72M
      if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr()
201
3.72M
              ->hasTrailingReturn()) {
202
14.3k
        LeftMost = Cur;
203
14.3k
        break;
204
14.3k
      }
205
3.72M
      
LLVM_FALLTHROUGH3.71M
;3.71M
206
3.74M
    case FunctionNoProto:
207
3.75M
    case ConstantArray:
208
3.77M
    case DependentSizedArray:
209
3.80M
    case IncompleteArray:
210
3.80M
    case VariableArray:
211
      // FIXME: Currently QualifiedTypeLoc does not have a source range
212
5.60M
    case Qualified:
213
5.60M
      Cur = Cur.getNextTypeLoc();
214
5.60M
      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
99.0M
        break;
221
4.73M
      continue;
222
110M
    } // switch
223
99.6M
    break;
224
110M
  } // while
225
99.6M
  return LeftMost.getLocalSourceRange().getBegin();
226
99.6M
}
227
228
16.4M
SourceLocation TypeLoc::getEndLoc() const {
229
16.4M
  TypeLoc Cur = *this;
230
16.4M
  TypeLoc Last;
231
18.8M
  while (true) {
232
18.8M
    switch (Cur.getTypeLocClass()) {
233
16.4M
    default:
234
16.4M
      if (!Last)
235
15.0M
        Last = Cur;
236
16.4M
      return Last.getLocalSourceRange().getEnd();
237
30.1k
    case Paren:
238
33.5k
    case ConstantArray:
239
39.8k
    case DependentSizedArray:
240
54.4k
    case IncompleteArray:
241
54.4k
    case VariableArray:
242
54.7k
    case FunctionNoProto:
243
      // The innermost type with suffix syntax always determines the end of the
244
      // type.
245
54.7k
      Last = Cur;
246
54.7k
      break;
247
529k
    case FunctionProto:
248
529k
      if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr()->hasTrailingReturn())
249
4.40k
        Last = TypeLoc();
250
525k
      else
251
525k
        Last = Cur;
252
529k
      break;
253
1.77k
    case ObjCObjectPointer:
254
      // `id` and `id<...>` have no star location.
255
1.77k
      if (Cur.castAs<ObjCObjectPointerTypeLoc>().getStarLoc().isInvalid())
256
130
        break;
257
1.77k
      
LLVM_FALLTHROUGH1.64k
;1.64k
258
466k
    case Pointer:
259
467k
    case BlockPointer:
260
506k
    case MemberPointer:
261
747k
    case LValueReference:
262
823k
    case RValueReference:
263
1.04M
    case PackExpansion:
264
      // Types with prefix syntax only determine the end of the type if there
265
      // is no suffix type.
266
1.04M
      if (!Last)
267
961k
        Last = Cur;
268
1.04M
      break;
269
318k
    case Qualified:
270
719k
    case Elaborated:
271
719k
      break;
272
18.8M
    }
273
2.34M
    Cur = Cur.getNextTypeLoc();
274
2.34M
  }
275
16.4M
}
276
277
namespace {
278
279
struct TSTChecker : public TypeLocVisitor<TSTChecker, bool> {
280
  // Overload resolution does the real work for us.
281
1.36M
  static bool isTypeSpec(TypeSpecTypeLoc _) { return true; }
282
0
  static bool isTypeSpec(TypeLoc _) { return false; }
283
284
#define ABSTRACT_TYPELOC(CLASS, PARENT)
285
#define TYPELOC(CLASS, PARENT) \
286
1.36M
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
1.36M
    return isTypeSpec(TyLoc); \
288
1.36M
  }
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::VisitBitIntTypeLoc(clang::BitIntTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitAutoTypeLoc(clang::AutoTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
286
63
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
63
    return isTypeSpec(TyLoc); \
288
63
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentBitIntTypeLoc(clang::DependentBitIntTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
286
6.20k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
6.20k
    return isTypeSpec(TyLoc); \
288
6.20k
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitParenTypeLoc(clang::ParenTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitPipeTypeLoc(clang::PipeTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitPointerTypeLoc(clang::PointerTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
286
10.1k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
10.1k
    return isTypeSpec(TyLoc); \
288
10.1k
  }
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
286
557k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
557k
    return isTypeSpec(TyLoc); \
288
557k
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
286
783k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
783k
    return isTypeSpec(TyLoc); \
288
783k
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
286
125
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
125
    return isTypeSpec(TyLoc); \
288
125
  }
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUsingTypeLoc(clang::UsingTypeLoc)
Line
Count
Source
286
9.28k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
9.28k
    return isTypeSpec(TyLoc); \
288
9.28k
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitVectorTypeLoc(clang::VectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
289
#include "clang/AST/TypeLocNodes.def"
290
};
291
292
} // namespace
293
294
/// Determines if the given type loc corresponds to a
295
/// TypeSpecTypeLoc.  Since there is not actually a TypeSpecType in
296
/// the type hierarchy, this is made somewhat complicated.
297
///
298
/// There are a lot of types that currently use TypeSpecTypeLoc
299
/// because it's a convenient base class.  Ideally we would not accept
300
/// those here, but ideally we would have better implementations for
301
/// them.
302
1.36M
bool TypeSpecTypeLoc::isKind(const TypeLoc &TL) {
303
1.36M
  if (TL.getType().hasLocalQualifiers()) 
return false0
;
304
1.36M
  return TSTChecker().Visit(TL);
305
1.36M
}
306
307
777
bool TagTypeLoc::isDefinition() const {
308
777
  TagDecl *D = getDecl();
309
777
  return D->isCompleteDefinition() &&
310
777
         
(727
D->getIdentifier() == nullptr727
||
D->getLocation() == getNameLoc()688
);
311
777
}
312
313
// Reimplemented to account for GNU/C++ extension
314
//     typeof unary-expression
315
// where there are no parentheses.
316
5.92k
SourceRange TypeOfExprTypeLoc::getLocalSourceRange() const {
317
5.92k
  if (getRParenLoc().isValid())
318
5.92k
    return SourceRange(getTypeofLoc(), getRParenLoc());
319
0
  else
320
0
    return SourceRange(getTypeofLoc(),
321
0
                       getUnderlyingExpr()->getSourceRange().getEnd());
322
5.92k
}
323
324
325
312k
TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const {
326
312k
  if (needsExtraLocalData())
327
312k
    return static_cast<TypeSpecifierType>(getWrittenBuiltinSpecs().Type);
328
0
  switch (getTypePtr()->getKind()) {
329
0
  case BuiltinType::Void:
330
0
    return TST_void;
331
0
  case BuiltinType::Bool:
332
0
    return TST_bool;
333
0
  case BuiltinType::Char_U:
334
0
  case BuiltinType::Char_S:
335
0
    return TST_char;
336
0
  case BuiltinType::Char8:
337
0
    return TST_char8;
338
0
  case BuiltinType::Char16:
339
0
    return TST_char16;
340
0
  case BuiltinType::Char32:
341
0
    return TST_char32;
342
0
  case BuiltinType::WChar_S:
343
0
  case BuiltinType::WChar_U:
344
0
    return TST_wchar;
345
0
  case BuiltinType::UChar:
346
0
  case BuiltinType::UShort:
347
0
  case BuiltinType::UInt:
348
0
  case BuiltinType::ULong:
349
0
  case BuiltinType::ULongLong:
350
0
  case BuiltinType::UInt128:
351
0
  case BuiltinType::SChar:
352
0
  case BuiltinType::Short:
353
0
  case BuiltinType::Int:
354
0
  case BuiltinType::Long:
355
0
  case BuiltinType::LongLong:
356
0
  case BuiltinType::Int128:
357
0
  case BuiltinType::Half:
358
0
  case BuiltinType::Float:
359
0
  case BuiltinType::Double:
360
0
  case BuiltinType::LongDouble:
361
0
  case BuiltinType::Float16:
362
0
  case BuiltinType::Float128:
363
0
  case BuiltinType::Ibm128:
364
0
  case BuiltinType::ShortAccum:
365
0
  case BuiltinType::Accum:
366
0
  case BuiltinType::LongAccum:
367
0
  case BuiltinType::UShortAccum:
368
0
  case BuiltinType::UAccum:
369
0
  case BuiltinType::ULongAccum:
370
0
  case BuiltinType::ShortFract:
371
0
  case BuiltinType::Fract:
372
0
  case BuiltinType::LongFract:
373
0
  case BuiltinType::UShortFract:
374
0
  case BuiltinType::UFract:
375
0
  case BuiltinType::ULongFract:
376
0
  case BuiltinType::SatShortAccum:
377
0
  case BuiltinType::SatAccum:
378
0
  case BuiltinType::SatLongAccum:
379
0
  case BuiltinType::SatUShortAccum:
380
0
  case BuiltinType::SatUAccum:
381
0
  case BuiltinType::SatULongAccum:
382
0
  case BuiltinType::SatShortFract:
383
0
  case BuiltinType::SatFract:
384
0
  case BuiltinType::SatLongFract:
385
0
  case BuiltinType::SatUShortFract:
386
0
  case BuiltinType::SatUFract:
387
0
  case BuiltinType::SatULongFract:
388
0
  case BuiltinType::BFloat16:
389
0
    llvm_unreachable("Builtin type needs extra local data!");
390
    // Fall through, if the impossible happens.
391
392
0
  case BuiltinType::NullPtr:
393
0
  case BuiltinType::Overload:
394
0
  case BuiltinType::Dependent:
395
0
  case BuiltinType::BoundMember:
396
0
  case BuiltinType::UnknownAny:
397
0
  case BuiltinType::ARCUnbridgedCast:
398
0
  case BuiltinType::PseudoObject:
399
0
  case BuiltinType::ObjCId:
400
0
  case BuiltinType::ObjCClass:
401
0
  case BuiltinType::ObjCSel:
402
0
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
403
0
  case BuiltinType::Id:
404
0
#include "clang/Basic/OpenCLImageTypes.def"
405
0
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
406
0
  case BuiltinType::Id:
407
0
#include "clang/Basic/OpenCLExtensionTypes.def"
408
0
  case BuiltinType::OCLSampler:
409
0
  case BuiltinType::OCLEvent:
410
0
  case BuiltinType::OCLClkEvent:
411
0
  case BuiltinType::OCLQueue:
412
0
  case BuiltinType::OCLReserveID:
413
0
#define SVE_TYPE(Name, Id, SingletonId) \
414
0
  case BuiltinType::Id:
415
0
#include "clang/Basic/AArch64SVEACLETypes.def"
416
0
#define PPC_VECTOR_TYPE(Name, Id, Size) \
417
0
  case BuiltinType::Id:
418
0
#include "clang/Basic/PPCTypes.def"
419
0
#define RVV_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
420
0
#include "clang/Basic/RISCVVTypes.def"
421
0
  case BuiltinType::BuiltinFn:
422
0
  case BuiltinType::IncompleteMatrixIdx:
423
0
  case BuiltinType::OMPArraySection:
424
0
  case BuiltinType::OMPArrayShaping:
425
0
  case BuiltinType::OMPIterator:
426
0
    return TST_unspecified;
427
0
  }
428
429
0
  llvm_unreachable("Invalid BuiltinType Kind!");
430
0
}
431
432
172
TypeLoc TypeLoc::IgnoreParensImpl(TypeLoc TL) {
433
344
  while (ParenTypeLoc PTL = TL.getAs<ParenTypeLoc>())
434
172
    TL = PTL.getInnerLoc();
435
172
  return TL;
436
172
}
437
438
25
SourceLocation TypeLoc::findNullabilityLoc() const {
439
25
  if (auto ATL = getAs<AttributedTypeLoc>()) {
440
25
    const Attr *A = ATL.getAttr();
441
25
    if (A && (isa<TypeNullableAttr>(A) || isa<TypeNonNullAttr>(A) ||
442
25
              
isa<TypeNullUnspecifiedAttr>(A)0
))
443
25
      return A->getLocation();
444
25
  }
445
446
0
  return {};
447
25
}
448
449
158k
TypeLoc TypeLoc::findExplicitQualifierLoc() const {
450
  // Qualified types.
451
158k
  if (auto qual = getAs<QualifiedTypeLoc>())
452
9
    return qual;
453
454
158k
  TypeLoc loc = IgnoreParens();
455
456
  // Attributed types.
457
158k
  if (auto attr = loc.getAs<AttributedTypeLoc>()) {
458
23
    if (attr.isQualifier()) return attr;
459
0
    return attr.getModifiedLoc().findExplicitQualifierLoc();
460
23
  }
461
462
  // C11 _Atomic types.
463
158k
  if (auto atomic = loc.getAs<AtomicTypeLoc>()) {
464
0
    return atomic;
465
0
  }
466
467
158k
  return {};
468
158k
}
469
470
void ObjCTypeParamTypeLoc::initializeLocal(ASTContext &Context,
471
129k
                                           SourceLocation Loc) {
472
129k
  setNameLoc(Loc);
473
129k
  if (!getNumProtocols()) 
return127k
;
474
475
1.74k
  setProtocolLAngleLoc(Loc);
476
1.74k
  setProtocolRAngleLoc(Loc);
477
3.48k
  for (unsigned i = 0, e = getNumProtocols(); i != e; 
++i1.74k
)
478
1.74k
    setProtocolLoc(i, Loc);
479
1.74k
}
480
481
void ObjCObjectTypeLoc::initializeLocal(ASTContext &Context,
482
57.1k
                                        SourceLocation Loc) {
483
57.1k
  setHasBaseTypeAsWritten(true);
484
57.1k
  setTypeArgsLAngleLoc(Loc);
485
57.1k
  setTypeArgsRAngleLoc(Loc);
486
57.3k
  for (unsigned i = 0, e = getNumTypeArgs(); i != e; 
++i169
) {
487
169
    setTypeArgTInfo(i,
488
169
                   Context.getTrivialTypeSourceInfo(
489
169
                     getTypePtr()->getTypeArgsAsWritten()[i], Loc));
490
169
  }
491
57.1k
  setProtocolLAngleLoc(Loc);
492
57.1k
  setProtocolRAngleLoc(Loc);
493
57.1k
  for (unsigned i = 0, e = getNumProtocols(); i != e; 
++i11
)
494
11
    setProtocolLoc(i, Loc);
495
57.1k
}
496
497
763k
SourceRange AttributedTypeLoc::getLocalSourceRange() const {
498
  // Note that this does *not* include the range of the attribute
499
  // enclosure, e.g.:
500
  //    __attribute__((foo(bar)))
501
  //    ^~~~~~~~~~~~~~~        ~~
502
  // or
503
  //    [[foo(bar)]]
504
  //    ^~        ~~
505
  // That enclosure doesn't necessarily belong to a single attribute
506
  // anyway.
507
763k
  return getAttr() ? 
getAttr()->getRange()763k
:
SourceRange()159
;
508
763k
}
509
510
void TypeOfTypeLoc::initializeLocal(ASTContext &Context,
511
2
                                       SourceLocation Loc) {
512
2
  TypeofLikeTypeLoc<TypeOfTypeLoc, TypeOfType, TypeOfTypeLocInfo>
513
2
      ::initializeLocal(Context, Loc);
514
2
  this->getLocalData()->UnderlyingTInfo = Context.getTrivialTypeSourceInfo(
515
2
      getUnderlyingType(), Loc);
516
2
}
517
518
void UnaryTransformTypeLoc::initializeLocal(ASTContext &Context,
519
131
                                       SourceLocation Loc) {
520
131
    setKWLoc(Loc);
521
131
    setRParenLoc(Loc);
522
131
    setLParenLoc(Loc);
523
131
    this->setUnderlyingTInfo(
524
131
        Context.getTrivialTypeSourceInfo(getTypePtr()->getBaseType(), Loc));
525
131
}
526
527
void ElaboratedTypeLoc::initializeLocal(ASTContext &Context,
528
82.0k
                                        SourceLocation Loc) {
529
82.0k
  setElaboratedKeywordLoc(Loc);
530
82.0k
  NestedNameSpecifierLocBuilder Builder;
531
82.0k
  Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
532
82.0k
  setQualifierLoc(Builder.getWithLocInContext(Context));
533
82.0k
}
534
535
void DependentNameTypeLoc::initializeLocal(ASTContext &Context,
536
520k
                                           SourceLocation Loc) {
537
520k
  setElaboratedKeywordLoc(Loc);
538
520k
  NestedNameSpecifierLocBuilder Builder;
539
520k
  Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
540
520k
  setQualifierLoc(Builder.getWithLocInContext(Context));
541
520k
  setNameLoc(Loc);
542
520k
}
543
544
void
545
DependentTemplateSpecializationTypeLoc::initializeLocal(ASTContext &Context,
546
26.8k
                                                        SourceLocation Loc) {
547
26.8k
  setElaboratedKeywordLoc(Loc);
548
26.8k
  if (getTypePtr()->getQualifier()) {
549
26.8k
    NestedNameSpecifierLocBuilder Builder;
550
26.8k
    Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
551
26.8k
    setQualifierLoc(Builder.getWithLocInContext(Context));
552
26.8k
  } else {
553
0
    setQualifierLoc(NestedNameSpecifierLoc());
554
0
  }
555
26.8k
  setTemplateKeywordLoc(Loc);
556
26.8k
  setTemplateNameLoc(Loc);
557
26.8k
  setLAngleLoc(Loc);
558
26.8k
  setRAngleLoc(Loc);
559
26.8k
  TemplateSpecializationTypeLoc::initializeArgLocs(Context, getNumArgs(),
560
26.8k
                                                   getTypePtr()->getArgs(),
561
26.8k
                                                   getArgInfos(), Loc);
562
26.8k
}
563
564
void TemplateSpecializationTypeLoc::initializeArgLocs(ASTContext &Context,
565
                                                      unsigned NumArgs,
566
                                                  const TemplateArgument *Args,
567
                                              TemplateArgumentLocInfo *ArgInfos,
568
1.43M
                                                      SourceLocation Loc) {
569
3.83M
  for (unsigned i = 0, e = NumArgs; i != e; 
++i2.40M
) {
570
2.40M
    switch (Args[i].getKind()) {
571
0
    case TemplateArgument::Null:
572
0
      llvm_unreachable("Impossible TemplateArgument");
573
574
16
    case TemplateArgument::Integral:
575
19
    case TemplateArgument::Declaration:
576
22
    case TemplateArgument::NullPtr:
577
22
      ArgInfos[i] = TemplateArgumentLocInfo();
578
22
      break;
579
580
850k
    case TemplateArgument::Expression:
581
850k
      ArgInfos[i] = TemplateArgumentLocInfo(Args[i].getAsExpr());
582
850k
      break;
583
584
1.52M
    case TemplateArgument::Type:
585
1.52M
      ArgInfos[i] = TemplateArgumentLocInfo(
586
1.52M
                          Context.getTrivialTypeSourceInfo(Args[i].getAsType(),
587
1.52M
                                                           Loc));
588
1.52M
      break;
589
590
5.74k
    case TemplateArgument::Template:
591
5.75k
    case TemplateArgument::TemplateExpansion: {
592
5.75k
      NestedNameSpecifierLocBuilder Builder;
593
5.75k
      TemplateName Template = Args[i].getAsTemplateOrTemplatePattern();
594
5.75k
      if (DependentTemplateName *DTN = Template.getAsDependentTemplateName())
595
36
        Builder.MakeTrivial(Context, DTN->getQualifier(), Loc);
596
5.71k
      else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName())
597
2
        Builder.MakeTrivial(Context, QTN->getQualifier(), Loc);
598
599
5.75k
      ArgInfos[i] = TemplateArgumentLocInfo(
600
5.75k
          Context, Builder.getWithLocInContext(Context), Loc,
601
5.75k
          Args[i].getKind() == TemplateArgument::Template ? 
SourceLocation()5.74k
602
5.75k
                                                          : 
Loc3
);
603
5.75k
      break;
604
5.74k
    }
605
606
18.2k
    case TemplateArgument::Pack:
607
18.2k
      ArgInfos[i] = TemplateArgumentLocInfo();
608
18.2k
      break;
609
2.40M
    }
610
2.40M
  }
611
1.43M
}
612
613
8
DeclarationNameInfo AutoTypeLoc::getConceptNameInfo() const {
614
8
  return DeclarationNameInfo(getNamedConcept()->getDeclName(),
615
8
                             getLocalData()->ConceptNameLoc);
616
8
}
617
618
32.6k
void AutoTypeLoc::initializeLocal(ASTContext &Context, SourceLocation Loc) {
619
32.6k
  setNestedNameSpecifierLoc(NestedNameSpecifierLoc());
620
32.6k
  setTemplateKWLoc(Loc);
621
32.6k
  setConceptNameLoc(Loc);
622
32.6k
  setFoundDecl(nullptr);
623
32.6k
  setRAngleLoc(Loc);
624
32.6k
  setLAngleLoc(Loc);
625
32.6k
  setRParenLoc(Loc);
626
32.6k
  TemplateSpecializationTypeLoc::initializeArgLocs(Context, getNumArgs(),
627
32.6k
                                                   getTypePtr()->getArgs(),
628
32.6k
                                                   getArgInfos(), Loc);
629
32.6k
  setNameLoc(Loc);
630
32.6k
}
631
632
633
namespace {
634
635
  class GetContainedAutoTypeLocVisitor :
636
    public TypeLocVisitor<GetContainedAutoTypeLocVisitor, TypeLoc> {
637
  public:
638
    using TypeLocVisitor<GetContainedAutoTypeLocVisitor, TypeLoc>::Visit;
639
640
244
    TypeLoc VisitAutoTypeLoc(AutoTypeLoc TL) {
641
244
      return TL;
642
244
    }
643
644
    // Only these types can contain the desired 'auto' type.
645
646
95
    TypeLoc VisitElaboratedTypeLoc(ElaboratedTypeLoc T) {
647
95
      return Visit(T.getNamedTypeLoc());
648
95
    }
649
650
230
    TypeLoc VisitQualifiedTypeLoc(QualifiedTypeLoc T) {
651
230
      return Visit(T.getUnqualifiedLoc());
652
230
    }
653
654
13.8k
    TypeLoc VisitPointerTypeLoc(PointerTypeLoc T) {
655
13.8k
      return Visit(T.getPointeeLoc());
656
13.8k
    }
657
658
0
    TypeLoc VisitBlockPointerTypeLoc(BlockPointerTypeLoc T) {
659
0
      return Visit(T.getPointeeLoc());
660
0
    }
661
662
2.26k
    TypeLoc VisitReferenceTypeLoc(ReferenceTypeLoc T) {
663
2.26k
      return Visit(T.getPointeeLoc());
664
2.26k
    }
665
666
111
    TypeLoc VisitMemberPointerTypeLoc(MemberPointerTypeLoc T) {
667
111
      return Visit(T.getPointeeLoc());
668
111
    }
669
670
71
    TypeLoc VisitArrayTypeLoc(ArrayTypeLoc T) {
671
71
      return Visit(T.getElementLoc());
672
71
    }
673
674
341
    TypeLoc VisitFunctionTypeLoc(FunctionTypeLoc T) {
675
341
      return Visit(T.getReturnLoc());
676
341
    }
677
678
336
    TypeLoc VisitParenTypeLoc(ParenTypeLoc T) {
679
336
      return Visit(T.getInnerLoc());
680
336
    }
681
682
2
    TypeLoc VisitAttributedTypeLoc(AttributedTypeLoc T) {
683
2
      return Visit(T.getModifiedLoc());
684
2
    }
685
686
0
    TypeLoc VisitMacroQualifiedTypeLoc(MacroQualifiedTypeLoc T) {
687
0
      return Visit(T.getInnerLoc());
688
0
    }
689
690
0
    TypeLoc VisitAdjustedTypeLoc(AdjustedTypeLoc T) {
691
0
      return Visit(T.getOriginalLoc());
692
0
    }
693
694
98
    TypeLoc VisitPackExpansionTypeLoc(PackExpansionTypeLoc T) {
695
98
      return Visit(T.getPatternLoc());
696
98
    }
697
  };
698
699
} // namespace
700
701
332k
AutoTypeLoc TypeLoc::getContainedAutoTypeLoc() const {
702
332k
  TypeLoc Res = GetContainedAutoTypeLocVisitor().Visit(*this);
703
332k
  if (Res.isNull())
704
332k
    return AutoTypeLoc();
705
244
  return Res.getAs<AutoTypeLoc>();
706
332k
}