Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/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/ASTContext.h"
15
#include "clang/AST/Expr.h"
16
#include "clang/AST/NestedNameSpecifier.h"
17
#include "clang/AST/TemplateBase.h"
18
#include "clang/AST/TemplateName.h"
19
#include "clang/AST/TypeLocVisitor.h"
20
#include "clang/Basic/SourceLocation.h"
21
#include "clang/Basic/Specifiers.h"
22
#include "llvm/Support/ErrorHandling.h"
23
#include "llvm/Support/MathExtras.h"
24
#include <algorithm>
25
#include <cassert>
26
#include <cstdint>
27
#include <cstring>
28
29
using namespace clang;
30
31
static const unsigned TypeLocMaxDataAlign = alignof(void *);
32
33
//===----------------------------------------------------------------------===//
34
// TypeLoc Implementation
35
//===----------------------------------------------------------------------===//
36
37
namespace {
38
39
class TypeLocRanger : public TypeLocVisitor<TypeLocRanger, SourceRange> {
40
public:
41
#define ABSTRACT_TYPELOC(CLASS, PARENT)
42
#define TYPELOC(CLASS, PARENT) \
43
187M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
187M
    return TyLoc.getLocalSourceRange(); \
45
187M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
43
20.6k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
20.6k
    return TyLoc.getLocalSourceRange(); \
45
20.6k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
43
10.8M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
10.8M
    return TyLoc.getLocalSourceRange(); \
45
10.8M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
43
2.59k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
2.59k
    return TyLoc.getLocalSourceRange(); \
45
2.59k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
43
1.97M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
1.97M
    return TyLoc.getLocalSourceRange(); \
45
1.97M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
43
2.41k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
2.41k
    return TyLoc.getLocalSourceRange(); \
45
2.41k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
43
1.70M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
1.70M
    return TyLoc.getLocalSourceRange(); \
45
1.70M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
43
609k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
609k
    return TyLoc.getLocalSourceRange(); \
45
609k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
43
84.3k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
84.3k
    return TyLoc.getLocalSourceRange(); \
45
84.3k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
43
16.0k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
16.0k
    return TyLoc.getLocalSourceRange(); \
45
16.0k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
43
17.7k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
17.7k
    return TyLoc.getLocalSourceRange(); \
45
17.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
43
147
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
147
    return TyLoc.getLocalSourceRange(); \
45
147
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
43
11.2k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
11.2k
    return TyLoc.getLocalSourceRange(); \
45
11.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Line
Count
Source
43
54
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
54
    return TyLoc.getLocalSourceRange(); \
45
54
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Line
Count
Source
43
44
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
44
    return TyLoc.getLocalSourceRange(); \
45
44
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
43
339k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
339k
    return TyLoc.getLocalSourceRange(); \
45
339k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Line
Count
Source
43
78
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
78
    return TyLoc.getLocalSourceRange(); \
45
78
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
43
48
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
48
    return TyLoc.getLocalSourceRange(); \
45
48
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
43
1.16M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
1.16M
    return TyLoc.getLocalSourceRange(); \
45
1.16M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
43
37
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
37
    return TyLoc.getLocalSourceRange(); \
45
37
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
43
74
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
74
    return TyLoc.getLocalSourceRange(); \
45
74
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
43
75.1k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
75.1k
    return TyLoc.getLocalSourceRange(); \
45
75.1k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
43
28.8M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
28.8M
    return TyLoc.getLocalSourceRange(); \
45
28.8M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
43
235
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
235
    return TyLoc.getLocalSourceRange(); \
45
235
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc)
Line
Count
Source
43
1
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
1
    return TyLoc.getLocalSourceRange(); \
45
1
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDecayedTypeLoc(clang::DecayedTypeLoc)
Line
Count
Source
43
10
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
10
    return TyLoc.getLocalSourceRange(); \
45
10
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
43
5.98k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
5.98k
    return TyLoc.getLocalSourceRange(); \
45
5.98k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
Line
Count
Source
43
53
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
53
    return TyLoc.getLocalSourceRange(); \
45
53
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
43
509k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
509k
    return TyLoc.getLocalSourceRange(); \
45
509k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
43
1.22k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
1.22k
    return TyLoc.getLocalSourceRange(); \
45
1.22k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
43
17.0M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
17.0M
    return TyLoc.getLocalSourceRange(); \
45
17.0M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
43
356k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
356k
    return TyLoc.getLocalSourceRange(); \
45
356k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Line
Count
Source
43
1.09M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
1.09M
    return TyLoc.getLocalSourceRange(); \
45
1.09M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
43
44.8k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
44.8k
    return TyLoc.getLocalSourceRange(); \
45
44.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
43
33.4M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
33.4M
    return TyLoc.getLocalSourceRange(); \
45
33.4M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
43
14.6M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
14.6M
    return TyLoc.getLocalSourceRange(); \
45
14.6M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
43
223
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
223
    return TyLoc.getLocalSourceRange(); \
45
223
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
43
66.7M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
66.7M
    return TyLoc.getLocalSourceRange(); \
45
66.7M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
43
27.1k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
27.1k
    return TyLoc.getLocalSourceRange(); \
45
27.1k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
43
8.31k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
8.31k
    return TyLoc.getLocalSourceRange(); \
45
8.31k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
43
2.11M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
2.11M
    return TyLoc.getLocalSourceRange(); \
45
2.11M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
43
5.21M
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
5.21M
    return TyLoc.getLocalSourceRange(); \
45
5.21M
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Line
Count
Source
43
138k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
138k
    return TyLoc.getLocalSourceRange(); \
45
138k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
43
236k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
236k
    return TyLoc.getLocalSourceRange(); \
45
236k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
43
3.30k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
3.30k
    return TyLoc.getLocalSourceRange(); \
45
3.30k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
43
3.98k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
3.98k
    return TyLoc.getLocalSourceRange(); \
45
3.98k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
43
110k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
110k
    return TyLoc.getLocalSourceRange(); \
45
110k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
43
32.2k
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
32.2k
    return TyLoc.getLocalSourceRange(); \
45
32.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
43
2
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
2
    return TyLoc.getLocalSourceRange(); \
45
2
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocRanger::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
43
488
  SourceRange Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
44
488
    return TyLoc.getLocalSourceRange(); \
45
488
  }
46
#include "clang/AST/TypeLocNodes.def"
47
};
48
49
} // namespace
50
51
187M
SourceRange TypeLoc::getLocalSourceRangeImpl(TypeLoc TL) {
52
187M
  if (TL.isNull()) 
return SourceRange()0
;
53
187M
  return TypeLocRanger().Visit(TL);
54
187M
}
55
56
namespace {
57
58
class TypeAligner : public TypeLocVisitor<TypeAligner, unsigned> {
59
public:
60
#define ABSTRACT_TYPELOC(CLASS, PARENT)
61
#define TYPELOC(CLASS, PARENT) \
62
137M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
137M
    return TyLoc.getLocalDataAlignment(); \
64
137M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
62
10.7M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
10.7M
    return TyLoc.getLocalDataAlignment(); \
64
10.7M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
62
28.2M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
28.2M
    return TyLoc.getLocalDataAlignment(); \
64
28.2M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
62
15.7k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
15.7k
    return TyLoc.getLocalDataAlignment(); \
64
15.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
62
7.96M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
7.96M
    return TyLoc.getLocalDataAlignment(); \
64
7.96M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
62
50.7k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
50.7k
    return TyLoc.getLocalDataAlignment(); \
64
50.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
62
3.66M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
3.66M
    return TyLoc.getLocalDataAlignment(); \
64
3.66M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
62
1.04M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
1.04M
    return TyLoc.getLocalDataAlignment(); \
64
1.04M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
62
64.9k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
64.9k
    return TyLoc.getLocalDataAlignment(); \
64
64.9k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
62
410k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
410k
    return TyLoc.getLocalDataAlignment(); \
64
410k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
62
77.2k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
77.2k
    return TyLoc.getLocalDataAlignment(); \
64
77.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
62
31.3k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
31.3k
    return TyLoc.getLocalDataAlignment(); \
64
31.3k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
62
78.6k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
78.6k
    return TyLoc.getLocalDataAlignment(); \
64
78.6k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Line
Count
Source
62
49
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
49
    return TyLoc.getLocalDataAlignment(); \
64
49
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Line
Count
Source
62
237
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
237
    return TyLoc.getLocalDataAlignment(); \
64
237
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
62
631k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
631k
    return TyLoc.getLocalDataAlignment(); \
64
631k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Line
Count
Source
62
51
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
51
    return TyLoc.getLocalDataAlignment(); \
64
51
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
62
2.18k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
2.18k
    return TyLoc.getLocalDataAlignment(); \
64
2.18k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
62
8.65M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
8.65M
    return TyLoc.getLocalDataAlignment(); \
64
8.65M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
62
41.9k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
41.9k
    return TyLoc.getLocalDataAlignment(); \
64
41.9k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
62
80
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
80
    return TyLoc.getLocalDataAlignment(); \
64
80
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
62
772k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
772k
    return TyLoc.getLocalDataAlignment(); \
64
772k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
62
29.1M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
29.1M
    return TyLoc.getLocalDataAlignment(); \
64
29.1M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
62
8.90k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
8.90k
    return TyLoc.getLocalDataAlignment(); \
64
8.90k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc)
Line
Count
Source
62
17
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
17
    return TyLoc.getLocalDataAlignment(); \
64
17
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDecayedTypeLoc(clang::DecayedTypeLoc)
Line
Count
Source
62
1.39k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
1.39k
    return TyLoc.getLocalDataAlignment(); \
64
1.39k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
62
9.68k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
9.68k
    return TyLoc.getLocalDataAlignment(); \
64
9.68k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
Line
Count
Source
62
108
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
108
    return TyLoc.getLocalDataAlignment(); \
64
108
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
62
376k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
376k
    return TyLoc.getLocalDataAlignment(); \
64
376k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
62
1.44k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
1.44k
    return TyLoc.getLocalDataAlignment(); \
64
1.44k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
62
5.83M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
5.83M
    return TyLoc.getLocalDataAlignment(); \
64
5.83M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
62
280k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
280k
    return TyLoc.getLocalDataAlignment(); \
64
280k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Line
Count
Source
62
2.53M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
2.53M
    return TyLoc.getLocalDataAlignment(); \
64
2.53M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
62
318k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
318k
    return TyLoc.getLocalDataAlignment(); \
64
318k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
62
20.1M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
20.1M
    return TyLoc.getLocalDataAlignment(); \
64
20.1M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
62
474k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
474k
    return TyLoc.getLocalDataAlignment(); \
64
474k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
62
87
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
87
    return TyLoc.getLocalDataAlignment(); \
64
87
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
62
5.68M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
5.68M
    return TyLoc.getLocalDataAlignment(); \
64
5.68M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
62
159k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
159k
    return TyLoc.getLocalDataAlignment(); \
64
159k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
62
1.25k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
1.25k
    return TyLoc.getLocalDataAlignment(); \
64
1.25k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
62
3.46M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
3.46M
    return TyLoc.getLocalDataAlignment(); \
64
3.46M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
62
5.31M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
5.31M
    return TyLoc.getLocalDataAlignment(); \
64
5.31M
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Line
Count
Source
62
136k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
136k
    return TyLoc.getLocalDataAlignment(); \
64
136k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
62
163k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
163k
    return TyLoc.getLocalDataAlignment(); \
64
163k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
62
14.2k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
14.2k
    return TyLoc.getLocalDataAlignment(); \
64
14.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
62
106k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
106k
    return TyLoc.getLocalDataAlignment(); \
64
106k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
62
309k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
309k
    return TyLoc.getLocalDataAlignment(); \
64
309k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
62
236k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
236k
    return TyLoc.getLocalDataAlignment(); \
64
236k
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
62
217
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
217
    return TyLoc.getLocalDataAlignment(); \
64
217
  }
TypeLoc.cpp:(anonymous namespace)::TypeAligner::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
62
10.7k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
63
10.7k
    return TyLoc.getLocalDataAlignment(); \
64
10.7k
  }
65
#include "clang/AST/TypeLocNodes.def"
66
};
67
68
} // namespace
69
70
/// Returns the alignment of the type source info data block.
71
137M
unsigned TypeLoc::getLocalAlignmentForType(QualType Ty) {
72
137M
  if (Ty.isNull()) 
return 10
;
73
137M
  return TypeAligner().Visit(TypeLoc(Ty, nullptr));
74
137M
}
75
76
namespace {
77
78
class TypeSizer : public TypeLocVisitor<TypeSizer, unsigned> {
79
public:
80
#define ABSTRACT_TYPELOC(CLASS, PARENT)
81
#define TYPELOC(CLASS, PARENT) \
82
76.5M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
76.5M
    return TyLoc.getLocalDataSize(); \
84
76.5M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
82
4.09M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
4.09M
    return TyLoc.getLocalDataSize(); \
84
4.09M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
82
11.7M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
11.7M
    return TyLoc.getLocalDataSize(); \
84
11.7M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
82
11.8k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
11.8k
    return TyLoc.getLocalDataSize(); \
84
11.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
82
5.29M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
5.29M
    return TyLoc.getLocalDataSize(); \
84
5.29M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
82
18.5k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
18.5k
    return TyLoc.getLocalDataSize(); \
84
18.5k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
82
2.32M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
2.32M
    return TyLoc.getLocalDataSize(); \
84
2.32M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
82
681k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
681k
    return TyLoc.getLocalDataSize(); \
84
681k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
82
61.2k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
61.2k
    return TyLoc.getLocalDataSize(); \
84
61.2k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
82
324k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
324k
    return TyLoc.getLocalDataSize(); \
84
324k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
82
53.7k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
53.7k
    return TyLoc.getLocalDataSize(); \
84
53.7k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
82
13.0k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
13.0k
    return TyLoc.getLocalDataSize(); \
84
13.0k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
82
63.6k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
63.6k
    return TyLoc.getLocalDataSize(); \
84
63.6k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Line
Count
Source
82
49
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
49
    return TyLoc.getLocalDataSize(); \
84
49
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Line
Count
Source
82
79
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
79
    return TyLoc.getLocalDataSize(); \
84
79
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
82
439k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
439k
    return TyLoc.getLocalDataSize(); \
84
439k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Line
Count
Source
82
51
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
51
    return TyLoc.getLocalDataSize(); \
84
51
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
82
2.18k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
2.18k
    return TyLoc.getLocalDataSize(); \
84
2.18k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
82
7.97M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
7.97M
    return TyLoc.getLocalDataSize(); \
84
7.97M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
82
37.8k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
37.8k
    return TyLoc.getLocalDataSize(); \
84
37.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
82
57
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
57
    return TyLoc.getLocalDataSize(); \
84
57
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
82
232k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
232k
    return TyLoc.getLocalDataSize(); \
84
232k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
82
16.2M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
16.2M
    return TyLoc.getLocalDataSize(); \
84
16.2M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
82
8.55k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
8.55k
    return TyLoc.getLocalDataSize(); \
84
8.55k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc)
Line
Count
Source
82
5
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
5
    return TyLoc.getLocalDataSize(); \
84
5
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDecayedTypeLoc(clang::DecayedTypeLoc)
Line
Count
Source
82
1.03k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
1.03k
    return TyLoc.getLocalDataSize(); \
84
1.03k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
82
3.21k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
3.21k
    return TyLoc.getLocalDataSize(); \
84
3.21k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
Line
Count
Source
82
100
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
100
    return TyLoc.getLocalDataSize(); \
84
100
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
82
221k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
221k
    return TyLoc.getLocalDataSize(); \
84
221k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
82
1.44k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
1.44k
    return TyLoc.getLocalDataSize(); \
84
1.44k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
82
2.44M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
2.44M
    return TyLoc.getLocalDataSize(); \
84
2.44M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
82
138k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
138k
    return TyLoc.getLocalDataSize(); \
84
138k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Line
Count
Source
82
1.89M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
1.89M
    return TyLoc.getLocalDataSize(); \
84
1.89M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
82
260k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
260k
    return TyLoc.getLocalDataSize(); \
84
260k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
82
11.9M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
11.9M
    return TyLoc.getLocalDataSize(); \
84
11.9M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
82
134k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
134k
    return TyLoc.getLocalDataSize(); \
84
134k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
82
53
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
53
    return TyLoc.getLocalDataSize(); \
84
53
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
82
4.10M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
4.10M
    return TyLoc.getLocalDataSize(); \
84
4.10M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
82
88.6k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
88.6k
    return TyLoc.getLocalDataSize(); \
84
88.6k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
82
896
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
896
    return TyLoc.getLocalDataSize(); \
84
896
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
82
1.34M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
1.34M
    return TyLoc.getLocalDataSize(); \
84
1.34M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
82
3.73M
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
3.73M
    return TyLoc.getLocalDataSize(); \
84
3.73M
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Line
Count
Source
82
116k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
116k
    return TyLoc.getLocalDataSize(); \
84
116k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
82
163k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
163k
    return TyLoc.getLocalDataSize(); \
84
163k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
82
8.47k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
8.47k
    return TyLoc.getLocalDataSize(); \
84
8.47k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
82
45.8k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
45.8k
    return TyLoc.getLocalDataSize(); \
84
45.8k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
82
106k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
106k
    return TyLoc.getLocalDataSize(); \
84
106k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
82
94.4k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
94.4k
    return TyLoc.getLocalDataSize(); \
84
94.4k
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
82
93
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
93
    return TyLoc.getLocalDataSize(); \
84
93
  }
TypeLoc.cpp:(anonymous namespace)::TypeSizer::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
82
10.1k
  unsigned Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
83
10.1k
    return TyLoc.getLocalDataSize(); \
84
10.1k
  }
85
#include "clang/AST/TypeLocNodes.def"
86
};
87
88
} // namespace
89
90
/// Returns the size of the type source info data block.
91
52.9M
unsigned TypeLoc::getFullDataSizeForType(QualType Ty) {
92
52.9M
  unsigned Total = 0;
93
52.9M
  TypeLoc TyLoc(Ty, nullptr);
94
52.9M
  unsigned MaxAlign = 1;
95
129M
  while (!TyLoc.isNull()) {
96
76.5M
    unsigned Align = getLocalAlignmentForType(TyLoc.getType());
97
76.5M
    MaxAlign = std::max(Align, MaxAlign);
98
76.5M
    Total = llvm::alignTo(Total, Align);
99
76.5M
    Total += TypeSizer().Visit(TyLoc);
100
76.5M
    TyLoc = TyLoc.getNextTypeLoc();
101
76.5M
  }
102
52.9M
  Total = llvm::alignTo(Total, MaxAlign);
103
52.9M
  return Total;
104
52.9M
}
105
106
namespace {
107
108
class NextLoc : public TypeLocVisitor<NextLoc, TypeLoc> {
109
public:
110
#define ABSTRACT_TYPELOC(CLASS, PARENT)
111
#define TYPELOC(CLASS, PARENT) \
112
186M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
186M
    return TyLoc.getNextTypeLoc(); \
114
186M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
112
6.71M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
6.71M
    return TyLoc.getNextTypeLoc(); \
114
6.71M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
112
16.8M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
16.8M
    return TyLoc.getNextTypeLoc(); \
114
16.8M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
112
13.3k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
13.3k
    return TyLoc.getNextTypeLoc(); \
114
13.3k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
112
11.4M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
11.4M
    return TyLoc.getNextTypeLoc(); \
114
11.4M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
Line
Count
Source
112
39.4k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
39.4k
    return TyLoc.getNextTypeLoc(); \
114
39.4k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitLValueReferenceTypeLoc(clang::LValueReferenceTypeLoc)
Line
Count
Source
112
5.23M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
5.23M
    return TyLoc.getNextTypeLoc(); \
114
5.23M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitRValueReferenceTypeLoc(clang::RValueReferenceTypeLoc)
Line
Count
Source
112
1.50M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
1.50M
    return TyLoc.getNextTypeLoc(); \
114
1.50M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Line
Count
Source
112
222k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
222k
    return TyLoc.getNextTypeLoc(); \
114
222k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Line
Count
Source
112
629k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
629k
    return TyLoc.getNextTypeLoc(); \
114
629k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Line
Count
Source
112
148k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
148k
    return TyLoc.getNextTypeLoc(); \
114
148k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Line
Count
Source
112
23.6k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
23.6k
    return TyLoc.getNextTypeLoc(); \
114
23.6k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Line
Count
Source
112
151k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
151k
    return TyLoc.getNextTypeLoc(); \
114
151k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Line
Count
Source
112
85
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
85
    return TyLoc.getNextTypeLoc(); \
114
85
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Line
Count
Source
112
137
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
137
    return TyLoc.getNextTypeLoc(); \
114
137
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
112
553k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
553k
    return TyLoc.getNextTypeLoc(); \
114
553k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Line
Count
Source
112
90
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
90
    return TyLoc.getNextTypeLoc(); \
114
90
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Line
Count
Source
112
2.63k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
2.63k
    return TyLoc.getNextTypeLoc(); \
114
2.63k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
112
19.0M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
19.0M
    return TyLoc.getNextTypeLoc(); \
114
19.0M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Line
Count
Source
112
104k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
104k
    return TyLoc.getNextTypeLoc(); \
114
104k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Line
Count
Source
112
104
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
104
    return TyLoc.getNextTypeLoc(); \
114
104
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
112
566k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
566k
    return TyLoc.getNextTypeLoc(); \
114
566k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
112
28.7M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
28.7M
    return TyLoc.getNextTypeLoc(); \
114
28.7M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Line
Count
Source
112
8.80k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
8.80k
    return TyLoc.getNextTypeLoc(); \
114
8.80k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc)
Line
Count
Source
112
6
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
6
    return TyLoc.getNextTypeLoc(); \
114
6
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDecayedTypeLoc(clang::DecayedTypeLoc)
Line
Count
Source
112
1.29k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
1.29k
    return TyLoc.getNextTypeLoc(); \
114
1.29k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
112
6.00k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
6.00k
    return TyLoc.getNextTypeLoc(); \
114
6.00k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
Line
Count
Source
112
157
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
157
    return TyLoc.getNextTypeLoc(); \
114
157
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Line
Count
Source
112
448k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
448k
    return TyLoc.getNextTypeLoc(); \
114
448k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Line
Count
Source
112
2.07k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
2.07k
    return TyLoc.getNextTypeLoc(); \
114
2.07k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
112
10.5M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
10.5M
    return TyLoc.getNextTypeLoc(); \
114
10.5M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitEnumTypeLoc(clang::EnumTypeLoc)
Line
Count
Source
112
313k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
313k
    return TyLoc.getNextTypeLoc(); \
114
313k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Line
Count
Source
112
2.72M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
2.72M
    return TyLoc.getNextTypeLoc(); \
114
2.72M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Line
Count
Source
112
305k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
305k
    return TyLoc.getNextTypeLoc(); \
114
305k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
112
27.2M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
27.2M
    return TyLoc.getNextTypeLoc(); \
114
27.2M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Line
Count
Source
112
5.99M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
5.99M
    return TyLoc.getNextTypeLoc(); \
114
5.99M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Line
Count
Source
112
147
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
147
    return TyLoc.getNextTypeLoc(); \
114
147
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Line
Count
Source
112
37.2M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
37.2M
    return TyLoc.getNextTypeLoc(); \
114
37.2M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAutoTypeLoc(clang::AutoTypeLoc)
Line
Count
Source
112
104k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
104k
    return TyLoc.getNextTypeLoc(); \
114
104k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Line
Count
Source
112
4.80k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
4.80k
    return TyLoc.getNextTypeLoc(); \
114
4.80k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Line
Count
Source
112
2.42M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
2.42M
    return TyLoc.getNextTypeLoc(); \
114
2.42M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Line
Count
Source
112
6.18M
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
6.18M
    return TyLoc.getNextTypeLoc(); \
114
6.18M
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Line
Count
Source
112
186k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
186k
    return TyLoc.getNextTypeLoc(); \
114
186k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Line
Count
Source
112
488k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
488k
    return TyLoc.getNextTypeLoc(); \
114
488k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
Line
Count
Source
112
10.0k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
10.0k
    return TyLoc.getNextTypeLoc(); \
114
10.0k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
112
49.6k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
49.6k
    return TyLoc.getNextTypeLoc(); \
114
49.6k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
Line
Count
Source
112
151k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
151k
    return TyLoc.getNextTypeLoc(); \
114
151k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
112
197k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
197k
    return TyLoc.getNextTypeLoc(); \
114
197k
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitPipeTypeLoc(clang::PipeTypeLoc)
Line
Count
Source
112
198
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
198
    return TyLoc.getNextTypeLoc(); \
114
198
  }
TypeLoc.cpp:(anonymous namespace)::NextLoc::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
112
10.8k
  TypeLoc Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
113
10.8k
    return TyLoc.getNextTypeLoc(); \
114
10.8k
  }
115
#include "clang/AST/TypeLocNodes.def"
116
};
117
118
} // namespace
119
120
/// Get the next TypeLoc pointed by this TypeLoc, e.g for "int*" the
121
/// TypeLoc is a PointerLoc and next TypeLoc is for "int".
122
186M
TypeLoc TypeLoc::getNextTypeLocImpl(TypeLoc TL) {
123
186M
  return NextLoc().Visit(TL);
124
186M
}
125
126
/// Initializes a type location, and all of its children
127
/// recursively, as if the entire tree had been written in the
128
/// given location.
129
void TypeLoc::initializeImpl(ASTContext &Context, TypeLoc TL,
130
9.86M
                             SourceLocation Loc) {
131
11.0M
  while (true) {
132
11.0M
    switch (TL.getTypeLocClass()) {
133
11.0M
#define ABSTRACT_TYPELOC(CLASS, PARENT)
134
11.0M
#define TYPELOC(CLASS, PARENT)        \
135
11.0M
    case CLASS: {                     \
136
1.18M
      CLASS##TypeLoc TLCasted = TL.castAs<CLASS##TypeLoc>(); \
137
1.18M
      TLCasted.initializeLocal(Context, Loc);  \
138
1.18M
      TL = TLCasted.getNextTypeLoc(); \
139
11.0M
      if (!TL) 
return9.86M
; \
140
1.18M
      
continue2.27k
; \
141
1.18M
    }
142
11.0M
#include 
"clang/AST/TypeLocNodes.def"158k
143
11.0M
    }
144
11.0M
  }
145
9.86M
}
146
147
namespace {
148
149
class TypeLocCopier : public TypeLocVisitor<TypeLocCopier> {
150
  TypeLoc Source;
151
152
public:
153
7.35k
  TypeLocCopier(TypeLoc source) : Source(source) {}
154
155
#define ABSTRACT_TYPELOC(CLASS, PARENT)
156
#define TYPELOC(CLASS, PARENT)                          \
157
7.35k
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
7.35k
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
7.35k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
Line
Count
Source
157
4
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
4
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
4
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)
Line
Count
Source
157
2.34k
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
2.34k
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
2.34k
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitComplexTypeLoc(clang::ComplexTypeLoc)
Line
Count
Source
157
4
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
4
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
4
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPointerTypeLoc(clang::PointerTypeLoc)
Line
Count
Source
157
21
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
21
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
21
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
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::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitIncompleteArrayTypeLoc(clang::IncompleteArrayTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitVariableArrayTypeLoc(clang::VariableArrayTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitVectorTypeLoc(clang::VectorTypeLoc)
Line
Count
Source
157
1
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
1
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
1
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Line
Count
Source
157
3
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
3
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
3
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitParenTypeLoc(clang::ParenTypeLoc)
Line
Count
Source
157
3
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
3
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
3
  }
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Line
Count
Source
157
4.58k
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
4.58k
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
4.58k
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitAdjustedTypeLoc(clang::AdjustedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDecayedTypeLoc(clang::DecayedTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Line
Count
Source
157
1
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
1
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
1
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitRecordTypeLoc(clang::RecordTypeLoc)
Line
Count
Source
157
51
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
51
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
51
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitEnumTypeLoc(clang::EnumTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Line
Count
Source
157
299
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
299
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
299
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
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::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCObjectTypeLoc(clang::ObjCObjectTypeLoc)
Line
Count
Source
157
18
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
18
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
18
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCInterfaceTypeLoc(clang::ObjCInterfaceTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Line
Count
Source
157
18
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
18
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
18
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitPipeTypeLoc(clang::PipeTypeLoc)
TypeLoc.cpp:(anonymous namespace)::TypeLocCopier::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
Line
Count
Source
157
1
  void Visit##CLASS##TypeLoc(CLASS##TypeLoc dest) {   \
158
1
    dest.copyLocal(Source.castAs<CLASS##TypeLoc>());  \
159
1
  }
160
#include "clang/AST/TypeLocNodes.def"
161
};
162
163
} // namespace
164
165
53.2k
void TypeLoc::copy(TypeLoc other) {
166
53.2k
  assert(getFullDataSize() == other.getFullDataSize());
167
53.2k
168
53.2k
  // If both data pointers are aligned to the maximum alignment, we
169
53.2k
  // can memcpy because getFullDataSize() accurately reflects the
170
53.2k
  // layout of the data.
171
53.2k
  if (reinterpret_cast<uintptr_t>(Data) ==
172
53.2k
          llvm::alignTo(reinterpret_cast<uintptr_t>(Data),
173
53.2k
                        TypeLocMaxDataAlign) &&
174
53.2k
      reinterpret_cast<uintptr_t>(other.Data) ==
175
45.9k
          llvm::alignTo(reinterpret_cast<uintptr_t>(other.Data),
176
45.9k
                        TypeLocMaxDataAlign)) {
177
45.9k
    memcpy(Data, other.Data, getFullDataSize());
178
45.9k
    return;
179
45.9k
  }
180
7.29k
181
7.29k
  // Copy each of the pieces.
182
7.29k
  TypeLoc TL(getType(), Data);
183
7.35k
  do {
184
7.35k
    TypeLocCopier(other).Visit(TL);
185
7.35k
    other = other.getNextTypeLoc();
186
7.35k
  } while ((TL = TL.getNextTypeLoc()));
187
7.29k
}
188
189
84.1M
SourceLocation TypeLoc::getBeginLoc() const {
190
84.1M
  TypeLoc Cur = *this;
191
84.1M
  TypeLoc LeftMost = Cur;
192
94.4M
  while (true) {
193
94.4M
    switch (Cur.getTypeLocClass()) {
194
94.4M
    case Elaborated:
195
1.06M
      LeftMost = Cur;
196
1.06M
      break;
197
94.4M
    case FunctionProto:
198
4.24M
      if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr()
199
4.24M
              ->hasTrailingReturn()) {
200
22.9k
        LeftMost = Cur;
201
22.9k
        break;
202
22.9k
      }
203
4.22M
      LLVM_FALLTHROUGH;
204
6.47M
    case FunctionNoProto:
205
6.47M
    case ConstantArray:
206
6.47M
    case DependentSizedArray:
207
6.47M
    case IncompleteArray:
208
6.47M
    case VariableArray:
209
6.47M
      // FIXME: Currently QualifiedTypeLoc does not have a source range
210
6.47M
    case Qualified:
211
6.47M
      Cur = Cur.getNextTypeLoc();
212
6.47M
      continue;
213
86.8M
    default:
214
86.8M
      if (Cur.getLocalSourceRange().getBegin().isValid())
215
86.0M
        LeftMost = Cur;
216
86.8M
      Cur = Cur.getNextTypeLoc();
217
86.8M
      if (Cur.isNull())
218
83.1M
        break;
219
3.78M
      continue;
220
84.1M
    } // switch
221
84.1M
    break;
222
84.1M
  } // while
223
84.1M
  return LeftMost.getLocalSourceRange().getBegin();
224
84.1M
}
225
226
16.2M
SourceLocation TypeLoc::getEndLoc() const {
227
16.2M
  TypeLoc Cur = *this;
228
16.2M
  TypeLoc Last;
229
19.1M
  while (true) {
230
19.1M
    switch (Cur.getTypeLocClass()) {
231
19.1M
    default:
232
16.2M
      if (!Last)
233
14.8M
        Last = Cur;
234
16.2M
      return Last.getLocalSourceRange().getEnd();
235
19.1M
    case Paren:
236
79.4k
    case ConstantArray:
237
79.4k
    case DependentSizedArray:
238
79.4k
    case IncompleteArray:
239
79.4k
    case VariableArray:
240
79.4k
    case FunctionNoProto:
241
79.4k
      Last = Cur;
242
79.4k
      break;
243
519k
    case FunctionProto:
244
519k
      if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr()->hasTrailingReturn())
245
2.58k
        Last = TypeLoc();
246
517k
      else
247
517k
        Last = Cur;
248
519k
      break;
249
1.04M
    case Pointer:
250
1.04M
    case BlockPointer:
251
1.04M
    case MemberPointer:
252
1.04M
    case LValueReference:
253
1.04M
    case RValueReference:
254
1.04M
    case PackExpansion:
255
1.04M
      if (!Last)
256
964k
        Last = Cur;
257
1.04M
      break;
258
1.20M
    case Qualified:
259
1.20M
    case Elaborated:
260
1.20M
      break;
261
2.85M
    }
262
2.85M
    Cur = Cur.getNextTypeLoc();
263
2.85M
  }
264
16.2M
}
265
266
namespace {
267
268
struct TSTChecker : public TypeLocVisitor<TSTChecker, bool> {
269
  // Overload resolution does the real work for us.
270
0
  static bool isTypeSpec(TypeSpecTypeLoc _) { return true; }
271
0
  static bool isTypeSpec(TypeLoc _) { return false; }
272
273
#define ABSTRACT_TYPELOC(CLASS, PARENT)
274
#define TYPELOC(CLASS, PARENT) \
275
0
  bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TyLoc) { \
276
0
    return isTypeSpec(TyLoc); \
277
0
  }
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitQualifiedTypeLoc(clang::QualifiedTypeLoc)
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::VisitPointerTypeLoc(clang::PointerTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitBlockPointerTypeLoc(clang::BlockPointerTypeLoc)
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::VisitMemberPointerTypeLoc(clang::MemberPointerTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitConstantArrayTypeLoc(clang::ConstantArrayTypeLoc)
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::VisitDependentSizedArrayTypeLoc(clang::DependentSizedArrayTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentSizedExtVectorTypeLoc(clang::DependentSizedExtVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentAddressSpaceTypeLoc(clang::DependentAddressSpaceTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitVectorTypeLoc(clang::VectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentVectorTypeLoc(clang::DependentVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitExtVectorTypeLoc(clang::ExtVectorTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitFunctionNoProtoTypeLoc(clang::FunctionNoProtoTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnresolvedUsingTypeLoc(clang::UnresolvedUsingTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitParenTypeLoc(clang::ParenTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTypedefTypeLoc(clang::TypedefTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitMacroQualifiedTypeLoc(clang::MacroQualifiedTypeLoc)
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::VisitTypeOfExprTypeLoc(clang::TypeOfExprTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTypeOfTypeLoc(clang::TypeOfTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDecltypeTypeLoc(clang::DecltypeTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitUnaryTransformTypeLoc(clang::UnaryTransformTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitRecordTypeLoc(clang::RecordTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitEnumTypeLoc(clang::EnumTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitAttributedTypeLoc(clang::AttributedTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTemplateTypeParmTypeLoc(clang::TemplateTypeParmTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitSubstTemplateTypeParmTypeLoc(clang::SubstTemplateTypeParmTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitSubstTemplateTypeParmPackTypeLoc(clang::SubstTemplateTypeParmPackTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitAutoTypeLoc(clang::AutoTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDeducedTemplateSpecializationTypeLoc(clang::DeducedTemplateSpecializationTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitInjectedClassNameTypeLoc(clang::InjectedClassNameTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentNameTypeLoc(clang::DependentNameTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitPackExpansionTypeLoc(clang::PackExpansionTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitObjCTypeParamTypeLoc(clang::ObjCTypeParamTypeLoc)
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::VisitObjCObjectPointerTypeLoc(clang::ObjCObjectPointerTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitPipeTypeLoc(clang::PipeTypeLoc)
Unexecuted instantiation: TypeLoc.cpp:(anonymous namespace)::TSTChecker::VisitAtomicTypeLoc(clang::AtomicTypeLoc)
278
#include "clang/AST/TypeLocNodes.def"
279
};
280
281
} // namespace
282
283
/// Determines if the given type loc corresponds to a
284
/// TypeSpecTypeLoc.  Since there is not actually a TypeSpecType in
285
/// the type hierarchy, this is made somewhat complicated.
286
///
287
/// There are a lot of types that currently use TypeSpecTypeLoc
288
/// because it's a convenient base class.  Ideally we would not accept
289
/// those here, but ideally we would have better implementations for
290
/// them.
291
0
bool TypeSpecTypeLoc::isKind(const TypeLoc &TL) {
292
0
  if (TL.getType().hasLocalQualifiers()) return false;
293
0
  return TSTChecker().Visit(TL);
294
0
}
295
296
// Reimplemented to account for GNU/C++ extension
297
//     typeof unary-expression
298
// where there are no parentheses.
299
5.98k
SourceRange TypeOfExprTypeLoc::getLocalSourceRange() const {
300
5.98k
  if (getRParenLoc().isValid())
301
5.98k
    return SourceRange(getTypeofLoc(), getRParenLoc());
302
0
  else
303
0
    return SourceRange(getTypeofLoc(),
304
0
                       getUnderlyingExpr()->getSourceRange().getEnd());
305
5.98k
}
306
307
308
110k
TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const {
309
110k
  if (needsExtraLocalData())
310
110k
    return static_cast<TypeSpecifierType>(getWrittenBuiltinSpecs().Type);
311
0
  switch (getTypePtr()->getKind()) {
312
0
  case BuiltinType::Void:
313
0
    return TST_void;
314
0
  case BuiltinType::Bool:
315
0
    return TST_bool;
316
0
  case BuiltinType::Char_U:
317
0
  case BuiltinType::Char_S:
318
0
    return TST_char;
319
0
  case BuiltinType::Char8:
320
0
    return TST_char8;
321
0
  case BuiltinType::Char16:
322
0
    return TST_char16;
323
0
  case BuiltinType::Char32:
324
0
    return TST_char32;
325
0
  case BuiltinType::WChar_S:
326
0
  case BuiltinType::WChar_U:
327
0
    return TST_wchar;
328
0
  case BuiltinType::UChar:
329
0
  case BuiltinType::UShort:
330
0
  case BuiltinType::UInt:
331
0
  case BuiltinType::ULong:
332
0
  case BuiltinType::ULongLong:
333
0
  case BuiltinType::UInt128:
334
0
  case BuiltinType::SChar:
335
0
  case BuiltinType::Short:
336
0
  case BuiltinType::Int:
337
0
  case BuiltinType::Long:
338
0
  case BuiltinType::LongLong:
339
0
  case BuiltinType::Int128:
340
0
  case BuiltinType::Half:
341
0
  case BuiltinType::Float:
342
0
  case BuiltinType::Double:
343
0
  case BuiltinType::LongDouble:
344
0
  case BuiltinType::Float16:
345
0
  case BuiltinType::Float128:
346
0
  case BuiltinType::ShortAccum:
347
0
  case BuiltinType::Accum:
348
0
  case BuiltinType::LongAccum:
349
0
  case BuiltinType::UShortAccum:
350
0
  case BuiltinType::UAccum:
351
0
  case BuiltinType::ULongAccum:
352
0
  case BuiltinType::ShortFract:
353
0
  case BuiltinType::Fract:
354
0
  case BuiltinType::LongFract:
355
0
  case BuiltinType::UShortFract:
356
0
  case BuiltinType::UFract:
357
0
  case BuiltinType::ULongFract:
358
0
  case BuiltinType::SatShortAccum:
359
0
  case BuiltinType::SatAccum:
360
0
  case BuiltinType::SatLongAccum:
361
0
  case BuiltinType::SatUShortAccum:
362
0
  case BuiltinType::SatUAccum:
363
0
  case BuiltinType::SatULongAccum:
364
0
  case BuiltinType::SatShortFract:
365
0
  case BuiltinType::SatFract:
366
0
  case BuiltinType::SatLongFract:
367
0
  case BuiltinType::SatUShortFract:
368
0
  case BuiltinType::SatUFract:
369
0
  case BuiltinType::SatULongFract:
370
0
    llvm_unreachable("Builtin type needs extra local data!");
371
0
    // Fall through, if the impossible happens.
372
0
373
0
  case BuiltinType::NullPtr:
374
0
  case BuiltinType::Overload:
375
0
  case BuiltinType::Dependent:
376
0
  case BuiltinType::BoundMember:
377
0
  case BuiltinType::UnknownAny:
378
0
  case BuiltinType::ARCUnbridgedCast:
379
0
  case BuiltinType::PseudoObject:
380
0
  case BuiltinType::ObjCId:
381
0
  case BuiltinType::ObjCClass:
382
0
  case BuiltinType::ObjCSel:
383
0
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
384
0
  case BuiltinType::Id:
385
0
#include "clang/Basic/OpenCLImageTypes.def"
386
0
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
387
0
  case BuiltinType::Id:
388
0
#include "clang/Basic/OpenCLExtensionTypes.def"
389
0
  case BuiltinType::OCLSampler:
390
0
  case BuiltinType::OCLEvent:
391
0
  case BuiltinType::OCLClkEvent:
392
0
  case BuiltinType::OCLQueue:
393
0
  case BuiltinType::OCLReserveID:
394
0
  case BuiltinType::BuiltinFn:
395
0
  case BuiltinType::OMPArraySection:
396
0
    return TST_unspecified;
397
0
  }
398
0
399
0
  llvm_unreachable("Invalid BuiltinType Kind!");
400
0
}
401
402
140
TypeLoc TypeLoc::IgnoreParensImpl(TypeLoc TL) {
403
280
  while (ParenTypeLoc PTL = TL.getAs<ParenTypeLoc>())
404
140
    TL = PTL.getInnerLoc();
405
140
  return TL;
406
140
}
407
408
0
SourceLocation TypeLoc::findNullabilityLoc() const {
409
0
  if (auto ATL = getAs<AttributedTypeLoc>()) {
410
0
    const Attr *A = ATL.getAttr();
411
0
    if (A && (isa<TypeNullableAttr>(A) || isa<TypeNonNullAttr>(A) ||
412
0
              isa<TypeNullUnspecifiedAttr>(A)))
413
0
      return A->getLocation();
414
0
  }
415
0
416
0
  return {};
417
0
}
418
419
9.49k
TypeLoc TypeLoc::findExplicitQualifierLoc() const {
420
9.49k
  // Qualified types.
421
9.49k
  if (auto qual = getAs<QualifiedTypeLoc>())
422
9
    return qual;
423
9.48k
424
9.48k
  TypeLoc loc = IgnoreParens();
425
9.48k
426
9.48k
  // Attributed types.
427
9.48k
  if (auto attr = loc.getAs<AttributedTypeLoc>()) {
428
23
    if (attr.isQualifier()) return attr;
429
0
    return attr.getModifiedLoc().findExplicitQualifierLoc();
430
0
  }
431
9.45k
432
9.45k
  // C11 _Atomic types.
433
9.45k
  if (auto atomic = loc.getAs<AtomicTypeLoc>()) {
434
0
    return atomic;
435
0
  }
436
9.45k
437
9.45k
  return {};
438
9.45k
}
439
440
void ObjCTypeParamTypeLoc::initializeLocal(ASTContext &Context,
441
8.33k
                                           SourceLocation Loc) {
442
8.33k
  setNameLoc(Loc);
443
8.33k
  if (!getNumProtocols()) 
return8.20k
;
444
133
445
133
  setProtocolLAngleLoc(Loc);
446
133
  setProtocolRAngleLoc(Loc);
447
268
  for (unsigned i = 0, e = getNumProtocols(); i != e; 
++i135
)
448
135
    setProtocolLoc(i, Loc);
449
133
}
450
451
void ObjCObjectTypeLoc::initializeLocal(ASTContext &Context,
452
16.8k
                                        SourceLocation Loc) {
453
16.8k
  setHasBaseTypeAsWritten(true);
454
16.8k
  setTypeArgsLAngleLoc(Loc);
455
16.8k
  setTypeArgsRAngleLoc(Loc);
456
16.9k
  for (unsigned i = 0, e = getNumTypeArgs(); i != e; 
++i9
) {
457
9
    setTypeArgTInfo(i,
458
9
                   Context.getTrivialTypeSourceInfo(
459
9
                     getTypePtr()->getTypeArgsAsWritten()[i], Loc));
460
9
  }
461
16.8k
  setProtocolLAngleLoc(Loc);
462
16.8k
  setProtocolRAngleLoc(Loc);
463
16.9k
  for (unsigned i = 0, e = getNumProtocols(); i != e; 
++i9
)
464
9
    setProtocolLoc(i, Loc);
465
16.8k
}
466
467
void TypeOfTypeLoc::initializeLocal(ASTContext &Context,
468
2
                                       SourceLocation Loc) {
469
2
  TypeofLikeTypeLoc<TypeOfTypeLoc, TypeOfType, TypeOfTypeLocInfo>
470
2
      ::initializeLocal(Context, Loc);
471
2
  this->getLocalData()->UnderlyingTInfo = Context.getTrivialTypeSourceInfo(
472
2
      getUnderlyingType(), Loc);
473
2
}
474
475
void UnaryTransformTypeLoc::initializeLocal(ASTContext &Context,
476
5
                                       SourceLocation Loc) {
477
5
    setKWLoc(Loc);
478
5
    setRParenLoc(Loc);
479
5
    setLParenLoc(Loc);
480
5
    this->setUnderlyingTInfo(
481
5
        Context.getTrivialTypeSourceInfo(getTypePtr()->getBaseType(), Loc));
482
5
}
483
484
void ElaboratedTypeLoc::initializeLocal(ASTContext &Context,
485
6.45k
                                        SourceLocation Loc) {
486
6.45k
  setElaboratedKeywordLoc(Loc);
487
6.45k
  NestedNameSpecifierLocBuilder Builder;
488
6.45k
  Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
489
6.45k
  setQualifierLoc(Builder.getWithLocInContext(Context));
490
6.45k
}
491
492
void DependentNameTypeLoc::initializeLocal(ASTContext &Context,
493
237k
                                           SourceLocation Loc) {
494
237k
  setElaboratedKeywordLoc(Loc);
495
237k
  NestedNameSpecifierLocBuilder Builder;
496
237k
  Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
497
237k
  setQualifierLoc(Builder.getWithLocInContext(Context));
498
237k
  setNameLoc(Loc);
499
237k
}
500
501
void
502
DependentTemplateSpecializationTypeLoc::initializeLocal(ASTContext &Context,
503
39.6k
                                                        SourceLocation Loc) {
504
39.6k
  setElaboratedKeywordLoc(Loc);
505
39.6k
  if (getTypePtr()->getQualifier()) {
506
39.6k
    NestedNameSpecifierLocBuilder Builder;
507
39.6k
    Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
508
39.6k
    setQualifierLoc(Builder.getWithLocInContext(Context));
509
39.6k
  } else {
510
0
    setQualifierLoc(NestedNameSpecifierLoc());
511
0
  }
512
39.6k
  setTemplateKeywordLoc(Loc);
513
39.6k
  setTemplateNameLoc(Loc);
514
39.6k
  setLAngleLoc(Loc);
515
39.6k
  setRAngleLoc(Loc);
516
39.6k
  TemplateSpecializationTypeLoc::initializeArgLocs(Context, getNumArgs(),
517
39.6k
                                                   getTypePtr()->getArgs(),
518
39.6k
                                                   getArgInfos(), Loc);
519
39.6k
}
520
521
void TemplateSpecializationTypeLoc::initializeArgLocs(ASTContext &Context,
522
                                                      unsigned NumArgs,
523
                                                  const TemplateArgument *Args,
524
                                              TemplateArgumentLocInfo *ArgInfos,
525
664k
                                                      SourceLocation Loc) {
526
1.71M
  for (unsigned i = 0, e = NumArgs; i != e; 
++i1.04M
) {
527
1.04M
    switch (Args[i].getKind()) {
528
1.04M
    case TemplateArgument::Null:
529
0
      llvm_unreachable("Impossible TemplateArgument");
530
1.04M
531
1.04M
    case TemplateArgument::Integral:
532
18
    case TemplateArgument::Declaration:
533
18
    case TemplateArgument::NullPtr:
534
18
      ArgInfos[i] = TemplateArgumentLocInfo();
535
18
      break;
536
18
537
512k
    case TemplateArgument::Expression:
538
512k
      ArgInfos[i] = TemplateArgumentLocInfo(Args[i].getAsExpr());
539
512k
      break;
540
18
541
517k
    case TemplateArgument::Type:
542
517k
      ArgInfos[i] = TemplateArgumentLocInfo(
543
517k
                          Context.getTrivialTypeSourceInfo(Args[i].getAsType(),
544
517k
                                                           Loc));
545
517k
      break;
546
18
547
4.19k
    case TemplateArgument::Template:
548
4.19k
    case TemplateArgument::TemplateExpansion: {
549
4.19k
      NestedNameSpecifierLocBuilder Builder;
550
4.19k
      TemplateName Template = Args[i].getAsTemplateOrTemplatePattern();
551
4.19k
      if (DependentTemplateName *DTN = Template.getAsDependentTemplateName())
552
26
        Builder.MakeTrivial(Context, DTN->getQualifier(), Loc);
553
4.17k
      else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName())
554
1
        Builder.MakeTrivial(Context, QTN->getQualifier(), Loc);
555
4.19k
556
4.19k
      ArgInfos[i] = TemplateArgumentLocInfo(
557
4.19k
          Builder.getWithLocInContext(Context), Loc,
558
4.19k
          Args[i].getKind() == TemplateArgument::Template ? 
SourceLocation()4.19k
559
4.19k
                                                          : 
Loc3
);
560
4.19k
      break;
561
4.19k
    }
562
4.19k
563
14.4k
    case TemplateArgument::Pack:
564
14.4k
      ArgInfos[i] = TemplateArgumentLocInfo();
565
14.4k
      break;
566
1.04M
    }
567
1.04M
  }
568
664k
}