Coverage Report

Created: 2022-07-16 07:03

/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
284M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
284M
    return TyLoc.getLocalSourceRange(); \
47
284M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
45
9.22k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
9.22k
    return TyLoc.getLocalSourceRange(); \
47
9.22k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::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.26k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
4.26k
    return TyLoc.getLocalSourceRange(); \
47
4.26k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
45
9.64k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
9.64k
    return TyLoc.getLocalSourceRange(); \
47
9.64k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
45
18.7k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
18.7k
    return TyLoc.getLocalSourceRange(); \
47
18.7k
  }
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
897
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
897
    return TyLoc.getLocalSourceRange(); \
47
897
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
45
774k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
774k
    return TyLoc.getLocalSourceRange(); \
47
774k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBTFTagAttributedTypeLoc(clang::BTFTagAttributedTypeLoc)
Line
Count
Source
45
20
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
20
    return TyLoc.getLocalSourceRange(); \
47
20
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBitIntTypeLoc(clang::BitIntTypeLoc)
Line
Count
Source
45
970
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
970
    return TyLoc.getLocalSourceRange(); \
47
970
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
45
33.1k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
33.1k
    return TyLoc.getLocalSourceRange(); \
47
33.1k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
45
13.1M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
13.1M
    return TyLoc.getLocalSourceRange(); \
47
13.1M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
45
2.99k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
2.99k
    return TyLoc.getLocalSourceRange(); \
47
2.99k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
45
923k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
923k
    return TyLoc.getLocalSourceRange(); \
47
923k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
45
97.0k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
97.0k
    return TyLoc.getLocalSourceRange(); \
47
97.0k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
45
12.3k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
12.3k
    return TyLoc.getLocalSourceRange(); \
47
12.3k
  }
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
200
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
200
    return TyLoc.getLocalSourceRange(); \
47
200
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
45
5.73M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
5.73M
    return TyLoc.getLocalSourceRange(); \
47
5.73M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Line
Count
Source
45
368
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
368
    return TyLoc.getLocalSourceRange(); \
47
368
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Line
Count
Source
45
82.1k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
82.1k
    return TyLoc.getLocalSourceRange(); \
47
82.1k
  }
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
926k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
926k
    return TyLoc.getLocalSourceRange(); \
47
926k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
45
246
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
246
    return TyLoc.getLocalSourceRange(); \
47
246
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
45
1.47M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.47M
    return TyLoc.getLocalSourceRange(); \
47
1.47M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
45
2.15M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
2.15M
    return TyLoc.getLocalSourceRange(); \
47
2.15M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
45
440
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
440
    return TyLoc.getLocalSourceRange(); \
47
440
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Line
Count
Source
45
294
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
294
    return TyLoc.getLocalSourceRange(); \
47
294
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Line
Count
Source
45
496
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
496
    return TyLoc.getLocalSourceRange(); \
47
496
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
45
67.7k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
67.7k
    return TyLoc.getLocalSourceRange(); \
47
67.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
45
539k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
539k
    return TyLoc.getLocalSourceRange(); \
47
539k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
45
62.2k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
62.2k
    return TyLoc.getLocalSourceRange(); \
47
62.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
45
1.56M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
1.56M
    return TyLoc.getLocalSourceRange(); \
47
1.56M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
45
46.4k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
46.4k
    return TyLoc.getLocalSourceRange(); \
47
46.4k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
45
457k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
457k
    return TyLoc.getLocalSourceRange(); \
47
457k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
45
104k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
104k
    return TyLoc.getLocalSourceRange(); \
47
104k
  }
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
2.01M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
2.01M
    return TyLoc.getLocalSourceRange(); \
47
2.01M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
45
2.31M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
2.31M
    return TyLoc.getLocalSourceRange(); \
47
2.31M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
45
758k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
758k
    return TyLoc.getLocalSourceRange(); \
47
758k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
45
20.1k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
20.1k
    return TyLoc.getLocalSourceRange(); \
47
20.1k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
45
20.1M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
20.1M
    return TyLoc.getLocalSourceRange(); \
47
20.1M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
45
518k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
518k
    return TyLoc.getLocalSourceRange(); \
47
518k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
45
14.9M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
14.9M
    return TyLoc.getLocalSourceRange(); \
47
14.9M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
45
133M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
133M
    return TyLoc.getLocalSourceRange(); \
47
133M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
45
42.2M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
42.2M
    return TyLoc.getLocalSourceRange(); \
47
42.2M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
45
6.22k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
6.22k
    return TyLoc.getLocalSourceRange(); \
47
6.22k
  }
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
38.6M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
38.6M
    return TyLoc.getLocalSourceRange(); \
47
38.6M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
45
2.52k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
2.52k
    return TyLoc.getLocalSourceRange(); \
47
2.52k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
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::VisitUsingTypeLoc(clang::UsingTypeLoc)
Line
Count
Source
45
957k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
46
957k
    return TyLoc.getLocalSourceRange(); \
47
957k
  }
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
284M
SourceRange TypeLoc::getLocalSourceRangeImpl(TypeLoc TL) {
54
284M
  if (TL.isNull()) 
return SourceRange()0
;
55
284M
  return TypeLocRanger().Visit(TL);
56
284M
}
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
426M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
426M
    return TyLoc.getLocalDataAlignment(); \
66
426M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
64
24.2M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
24.2M
    return TyLoc.getLocalDataAlignment(); \
66
24.2M
  }
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.35k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
6.35k
    return TyLoc.getLocalDataAlignment(); \
66
6.35k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
64
551k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
551k
    return TyLoc.getLocalDataAlignment(); \
66
551k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
64
58.3k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
58.3k
    return TyLoc.getLocalDataAlignment(); \
66
58.3k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
64
145k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
145k
    return TyLoc.getLocalDataAlignment(); \
66
145k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
64
47.1k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
47.1k
    return TyLoc.getLocalDataAlignment(); \
66
47.1k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
64
11.0k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
11.0k
    return TyLoc.getLocalDataAlignment(); \
66
11.0k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
64
4.46M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
4.46M
    return TyLoc.getLocalDataAlignment(); \
66
4.46M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBTFTagAttributedTypeLoc(clang::BTFTagAttributedTypeLoc)
Line
Count
Source
64
217
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
217
    return TyLoc.getLocalDataAlignment(); \
66
217
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBitIntTypeLoc(clang::BitIntTypeLoc)
Line
Count
Source
64
2.03k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
2.03k
    return TyLoc.getLocalDataAlignment(); \
66
2.03k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
64
190k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
190k
    return TyLoc.getLocalDataAlignment(); \
66
190k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
64
39.9M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
39.9M
    return TyLoc.getLocalDataAlignment(); \
66
39.9M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
64
43.9k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
43.9k
    return TyLoc.getLocalDataAlignment(); \
66
43.9k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
64
973k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
973k
    return TyLoc.getLocalDataAlignment(); \
66
973k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
64
716k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
716k
    return TyLoc.getLocalDataAlignment(); \
66
716k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
64
7.14k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
7.14k
    return TyLoc.getLocalDataAlignment(); \
66
7.14k
  }
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
187
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
187
    return TyLoc.getLocalDataAlignment(); \
66
187
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
64
9.47M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
9.47M
    return TyLoc.getLocalDataAlignment(); \
66
9.47M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Line
Count
Source
64
300
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
300
    return TyLoc.getLocalDataAlignment(); \
66
300
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Line
Count
Source
64
130k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
130k
    return TyLoc.getLocalDataAlignment(); \
66
130k
  }
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
6.78M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
6.78M
    return TyLoc.getLocalDataAlignment(); \
66
6.78M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
64
10.2k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
10.2k
    return TyLoc.getLocalDataAlignment(); \
66
10.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
64
33.6M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
33.6M
    return TyLoc.getLocalDataAlignment(); \
66
33.6M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
64
4.11M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
4.11M
    return TyLoc.getLocalDataAlignment(); \
66
4.11M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
64
244k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
244k
    return TyLoc.getLocalDataAlignment(); \
66
244k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Line
Count
Source
64
1.03k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.03k
    return TyLoc.getLocalDataAlignment(); \
66
1.03k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Line
Count
Source
64
554
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
554
    return TyLoc.getLocalDataAlignment(); \
66
554
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
64
60.2k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
60.2k
    return TyLoc.getLocalDataAlignment(); \
66
60.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
64
3.96M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
3.96M
    return TyLoc.getLocalDataAlignment(); \
66
3.96M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
64
1.35M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.35M
    return TyLoc.getLocalDataAlignment(); \
66
1.35M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
64
5.41M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
5.41M
    return TyLoc.getLocalDataAlignment(); \
66
5.41M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
64
224k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
224k
    return TyLoc.getLocalDataAlignment(); \
66
224k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
64
862k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
862k
    return TyLoc.getLocalDataAlignment(); \
66
862k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
64
1.27M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.27M
    return TyLoc.getLocalDataAlignment(); \
66
1.27M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
64
273
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
273
    return TyLoc.getLocalDataAlignment(); \
66
273
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
64
12.2M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
12.2M
    return TyLoc.getLocalDataAlignment(); \
66
12.2M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
64
8.59M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
8.59M
    return TyLoc.getLocalDataAlignment(); \
66
8.59M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
64
2.32M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
2.32M
    return TyLoc.getLocalDataAlignment(); \
66
2.32M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
64
46.8k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
46.8k
    return TyLoc.getLocalDataAlignment(); \
66
46.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
64
17.1M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
17.1M
    return TyLoc.getLocalDataAlignment(); \
66
17.1M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
64
1.58M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.58M
    return TyLoc.getLocalDataAlignment(); \
66
1.58M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
64
10.8M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
10.8M
    return TyLoc.getLocalDataAlignment(); \
66
10.8M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
64
31.9M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
31.9M
    return TyLoc.getLocalDataAlignment(); \
66
31.9M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
64
33.5M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
33.5M
    return TyLoc.getLocalDataAlignment(); \
66
33.5M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
64
13.4k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
13.4k
    return TyLoc.getLocalDataAlignment(); \
66
13.4k
  }
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
167M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
167M
    return TyLoc.getLocalDataAlignment(); \
66
167M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
64
4.16k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
4.16k
    return TyLoc.getLocalDataAlignment(); \
66
4.16k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
64
3.04k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
3.04k
    return TyLoc.getLocalDataAlignment(); \
66
3.04k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUsingTypeLoc(clang::UsingTypeLoc)
Line
Count
Source
64
1.24M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
1.24M
    return TyLoc.getLocalDataAlignment(); \
66
1.24M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
64
192k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
192k
    return TyLoc.getLocalDataAlignment(); \
66
192k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
64
5.26k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
65
5.26k
    return TyLoc.getLocalDataAlignment(); \
66
5.26k
  }
67
#include "clang/AST/TypeLocNodes.def"
68
};
69
70
} // namespace
71
72
/// Returns the alignment of the type source info data block.
73
426M
unsigned TypeLoc::getLocalAlignmentForType(QualType Ty) {
74
426M
  if (Ty.isNull()) 
return 10
;
75
426M
  return TypeAligner().Visit(TypeLoc(Ty, nullptr));
76
426M
}
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
272M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
272M
    return TyLoc.getLocalDataSize(); \
86
272M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
84
8.37M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
8.37M
    return TyLoc.getLocalDataSize(); \
86
8.37M
  }
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.80k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
5.80k
    return TyLoc.getLocalDataSize(); \
86
5.80k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
84
412k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
412k
    return TyLoc.getLocalDataSize(); \
86
412k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
84
40.1k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
40.1k
    return TyLoc.getLocalDataSize(); \
86
40.1k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
84
79.5k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
79.5k
    return TyLoc.getLocalDataSize(); \
86
79.5k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
84
17.9k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
17.9k
    return TyLoc.getLocalDataSize(); \
86
17.9k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
84
9.78k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
9.78k
    return TyLoc.getLocalDataSize(); \
86
9.78k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
84
3.28M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
3.28M
    return TyLoc.getLocalDataSize(); \
86
3.28M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBTFTagAttributedTypeLoc(clang::BTFTagAttributedTypeLoc)
Line
Count
Source
84
64
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
64
    return TyLoc.getLocalDataSize(); \
86
64
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBitIntTypeLoc(clang::BitIntTypeLoc)
Line
Count
Source
84
1.36k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.36k
    return TyLoc.getLocalDataSize(); \
86
1.36k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
84
62.7k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
62.7k
    return TyLoc.getLocalDataSize(); \
86
62.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
84
17.0M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
17.0M
    return TyLoc.getLocalDataSize(); \
86
17.0M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
84
20.8k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
20.8k
    return TyLoc.getLocalDataSize(); \
86
20.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
84
728k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
728k
    return TyLoc.getLocalDataSize(); \
86
728k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
84
526k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
526k
    return TyLoc.getLocalDataSize(); \
86
526k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
84
5.37k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
5.37k
    return TyLoc.getLocalDataSize(); \
86
5.37k
  }
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
179
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
179
    return TyLoc.getLocalDataSize(); \
86
179
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
84
7.31M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
7.31M
    return TyLoc.getLocalDataSize(); \
86
7.31M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Line
Count
Source
84
300
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
300
    return TyLoc.getLocalDataSize(); \
86
300
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Line
Count
Source
84
124k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
124k
    return TyLoc.getLocalDataSize(); \
86
124k
  }
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
5.03M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
5.03M
    return TyLoc.getLocalDataSize(); \
86
5.03M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
84
9.53k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
9.53k
    return TyLoc.getLocalDataSize(); \
86
9.53k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
84
32.5M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
32.5M
    return TyLoc.getLocalDataSize(); \
86
32.5M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
84
1.61M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.61M
    return TyLoc.getLocalDataSize(); \
86
1.61M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
84
242k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
242k
    return TyLoc.getLocalDataSize(); \
86
242k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Line
Count
Source
84
1.03k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.03k
    return TyLoc.getLocalDataSize(); \
86
1.03k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Line
Count
Source
84
554
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
554
    return TyLoc.getLocalDataSize(); \
86
554
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
84
55.2k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
55.2k
    return TyLoc.getLocalDataSize(); \
86
55.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
84
1.31M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.31M
    return TyLoc.getLocalDataSize(); \
86
1.31M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
84
803k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
803k
    return TyLoc.getLocalDataSize(); \
86
803k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
84
1.91M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.91M
    return TyLoc.getLocalDataSize(); \
86
1.91M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
84
133k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
133k
    return TyLoc.getLocalDataSize(); \
86
133k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
84
862k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
862k
    return TyLoc.getLocalDataSize(); \
86
862k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
84
369k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
369k
    return TyLoc.getLocalDataSize(); \
86
369k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
84
261
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
261
    return TyLoc.getLocalDataSize(); \
86
261
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
84
9.26M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
9.26M
    return TyLoc.getLocalDataSize(); \
86
9.26M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
84
5.92M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
5.92M
    return TyLoc.getLocalDataSize(); \
86
5.92M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
84
1.63M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
1.63M
    return TyLoc.getLocalDataSize(); \
86
1.63M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
84
42.8k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
42.8k
    return TyLoc.getLocalDataSize(); \
86
42.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
84
13.9M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
13.9M
    return TyLoc.getLocalDataSize(); \
86
13.9M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
84
560k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
560k
    return TyLoc.getLocalDataSize(); \
86
560k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
84
5.17M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
5.17M
    return TyLoc.getLocalDataSize(); \
86
5.17M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
84
26.3M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
26.3M
    return TyLoc.getLocalDataSize(); \
86
26.3M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
84
22.9M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
22.9M
    return TyLoc.getLocalDataSize(); \
86
22.9M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
84
4.11k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
4.11k
    return TyLoc.getLocalDataSize(); \
86
4.11k
  }
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
102M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
102M
    return TyLoc.getLocalDataSize(); \
86
102M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
84
4.15k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
4.15k
    return TyLoc.getLocalDataSize(); \
86
4.15k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
84
2.62k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
2.62k
    return TyLoc.getLocalDataSize(); \
86
2.62k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUsingTypeLoc(clang::UsingTypeLoc)
Line
Count
Source
84
770k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
770k
    return TyLoc.getLocalDataSize(); \
86
770k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
84
142k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
142k
    return TyLoc.getLocalDataSize(); \
86
142k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
84
5.26k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
85
5.26k
    return TyLoc.getLocalDataSize(); \
86
5.26k
  }
87
#include "clang/AST/TypeLocNodes.def"
88
};
89
90
} // namespace
91
92
/// Returns the size of the type source info data block.
93
201M
unsigned TypeLoc::getFullDataSizeForType(QualType Ty) {
94
201M
  unsigned Total = 0;
95
201M
  TypeLoc TyLoc(Ty, nullptr);
96
201M
  unsigned MaxAlign = 1;
97
473M
  while (!TyLoc.isNull()) {
98
272M
    unsigned Align = getLocalAlignmentForType(TyLoc.getType());
99
272M
    MaxAlign = std::max(Align, MaxAlign);
100
272M
    Total = llvm::alignTo(Total, Align);
101
272M
    Total += TypeSizer().Visit(TyLoc);
102
272M
    TyLoc = TyLoc.getNextTypeLoc();
103
272M
  }
104
201M
  Total = llvm::alignTo(Total, MaxAlign);
105
201M
  return Total;
106
201M
}
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
496M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
496M
    return TyLoc.getNextTypeLoc(); \
116
496M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
114
12.3M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
12.3M
    return TyLoc.getNextTypeLoc(); \
116
12.3M
  }
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.22k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
8.22k
    return TyLoc.getNextTypeLoc(); \
116
8.22k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
114
732k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
732k
    return TyLoc.getNextTypeLoc(); \
116
732k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
114
99.9k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
99.9k
    return TyLoc.getNextTypeLoc(); \
116
99.9k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
114
202k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
202k
    return TyLoc.getNextTypeLoc(); \
116
202k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
114
31.2k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
31.2k
    return TyLoc.getNextTypeLoc(); \
116
31.2k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
114
12.5k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
12.5k
    return TyLoc.getNextTypeLoc(); \
116
12.5k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
114
4.19M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
4.19M
    return TyLoc.getNextTypeLoc(); \
116
4.19M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBTFTagAttributedTypeLoc(clang::BTFTagAttributedTypeLoc)
Line
Count
Source
114
104
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
104
    return TyLoc.getNextTypeLoc(); \
116
104
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBitIntTypeLoc(clang::BitIntTypeLoc)
Line
Count
Source
114
1.96k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.96k
    return TyLoc.getNextTypeLoc(); \
116
1.96k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
114
160k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
160k
    return TyLoc.getNextTypeLoc(); \
116
160k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
114
25.2M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
25.2M
    return TyLoc.getNextTypeLoc(); \
116
25.2M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
114
39.3k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
39.3k
    return TyLoc.getNextTypeLoc(); \
116
39.3k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
114
1.35M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.35M
    return TyLoc.getNextTypeLoc(); \
116
1.35M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
114
690k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
690k
    return TyLoc.getNextTypeLoc(); \
116
690k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
114
11.9k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
11.9k
    return TyLoc.getNextTypeLoc(); \
116
11.9k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::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
280
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
280
    return TyLoc.getNextTypeLoc(); \
116
280
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
114
11.0M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
11.0M
    return TyLoc.getNextTypeLoc(); \
116
11.0M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Line
Count
Source
114
489
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
489
    return TyLoc.getNextTypeLoc(); \
116
489
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Line
Count
Source
114
193k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
193k
    return TyLoc.getNextTypeLoc(); \
116
193k
  }
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
7.05M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
7.05M
    return TyLoc.getNextTypeLoc(); \
116
7.05M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
114
25.8k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
25.8k
    return TyLoc.getNextTypeLoc(); \
116
25.8k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
114
65.9M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
65.9M
    return TyLoc.getNextTypeLoc(); \
116
65.9M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
114
2.88M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
2.88M
    return TyLoc.getNextTypeLoc(); \
116
2.88M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
114
251k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
251k
    return TyLoc.getNextTypeLoc(); \
116
251k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Line
Count
Source
114
1.49k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.49k
    return TyLoc.getNextTypeLoc(); \
116
1.49k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Line
Count
Source
114
845
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
845
    return TyLoc.getNextTypeLoc(); \
116
845
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
114
194k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
194k
    return TyLoc.getNextTypeLoc(); \
116
194k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
114
3.06M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
3.06M
    return TyLoc.getNextTypeLoc(); \
116
3.06M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
114
873k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
873k
    return TyLoc.getNextTypeLoc(); \
116
873k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
114
2.66M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
2.66M
    return TyLoc.getNextTypeLoc(); \
116
2.66M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
114
158k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
158k
    return TyLoc.getNextTypeLoc(); \
116
158k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
114
1.81M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.81M
    return TyLoc.getNextTypeLoc(); \
116
1.81M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
114
875k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
875k
    return TyLoc.getNextTypeLoc(); \
116
875k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
114
537
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
537
    return TyLoc.getNextTypeLoc(); \
116
537
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
114
19.0M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
19.0M
    return TyLoc.getNextTypeLoc(); \
116
19.0M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
114
11.5M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
11.5M
    return TyLoc.getNextTypeLoc(); \
116
11.5M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
114
3.16M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
3.16M
    return TyLoc.getNextTypeLoc(); \
116
3.16M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
114
70.2k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
70.2k
    return TyLoc.getNextTypeLoc(); \
116
70.2k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
114
29.0M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
29.0M
    return TyLoc.getNextTypeLoc(); \
116
29.0M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
114
868k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
868k
    return TyLoc.getNextTypeLoc(); \
116
868k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
114
13.6M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
13.6M
    return TyLoc.getNextTypeLoc(); \
116
13.6M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
114
103M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
103M
    return TyLoc.getNextTypeLoc(); \
116
103M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
114
47.3M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
47.3M
    return TyLoc.getNextTypeLoc(); \
116
47.3M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
114
7.58k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
7.58k
    return TyLoc.getNextTypeLoc(); \
116
7.58k
  }
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
124M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
124M
    return TyLoc.getNextTypeLoc(); \
116
124M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
114
6.76k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
6.76k
    return TyLoc.getNextTypeLoc(); \
116
6.76k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
114
5.11k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
5.11k
    return TyLoc.getNextTypeLoc(); \
116
5.11k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUsingTypeLoc(clang::UsingTypeLoc)
Line
Count
Source
114
1.44M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
1.44M
    return TyLoc.getNextTypeLoc(); \
116
1.44M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
114
172k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
172k
    return TyLoc.getNextTypeLoc(); \
116
172k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
114
6.00k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
115
6.00k
    return TyLoc.getNextTypeLoc(); \
116
6.00k
  }
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
496M
TypeLoc TypeLoc::getNextTypeLocImpl(TypeLoc TL) {
125
496M
  return NextLoc().Visit(TL);
126
496M
}
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
21.4M
                             SourceLocation Loc) {
133
27.0M
  while (
true27.0M
) {
134
27.0M
    switch (TL.getTypeLocClass()) {
135
0
#define ABSTRACT_TYPELOC(CLASS, PARENT)
136
0
#define TYPELOC(CLASS, PARENT)        \
137
5.58M
    case CLASS: {                     \
138
5.58M
      CLASS##TypeLoc TLCasted = TL.castAs<CLASS##TypeLoc>(); \
139
5.58M
      TLCasted.initializeLocal(Context, Loc);  \
140
5.58M
      TL = TLCasted.getNextTypeLoc(); \
141
27.0M
      if (!TL) 
return21.4M
; \
142
5.58M
      continue;                       \
143
5.58M
    }
144
27.0M
#include 
"clang/AST/TypeLocNodes.def"0
145
27.0M
    }
146
27.0M
  }
147
21.4M
}
148
149
namespace {
150
151
class TypeLocCopier : public TypeLocVisitor<TypeLocCopier> {
152
  TypeLoc Source;
153
154
public:
155
2.73k
  TypeLocCopier(TypeLoc source) : Source(source) {}
156
157
#define ABSTRACT_TYPELOC(CLASS, PARENT)
158
#define TYPELOC(CLASS, PARENT)                          \
159
2.73k
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
2.73k
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
2.73k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
159
4
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
4
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
4
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDecayedTypeLoc(clang::DecayedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
159
1
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
1
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
1
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitBTFTagAttributedTypeLoc(clang::BTFTagAttributedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitBitIntTypeLoc(clang::BitIntTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
159
919
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
919
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
919
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
159
4
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
4
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
4
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitAutoTypeLoc(clang::AutoTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentBitIntTypeLoc(clang::DependentBitIntTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
159
3
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
3
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
3
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitConstantMatrixTypeLoc(clang::ConstantMatrixTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentSizedMatrixTypeLoc(clang::DependentSizedMatrixTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
159
18
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
18
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
18
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
159
18
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
18
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
18
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
159
3
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
3
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
3
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPipeTypeLoc(clang::PipeTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
159
41
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
41
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
41
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitEnumTypeLoc(clang::EnumTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
159
49
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
49
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
49
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
159
454
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
454
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
454
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
159
1
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
1
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
1
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
159
1.22k
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
160
1.22k
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
161
1.22k
  }
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
185k
void TypeLoc::copy(TypeLoc other) {
168
185k
  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
185k
  if (reinterpret_cast<uintptr_t>(Data) ==
174
185k
          llvm::alignTo(reinterpret_cast<uintptr_t>(Data),
175
185k
                        TypeLocMaxDataAlign) &&
176
185k
      reinterpret_cast<uintptr_t>(other.Data) ==
177
182k
          llvm::alignTo(reinterpret_cast<uintptr_t>(other.Data),
178
182k
                        TypeLocMaxDataAlign)) {
179
182k
    memcpy(Data, other.Data, getFullDataSize());
180
182k
    return;
181
182k
  }
182
183
  // Copy each of the pieces.
184
2.64k
  TypeLoc TL(getType(), Data);
185
2.73k
  do {
186
2.73k
    TypeLocCopier(other).Visit(TL);
187
2.73k
    other = other.getNextTypeLoc();
188
2.73k
  } while ((TL = TL.getNextTypeLoc()));
189
2.64k
}
190
191
129M
SourceLocation TypeLoc::getBeginLoc() const {
192
129M
  TypeLoc Cur = *this;
193
129M
  TypeLoc LeftMost = Cur;
194
142M
  while (true) {
195
142M
    switch (Cur.getTypeLocClass()) {
196
908k
    case Elaborated:
197
908k
      LeftMost = Cur;
198
908k
      break;
199
4.61M
    case FunctionProto:
200
4.61M
      if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr()
201
4.61M
              ->hasTrailingReturn()) {
202
19.3k
        LeftMost = Cur;
203
19.3k
        break;
204
19.3k
      }
205
4.61M
      
LLVM_FALLTHROUGH4.59M
;4.59M
206
4.60M
    case FunctionNoProto:
207
4.62M
    case ConstantArray:
208
4.64M
    case DependentSizedArray:
209
4.68M
    case IncompleteArray:
210
4.68M
    case VariableArray:
211
      // FIXME: Currently QualifiedTypeLoc does not have a source range
212
7.12M
    case Qualified:
213
7.12M
      Cur = Cur.getNextTypeLoc();
214
7.12M
      continue;
215
134M
    default:
216
134M
      if (Cur.getLocalSourceRange().getBegin().isValid())
217
133M
        LeftMost = Cur;
218
134M
      Cur = Cur.getNextTypeLoc();
219
134M
      if (Cur.isNull())
220
128M
        break;
221
5.94M
      continue;
222
142M
    } // switch
223
129M
    break;
224
142M
  } // while
225
129M
  return LeftMost.getLocalSourceRange().getBegin();
226
129M
}
227
228
20.3M
SourceLocation TypeLoc::getEndLoc() const {
229
20.3M
  TypeLoc Cur = *this;
230
20.3M
  TypeLoc Last;
231
23.3M
  while (true) {
232
23.3M
    switch (Cur.getTypeLocClass()) {
233
20.3M
    default:
234
20.3M
      if (!Last)
235
18.6M
        Last = Cur;
236
20.3M
      return Last.getLocalSourceRange().getEnd();
237
33.5k
    case Paren:
238
37.1k
    case ConstantArray:
239
46.8k
    case DependentSizedArray:
240
65.5k
    case IncompleteArray:
241
65.6k
    case VariableArray:
242
65.8k
    case FunctionNoProto:
243
      // The innermost type with suffix syntax always determines the end of the
244
      // type.
245
65.8k
      Last = Cur;
246
65.8k
      break;
247
568k
    case FunctionProto:
248
568k
      if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr()->hasTrailingReturn())
249
4.35k
        Last = TypeLoc();
250
563k
      else
251
563k
        Last = Cur;
252
568k
      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
579k
    case Pointer:
259
580k
    case BlockPointer:
260
621k
    case MemberPointer:
261
977k
    case LValueReference:
262
1.10M
    case RValueReference:
263
1.32M
    case PackExpansion:
264
      // Types with prefix syntax only determine the end of the type if there
265
      // is no suffix type.
266
1.32M
      if (!Last)
267
1.22M
        Last = Cur;
268
1.32M
      break;
269
454k
    case Qualified:
270
994k
    case Elaborated:
271
994k
      break;
272
23.3M
    }
273
2.95M
    Cur = Cur.getNextTypeLoc();
274
2.95M
  }
275
20.3M
}
276
277
namespace {
278
279
struct TSTChecker : public TypeLocVisitor<TSTChecker, bool> {
280
  // Overload resolution does the real work for us.
281
1.67M
  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.67M
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
1.67M
    return isTypeSpec(TyLoc); \
288
1.67M
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDecayedTypeLoc(clang::DecayedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitBTFTagAttributedTypeLoc(clang::BTFTagAttributedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitBitIntTypeLoc(clang::BitIntTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitAutoTypeLoc(clang::AutoTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
286
115
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
115
    return isTypeSpec(TyLoc); \
288
115
  }
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
18.9k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
18.9k
    return isTypeSpec(TyLoc); \
288
18.9k
  }
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.6k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
10.6k
    return isTypeSpec(TyLoc); \
288
10.6k
  }
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
286
619k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
619k
    return isTypeSpec(TyLoc); \
288
619k
  }
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
1.01M
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
1.01M
    return isTypeSpec(TyLoc); \
288
1.01M
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
286
122
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
122
    return isTypeSpec(TyLoc); \
288
122
  }
TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUsingTypeLoc(clang::UsingTypeLoc)
Line
Count
Source
286
10.1k
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
287
10.1k
    return isTypeSpec(TyLoc); \
288
10.1k
  }
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.67M
bool TypeSpecTypeLoc::isKind(const TypeLoc &TL) {
303
1.67M
  if (TL.getType().hasLocalQualifiers()) 
return false0
;
304
1.67M
  return TSTChecker().Visit(TL);
305
1.67M
}
306
307
770
bool TagTypeLoc::isDefinition() const {
308
770
  TagDecl *D = getDecl();
309
770
  return D->isCompleteDefinition() &&
310
770
         
(720
D->getIdentifier() == nullptr720
||
D->getLocation() == getNameLoc()682
);
311
770
}
312
313
// Reimplemented to account for GNU/C++ extension
314
//     typeof unary-expression
315
// where there are no parentheses.
316
6.22k
SourceRange TypeOfExprTypeLoc::getLocalSourceRange() const {
317
6.22k
  if (getRParenLoc().isValid())
318
6.22k
    return SourceRange(getTypeofLoc(), getRParenLoc());
319
0
  else
320
0
    return SourceRange(getTypeofLoc(),
321
0
                       getUnderlyingExpr()->getSourceRange().getEnd());
322
6.22k
}
323
324
325
335k
TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const {
326
335k
  if (needsExtraLocalData())
327
335k
    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
173
TypeLoc TypeLoc::IgnoreParensImpl(TypeLoc TL) {
433
346
  while (ParenTypeLoc PTL = TL.getAs<ParenTypeLoc>())
434
173
    TL = PTL.getInnerLoc();
435
173
  return TL;
436
173
}
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
160k
TypeLoc TypeLoc::findExplicitQualifierLoc() const {
450
  // Qualified types.
451
160k
  if (auto qual = getAs<QualifiedTypeLoc>())
452
9
    return qual;
453
454
160k
  TypeLoc loc = IgnoreParens();
455
456
  // Attributed types.
457
160k
  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
160k
  if (auto atomic = loc.getAs<AtomicTypeLoc>()) {
464
0
    return atomic;
465
0
  }
466
467
160k
  return {};
468
160k
}
469
470
void ObjCTypeParamTypeLoc::initializeLocal(ASTContext &Context,
471
130k
                                           SourceLocation Loc) {
472
130k
  setNameLoc(Loc);
473
130k
  if (!getNumProtocols()) 
return129k
;
474
475
1.76k
  setProtocolLAngleLoc(Loc);
476
1.76k
  setProtocolRAngleLoc(Loc);
477
3.53k
  for (unsigned i = 0, e = getNumProtocols(); i != e; 
++i1.76k
)
478
1.76k
    setProtocolLoc(i, Loc);
479
1.76k
}
480
481
void ObjCObjectTypeLoc::initializeLocal(ASTContext &Context,
482
58.3k
                                        SourceLocation Loc) {
483
58.3k
  setHasBaseTypeAsWritten(true);
484
58.3k
  setTypeArgsLAngleLoc(Loc);
485
58.3k
  setTypeArgsRAngleLoc(Loc);
486
58.5k
  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
58.3k
  setProtocolLAngleLoc(Loc);
492
58.3k
  setProtocolRAngleLoc(Loc);
493
58.3k
  for (unsigned i = 0, e = getNumProtocols(); i != e; 
++i11
)
494
11
    setProtocolLoc(i, Loc);
495
58.3k
}
496
497
774k
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
774k
  return getAttr() ? 
getAttr()->getRange()774k
:
SourceRange()231
;
508
774k
}
509
510
20
SourceRange BTFTagAttributedTypeLoc::getLocalSourceRange() const {
511
20
  return getAttr() ? getAttr()->getRange() : 
SourceRange()0
;
512
20
}
513
514
void TypeOfTypeLoc::initializeLocal(ASTContext &Context,
515
2
                                       SourceLocation Loc) {
516
2
  TypeofLikeTypeLoc<TypeOfTypeLoc, TypeOfType, TypeOfTypeLocInfo>
517
2
      ::initializeLocal(Context, Loc);
518
2
  this->getLocalData()->UnderlyingTInfo = Context.getTrivialTypeSourceInfo(
519
2
      getUnderlyingType(), Loc);
520
2
}
521
522
void UnaryTransformTypeLoc::initializeLocal(ASTContext &Context,
523
194
                                       SourceLocation Loc) {
524
194
    setKWLoc(Loc);
525
194
    setRParenLoc(Loc);
526
194
    setLParenLoc(Loc);
527
194
    this->setUnderlyingTInfo(
528
194
        Context.getTrivialTypeSourceInfo(getTypePtr()->getBaseType(), Loc));
529
194
}
530
531
void ElaboratedTypeLoc::initializeLocal(ASTContext &Context,
532
178k
                                        SourceLocation Loc) {
533
178k
  setElaboratedKeywordLoc(Loc);
534
178k
  NestedNameSpecifierLocBuilder Builder;
535
178k
  Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
536
178k
  setQualifierLoc(Builder.getWithLocInContext(Context));
537
178k
}
538
539
void DependentNameTypeLoc::initializeLocal(ASTContext &Context,
540
944k
                                           SourceLocation Loc) {
541
944k
  setElaboratedKeywordLoc(Loc);
542
944k
  NestedNameSpecifierLocBuilder Builder;
543
944k
  Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
544
944k
  setQualifierLoc(Builder.getWithLocInContext(Context));
545
944k
  setNameLoc(Loc);
546
944k
}
547
548
void
549
DependentTemplateSpecializationTypeLoc::initializeLocal(ASTContext &Context,
550
19.6k
                                                        SourceLocation Loc) {
551
19.6k
  setElaboratedKeywordLoc(Loc);
552
19.6k
  if (getTypePtr()->getQualifier()) {
553
19.6k
    NestedNameSpecifierLocBuilder Builder;
554
19.6k
    Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
555
19.6k
    setQualifierLoc(Builder.getWithLocInContext(Context));
556
19.6k
  } else {
557
0
    setQualifierLoc(NestedNameSpecifierLoc());
558
0
  }
559
19.6k
  setTemplateKeywordLoc(Loc);
560
19.6k
  setTemplateNameLoc(Loc);
561
19.6k
  setLAngleLoc(Loc);
562
19.6k
  setRAngleLoc(Loc);
563
19.6k
  TemplateSpecializationTypeLoc::initializeArgLocs(Context, getNumArgs(),
564
19.6k
                                                   getTypePtr()->getArgs(),
565
19.6k
                                                   getArgInfos(), Loc);
566
19.6k
}
567
568
void TemplateSpecializationTypeLoc::initializeArgLocs(ASTContext &Context,
569
                                                      unsigned NumArgs,
570
                                                  const TemplateArgument *Args,
571
                                              TemplateArgumentLocInfo *ArgInfos,
572
2.49M
                                                      SourceLocation Loc) {
573
6.66M
  for (unsigned i = 0, e = NumArgs; i != e; 
++i4.17M
) {
574
4.17M
    switch (Args[i].getKind()) {
575
0
    case TemplateArgument::Null:
576
0
      llvm_unreachable("Impossible TemplateArgument");
577
578
21
    case TemplateArgument::Integral:
579
24
    case TemplateArgument::Declaration:
580
27
    case TemplateArgument::NullPtr:
581
27
      ArgInfos[i] = TemplateArgumentLocInfo();
582
27
      break;
583
584
1.19M
    case TemplateArgument::Expression:
585
1.19M
      ArgInfos[i] = TemplateArgumentLocInfo(Args[i].getAsExpr());
586
1.19M
      break;
587
588
2.95M
    case TemplateArgument::Type:
589
2.95M
      ArgInfos[i] = TemplateArgumentLocInfo(
590
2.95M
                          Context.getTrivialTypeSourceInfo(Args[i].getAsType(),
591
2.95M
                                                           Loc));
592
2.95M
      break;
593
594
7.80k
    case TemplateArgument::Template:
595
7.81k
    case TemplateArgument::TemplateExpansion: {
596
7.81k
      NestedNameSpecifierLocBuilder Builder;
597
7.81k
      TemplateName Template = Args[i].getAsTemplateOrTemplatePattern();
598
7.81k
      if (DependentTemplateName *DTN = Template.getAsDependentTemplateName())
599
56
        Builder.MakeTrivial(Context, DTN->getQualifier(), Loc);
600
7.75k
      else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName())
601
2
        Builder.MakeTrivial(Context, QTN->getQualifier(), Loc);
602
603
7.81k
      ArgInfos[i] = TemplateArgumentLocInfo(
604
7.81k
          Context, Builder.getWithLocInContext(Context), Loc,
605
7.81k
          Args[i].getKind() == TemplateArgument::Template ? 
SourceLocation()7.80k
606
7.81k
                                                          : 
Loc3
);
607
7.81k
      break;
608
7.80k
    }
609
610
20.4k
    case TemplateArgument::Pack:
611
20.4k
      ArgInfos[i] = TemplateArgumentLocInfo();
612
20.4k
      break;
613
4.17M
    }
614
4.17M
  }
615
2.49M
}
616
617
16
DeclarationNameInfo AutoTypeLoc::getConceptNameInfo() const {
618
16
  return DeclarationNameInfo(getNamedConcept()->getDeclName(),
619
16
                             getLocalData()->ConceptNameLoc);
620
16
}
621
622
36.7k
void AutoTypeLoc::initializeLocal(ASTContext &Context, SourceLocation Loc) {
623
36.7k
  setNestedNameSpecifierLoc(NestedNameSpecifierLoc());
624
36.7k
  setTemplateKWLoc(Loc);
625
36.7k
  setConceptNameLoc(Loc);
626
36.7k
  setFoundDecl(nullptr);
627
36.7k
  setRAngleLoc(Loc);
628
36.7k
  setLAngleLoc(Loc);
629
36.7k
  setRParenLoc(Loc);
630
36.7k
  TemplateSpecializationTypeLoc::initializeArgLocs(Context, getNumArgs(),
631
36.7k
                                                   getTypePtr()->getArgs(),
632
36.7k
                                                   getArgInfos(), Loc);
633
36.7k
  setNameLoc(Loc);
634
36.7k
}
635
636
637
namespace {
638
639
  class GetContainedAutoTypeLocVisitor :
640
    public TypeLocVisitor<GetContainedAutoTypeLocVisitor, TypeLoc> {
641
  public:
642
    using TypeLocVisitor<GetContainedAutoTypeLocVisitor, TypeLoc>::Visit;
643
644
296
    TypeLoc VisitAutoTypeLoc(AutoTypeLoc TL) {
645
296
      return TL;
646
296
    }
647
648
    // Only these types can contain the desired 'auto' type.
649
650
458
    TypeLoc VisitElaboratedTypeLoc(ElaboratedTypeLoc T) {
651
458
      return Visit(T.getNamedTypeLoc());
652
458
    }
653
654
239
    TypeLoc VisitQualifiedTypeLoc(QualifiedTypeLoc T) {
655
239
      return Visit(T.getUnqualifiedLoc());
656
239
    }
657
658
32.7k
    TypeLoc VisitPointerTypeLoc(PointerTypeLoc T) {
659
32.7k
      return Visit(T.getPointeeLoc());
660
32.7k
    }
661
662
0
    TypeLoc VisitBlockPointerTypeLoc(BlockPointerTypeLoc T) {
663
0
      return Visit(T.getPointeeLoc());
664
0
    }
665
666
5.08k
    TypeLoc VisitReferenceTypeLoc(ReferenceTypeLoc T) {
667
5.08k
      return Visit(T.getPointeeLoc());
668
5.08k
    }
669
670
111
    TypeLoc VisitMemberPointerTypeLoc(MemberPointerTypeLoc T) {
671
111
      return Visit(T.getPointeeLoc());
672
111
    }
673
674
75
    TypeLoc VisitArrayTypeLoc(ArrayTypeLoc T) {
675
75
      return Visit(T.getElementLoc());
676
75
    }
677
678
341
    TypeLoc VisitFunctionTypeLoc(FunctionTypeLoc T) {
679
341
      return Visit(T.getReturnLoc());
680
341
    }
681
682
340
    TypeLoc VisitParenTypeLoc(ParenTypeLoc T) {
683
340
      return Visit(T.getInnerLoc());
684
340
    }
685
686
2
    TypeLoc VisitAttributedTypeLoc(AttributedTypeLoc T) {
687
2
      return Visit(T.getModifiedLoc());
688
2
    }
689
690
0
    TypeLoc VisitBTFTagAttributedTypeLoc(BTFTagAttributedTypeLoc T) {
691
0
      return Visit(T.getWrappedLoc());
692
0
    }
693
694
0
    TypeLoc VisitMacroQualifiedTypeLoc(MacroQualifiedTypeLoc T) {
695
0
      return Visit(T.getInnerLoc());
696
0
    }
697
698
0
    TypeLoc VisitAdjustedTypeLoc(AdjustedTypeLoc T) {
699
0
      return Visit(T.getOriginalLoc());
700
0
    }
701
702
98
    TypeLoc VisitPackExpansionTypeLoc(PackExpansionTypeLoc T) {
703
98
      return Visit(T.getPatternLoc());
704
98
    }
705
  };
706
707
} // namespace
708
709
414k
AutoTypeLoc TypeLoc::getContainedAutoTypeLoc() const {
710
414k
  TypeLoc Res = GetContainedAutoTypeLocVisitor().Visit(*this);
711
414k
  if (Res.isNull())
712
414k
    return AutoTypeLoc();
713
296
  return Res.getAs<AutoTypeLoc>();
714
414k
}