Coverage Report

Created: 2020-10-24 06:27

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/AST/ASTImporter.cpp
Line
Count
Source (jump to first uncovered line)
1
//===- ASTImporter.cpp - Importing ASTs from other Contexts ---------------===//
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 ASTImporter class which imports AST nodes from one
10
//  context into another context.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#include "clang/AST/ASTImporter.h"
15
#include "clang/AST/ASTImporterSharedState.h"
16
#include "clang/AST/ASTContext.h"
17
#include "clang/AST/ASTDiagnostic.h"
18
#include "clang/AST/ASTStructuralEquivalence.h"
19
#include "clang/AST/Attr.h"
20
#include "clang/AST/Decl.h"
21
#include "clang/AST/DeclAccessPair.h"
22
#include "clang/AST/DeclBase.h"
23
#include "clang/AST/DeclCXX.h"
24
#include "clang/AST/DeclFriend.h"
25
#include "clang/AST/DeclGroup.h"
26
#include "clang/AST/DeclObjC.h"
27
#include "clang/AST/DeclTemplate.h"
28
#include "clang/AST/DeclVisitor.h"
29
#include "clang/AST/DeclarationName.h"
30
#include "clang/AST/Expr.h"
31
#include "clang/AST/ExprCXX.h"
32
#include "clang/AST/ExprObjC.h"
33
#include "clang/AST/ExternalASTSource.h"
34
#include "clang/AST/LambdaCapture.h"
35
#include "clang/AST/NestedNameSpecifier.h"
36
#include "clang/AST/OperationKinds.h"
37
#include "clang/AST/Stmt.h"
38
#include "clang/AST/StmtCXX.h"
39
#include "clang/AST/StmtObjC.h"
40
#include "clang/AST/StmtVisitor.h"
41
#include "clang/AST/TemplateBase.h"
42
#include "clang/AST/TemplateName.h"
43
#include "clang/AST/Type.h"
44
#include "clang/AST/TypeLoc.h"
45
#include "clang/AST/TypeVisitor.h"
46
#include "clang/AST/UnresolvedSet.h"
47
#include "clang/Basic/Builtins.h"
48
#include "clang/Basic/ExceptionSpecificationType.h"
49
#include "clang/Basic/FileManager.h"
50
#include "clang/Basic/IdentifierTable.h"
51
#include "clang/Basic/LLVM.h"
52
#include "clang/Basic/LangOptions.h"
53
#include "clang/Basic/SourceLocation.h"
54
#include "clang/Basic/SourceManager.h"
55
#include "clang/Basic/Specifiers.h"
56
#include "llvm/ADT/APSInt.h"
57
#include "llvm/ADT/ArrayRef.h"
58
#include "llvm/ADT/DenseMap.h"
59
#include "llvm/ADT/None.h"
60
#include "llvm/ADT/Optional.h"
61
#include "llvm/ADT/ScopeExit.h"
62
#include "llvm/ADT/STLExtras.h"
63
#include "llvm/ADT/SmallVector.h"
64
#include "llvm/Support/Casting.h"
65
#include "llvm/Support/ErrorHandling.h"
66
#include "llvm/Support/MemoryBuffer.h"
67
#include <algorithm>
68
#include <cassert>
69
#include <cstddef>
70
#include <memory>
71
#include <type_traits>
72
#include <utility>
73
74
namespace clang {
75
76
  using llvm::make_error;
77
  using llvm::Error;
78
  using llvm::Expected;
79
  using ExpectedType = llvm::Expected<QualType>;
80
  using ExpectedStmt = llvm::Expected<Stmt *>;
81
  using ExpectedExpr = llvm::Expected<Expr *>;
82
  using ExpectedDecl = llvm::Expected<Decl *>;
83
  using ExpectedSLoc = llvm::Expected<SourceLocation>;
84
  using ExpectedName = llvm::Expected<DeclarationName>;
85
86
92
  std::string ImportError::toString() const {
87
    // FIXME: Improve error texts.
88
92
    switch (Error) {
89
92
    case NameConflict:
90
92
      return "NameConflict";
91
0
    case UnsupportedConstruct:
92
0
      return "UnsupportedConstruct";
93
0
    case Unknown:
94
0
      return "Unknown error";
95
0
    }
96
0
    llvm_unreachable("Invalid error code.");
97
0
    return "Invalid error code.";
98
0
  }
99
100
0
  void ImportError::log(raw_ostream &OS) const {
101
0
    OS << toString();
102
0
  }
103
104
0
  std::error_code ImportError::convertToErrorCode() const {
105
0
    llvm_unreachable("Function not implemented.");
106
0
  }
107
108
  char ImportError::ID;
109
110
  template <class T>
111
  SmallVector<Decl *, 2>
112
682k
  getCanonicalForwardRedeclChain(Redeclarable<T>* D) {
113
682k
    SmallVector<Decl *, 2> Redecls;
114
883k
    for (auto *R : D->getFirstDecl()->redecls()) {
115
883k
      if (R != D->getFirstDecl())
116
200k
        Redecls.push_back(R);
117
883k
    }
118
682k
    Redecls.push_back(D->getFirstDecl());
119
682k
    std::reverse(Redecls.begin(), Redecls.end());
120
682k
    return Redecls;
121
682k
  }
llvm::SmallVector<clang::Decl*, 2u> clang::getCanonicalForwardRedeclChain<clang::FunctionDecl>(clang::Redeclarable<clang::FunctionDecl>*)
Line
Count
Source
112
515k
  getCanonicalForwardRedeclChain(Redeclarable<T>* D) {
113
515k
    SmallVector<Decl *, 2> Redecls;
114
698k
    for (auto *R : D->getFirstDecl()->redecls()) {
115
698k
      if (R != D->getFirstDecl())
116
183k
        Redecls.push_back(R);
117
698k
    }
118
515k
    Redecls.push_back(D->getFirstDecl());
119
515k
    std::reverse(Redecls.begin(), Redecls.end());
120
515k
    return Redecls;
121
515k
  }
llvm::SmallVector<clang::Decl*, 2u> clang::getCanonicalForwardRedeclChain<clang::VarDecl>(clang::Redeclarable<clang::VarDecl>*)
Line
Count
Source
112
138k
  getCanonicalForwardRedeclChain(Redeclarable<T>* D) {
113
138k
    SmallVector<Decl *, 2> Redecls;
114
145k
    for (auto *R : D->getFirstDecl()->redecls()) {
115
145k
      if (R != D->getFirstDecl())
116
6.86k
        Redecls.push_back(R);
117
145k
    }
118
138k
    Redecls.push_back(D->getFirstDecl());
119
138k
    std::reverse(Redecls.begin(), Redecls.end());
120
138k
    return Redecls;
121
138k
  }
llvm::SmallVector<clang::Decl*, 2u> clang::getCanonicalForwardRedeclChain<clang::TagDecl>(clang::Redeclarable<clang::TagDecl>*)
Line
Count
Source
112
28.9k
  getCanonicalForwardRedeclChain(Redeclarable<T>* D) {
113
28.9k
    SmallVector<Decl *, 2> Redecls;
114
39.7k
    for (auto *R : D->getFirstDecl()->redecls()) {
115
39.7k
      if (R != D->getFirstDecl())
116
10.7k
        Redecls.push_back(R);
117
39.7k
    }
118
28.9k
    Redecls.push_back(D->getFirstDecl());
119
28.9k
    std::reverse(Redecls.begin(), Redecls.end());
120
28.9k
    return Redecls;
121
28.9k
  }
122
123
682k
  SmallVector<Decl*, 2> getCanonicalForwardRedeclChain(Decl* D) {
124
682k
    if (auto *FD = dyn_cast<FunctionDecl>(D))
125
515k
      return getCanonicalForwardRedeclChain<FunctionDecl>(FD);
126
167k
    if (auto *VD = dyn_cast<VarDecl>(D))
127
138k
      return getCanonicalForwardRedeclChain<VarDecl>(VD);
128
28.9k
    if (auto *TD = dyn_cast<TagDecl>(D))
129
28.9k
      return getCanonicalForwardRedeclChain<TagDecl>(TD);
130
0
    llvm_unreachable("Bad declaration kind");
131
0
  }
132
133
10.4M
  void updateFlags(const Decl *From, Decl *To) {
134
    // Check if some flags or attrs are new in 'From' and copy into 'To'.
135
    // FIXME: Other flags or attrs?
136
10.4M
    if (From->isUsed(false) && 
!To->isUsed(false)416k
)
137
328
      To->setIsUsed();
138
10.4M
  }
139
140
  class ASTNodeImporter : public TypeVisitor<ASTNodeImporter, ExpectedType>,
141
                          public DeclVisitor<ASTNodeImporter, ExpectedDecl>,
142
                          public StmtVisitor<ASTNodeImporter, ExpectedStmt> {
143
    ASTImporter &Importer;
144
145
    // Use this instead of Importer.importInto .
146
    template <typename ImportT>
147
2.61M
    LLVM_NODISCARD Error importInto(ImportT &To, const ImportT &From) {
148
2.61M
      return Importer.importInto(To, From);
149
2.61M
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::SourceLocation>(clang::SourceLocation&, clang::SourceLocation const&)
Line
Count
Source
147
1.30M
    LLVM_NODISCARD Error importInto(ImportT &To, const ImportT &From) {
148
1.30M
      return Importer.importInto(To, From);
149
1.30M
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::DeclarationName>(clang::DeclarationName&, clang::DeclarationName const&)
Line
Count
Source
147
1.30M
    LLVM_NODISCARD Error importInto(ImportT &To, const ImportT &From) {
148
1.30M
      return Importer.importInto(To, From);
149
1.30M
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::QualType>(clang::QualType&, clang::QualType const&)
Line
Count
Source
147
999
    LLVM_NODISCARD Error importInto(ImportT &To, const ImportT &From) {
148
999
      return Importer.importInto(To, From);
149
999
    }
150
151
    // Use this to import pointers of specific type.
152
    template <typename ImportT>
153
424k
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
424k
      auto ToOrErr = Importer.Import(From);
155
424k
      if (ToOrErr)
156
424k
        To = cast_or_null<ImportT>(*ToOrErr);
157
424k
      return ToOrErr.takeError();
158
424k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::FunctionTemplateDecl>(clang::FunctionTemplateDecl*&, clang::FunctionTemplateDecl*)
Line
Count
Source
153
28.3k
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
28.3k
      auto ToOrErr = Importer.Import(From);
155
28.3k
      if (ToOrErr)
156
28.3k
        To = cast_or_null<ImportT>(*ToOrErr);
157
28.3k
      return ToOrErr.takeError();
158
28.3k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::Decl>(clang::Decl*&, clang::Decl*)
Line
Count
Source
153
19.0k
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
19.0k
      auto ToOrErr = Importer.Import(From);
155
19.0k
      if (ToOrErr)
156
19.0k
        To = cast_or_null<ImportT>(*ToOrErr);
157
19.0k
      return ToOrErr.takeError();
158
19.0k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::ClassTemplateDecl>(clang::ClassTemplateDecl*&, clang::ClassTemplateDecl*)
Line
Count
Source
153
101k
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
101k
      auto ToOrErr = Importer.Import(From);
155
101k
      if (ToOrErr)
156
101k
        To = cast_or_null<ImportT>(*ToOrErr);
157
101k
      return ToOrErr.takeError();
158
101k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::NamedDecl>(clang::NamedDecl*&, clang::NamedDecl*)
Line
Count
Source
153
19.3k
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
19.3k
      auto ToOrErr = Importer.Import(From);
155
19.3k
      if (ToOrErr)
156
19.3k
        To = cast_or_null<ImportT>(*ToOrErr);
157
19.3k
      return ToOrErr.takeError();
158
19.3k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::ObjCInterfaceDecl>(clang::ObjCInterfaceDecl*&, clang::ObjCInterfaceDecl*)
Line
Count
Source
153
2.48k
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
2.48k
      auto ToOrErr = Importer.Import(From);
155
2.48k
      if (ToOrErr)
156
2.48k
        To = cast_or_null<ImportT>(*ToOrErr);
157
2.48k
      return ToOrErr.takeError();
158
2.48k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::ObjCCategoryDecl>(clang::ObjCCategoryDecl*&, clang::ObjCCategoryDecl*)
Line
Count
Source
153
6
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
6
      auto ToOrErr = Importer.Import(From);
155
6
      if (ToOrErr)
156
6
        To = cast_or_null<ImportT>(*ToOrErr);
157
6
      return ToOrErr.takeError();
158
6
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::ObjCPropertyDecl>(clang::ObjCPropertyDecl*&, clang::ObjCPropertyDecl*)
Line
Count
Source
153
8
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
8
      auto ToOrErr = Importer.Import(From);
155
8
      if (ToOrErr)
156
8
        To = cast_or_null<ImportT>(*ToOrErr);
157
8
      return ToOrErr.takeError();
158
8
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::ObjCIvarDecl>(clang::ObjCIvarDecl*&, clang::ObjCIvarDecl*)
Line
Count
Source
153
8
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
8
      auto ToOrErr = Importer.Import(From);
155
8
      if (ToOrErr)
156
8
        To = cast_or_null<ImportT>(*ToOrErr);
157
8
      return ToOrErr.takeError();
158
8
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::CXXRecordDecl>(clang::CXXRecordDecl*&, clang::CXXRecordDecl*)
Line
Count
Source
153
63.5k
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
63.5k
      auto ToOrErr = Importer.Import(From);
155
63.5k
      if (ToOrErr)
156
63.5k
        To = cast_or_null<ImportT>(*ToOrErr);
157
63.5k
      return ToOrErr.takeError();
158
63.5k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::VarDecl>(clang::VarDecl*&, clang::VarDecl*)
Line
Count
Source
153
398
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
398
      auto ToOrErr = Importer.Import(From);
155
398
      if (ToOrErr)
156
398
        To = cast_or_null<ImportT>(*ToOrErr);
157
398
      return ToOrErr.takeError();
158
398
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::VarTemplateDecl>(clang::VarTemplateDecl*&, clang::VarTemplateDecl*)
Line
Count
Source
153
8
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
8
      auto ToOrErr = Importer.Import(From);
155
8
      if (ToOrErr)
156
8
        To = cast_or_null<ImportT>(*ToOrErr);
157
8
      return ToOrErr.takeError();
158
8
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::FunctionDecl>(clang::FunctionDecl*&, clang::FunctionDecl*)
Line
Count
Source
153
190k
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
190k
      auto ToOrErr = Importer.Import(From);
155
190k
      if (ToOrErr)
156
190k
        To = cast_or_null<ImportT>(*ToOrErr);
157
190k
      return ToOrErr.takeError();
158
190k
    }
159
160
    // Call the import function of ASTImporter for a baseclass of type `T` and
161
    // cast the return value to `T`.
162
    template <typename T>
163
16.8M
    Expected<T *> import(T *From) {
164
16.8M
      auto ToOrErr = Importer.Import(From);
165
16.8M
      if (!ToOrErr)
166
485
        return ToOrErr.takeError();
167
16.8M
      return cast_or_null<T>(*ToOrErr);
168
16.8M
    }
llvm::Expected<clang::Expr*> clang::ASTNodeImporter::import<clang::Expr>(clang::Expr*)
Line
Count
Source
163
4.88M
    Expected<T *> import(T *From) {
164
4.88M
      auto ToOrErr = Importer.Import(From);
165
4.88M
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
4.88M
      return cast_or_null<T>(*ToOrErr);
168
4.88M
    }
llvm::Expected<clang::ValueDecl*> clang::ASTNodeImporter::import<clang::ValueDecl>(clang::ValueDecl*)
Line
Count
Source
163
1.09M
    Expected<T *> import(T *From) {
164
1.09M
      auto ToOrErr = Importer.Import(From);
165
1.09M
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
1.09M
      return cast_or_null<T>(*ToOrErr);
168
1.09M
    }
llvm::Expected<clang::TypeSourceInfo*> clang::ASTNodeImporter::import<clang::TypeSourceInfo>(clang::TypeSourceInfo*)
Line
Count
Source
163
1.79M
    Expected<T *> import(T *From) {
164
1.79M
      auto ToOrErr = Importer.Import(From);
165
1.79M
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
1.79M
      return cast_or_null<T>(*ToOrErr);
168
1.79M
    }
llvm::Expected<clang::Decl*> clang::ASTNodeImporter::import<clang::Decl>(clang::Decl*)
Line
Count
Source
163
1.13M
    Expected<T *> import(T *From) {
164
1.13M
      auto ToOrErr = Importer.Import(From);
165
1.13M
      if (!ToOrErr)
166
375
        return ToOrErr.takeError();
167
1.13M
      return cast_or_null<T>(*ToOrErr);
168
1.13M
    }
llvm::Expected<clang::VarDecl*> clang::ASTNodeImporter::import<clang::VarDecl>(clang::VarDecl*)
Line
Count
Source
163
227k
    Expected<T *> import(T *From) {
164
227k
      auto ToOrErr = Importer.Import(From);
165
227k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
227k
      return cast_or_null<T>(*ToOrErr);
168
227k
    }
llvm::Expected<clang::UnresolvedUsingTypenameDecl*> clang::ASTNodeImporter::import<clang::UnresolvedUsingTypenameDecl>(clang::UnresolvedUsingTypenameDecl*)
Line
Count
Source
163
232
    Expected<T *> import(T *From) {
164
232
      auto ToOrErr = Importer.Import(From);
165
232
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
232
      return cast_or_null<T>(*ToOrErr);
168
232
    }
llvm::Expected<clang::TypedefNameDecl*> clang::ASTNodeImporter::import<clang::TypedefNameDecl>(clang::TypedefNameDecl*)
Line
Count
Source
163
110k
    Expected<T *> import(T *From) {
164
110k
      auto ToOrErr = Importer.Import(From);
165
110k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
110k
      return cast_or_null<T>(*ToOrErr);
168
110k
    }
llvm::Expected<clang::ConceptDecl*> clang::ASTNodeImporter::import<clang::ConceptDecl>(clang::ConceptDecl*)
Line
Count
Source
163
460
    Expected<T *> import(T *From) {
164
460
      auto ToOrErr = Importer.Import(From);
165
460
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
460
      return cast_or_null<T>(*ToOrErr);
168
460
    }
llvm::Expected<clang::CXXRecordDecl*> clang::ASTNodeImporter::import<clang::CXXRecordDecl>(clang::CXXRecordDecl*)
Line
Count
Source
163
241k
    Expected<T *> import(T *From) {
164
241k
      auto ToOrErr = Importer.Import(From);
165
241k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
241k
      return cast_or_null<T>(*ToOrErr);
168
241k
    }
llvm::Expected<clang::RecordDecl*> clang::ASTNodeImporter::import<clang::RecordDecl>(clang::RecordDecl*)
Line
Count
Source
163
70.6k
    Expected<T *> import(T *From) {
164
70.6k
      auto ToOrErr = Importer.Import(From);
165
70.6k
      if (!ToOrErr)
166
19
        return ToOrErr.takeError();
167
70.6k
      return cast_or_null<T>(*ToOrErr);
168
70.6k
    }
llvm::Expected<clang::EnumDecl*> clang::ASTNodeImporter::import<clang::EnumDecl>(clang::EnumDecl*)
Line
Count
Source
163
2.72k
    Expected<T *> import(T *From) {
164
2.72k
      auto ToOrErr = Importer.Import(From);
165
2.72k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
2.72k
      return cast_or_null<T>(*ToOrErr);
168
2.72k
    }
llvm::Expected<clang::TemplateTypeParmDecl*> clang::ASTNodeImporter::import<clang::TemplateTypeParmDecl>(clang::TemplateTypeParmDecl*)
Line
Count
Source
163
282k
    Expected<T *> import(T *From) {
164
282k
      auto ToOrErr = Importer.Import(From);
165
282k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
282k
      return cast_or_null<T>(*ToOrErr);
168
282k
    }
llvm::Expected<clang::NestedNameSpecifier*> clang::ASTNodeImporter::import<clang::NestedNameSpecifier>(clang::NestedNameSpecifier*)
Line
Count
Source
163
162k
    Expected<T *> import(T *From) {
164
162k
      auto ToOrErr = Importer.Import(From);
165
162k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
162k
      return cast_or_null<T>(*ToOrErr);
168
162k
    }
llvm::Expected<clang::TagDecl*> clang::ASTNodeImporter::import<clang::TagDecl>(clang::TagDecl*)
Line
Count
Source
163
57.2k
    Expected<T *> import(T *From) {
164
57.2k
      auto ToOrErr = Importer.Import(From);
165
57.2k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
57.2k
      return cast_or_null<T>(*ToOrErr);
168
57.2k
    }
llvm::Expected<clang::ObjCInterfaceDecl*> clang::ASTNodeImporter::import<clang::ObjCInterfaceDecl>(clang::ObjCInterfaceDecl*)
Line
Count
Source
163
3.03k
    Expected<T *> import(T *From) {
164
3.03k
      auto ToOrErr = Importer.Import(From);
165
3.03k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
3.03k
      return cast_or_null<T>(*ToOrErr);
168
3.03k
    }
llvm::Expected<clang::ObjCProtocolDecl*> clang::ASTNodeImporter::import<clang::ObjCProtocolDecl>(clang::ObjCProtocolDecl*)
Line
Count
Source
163
822
    Expected<T *> import(T *From) {
164
822
      auto ToOrErr = Importer.Import(From);
165
822
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
822
      return cast_or_null<T>(*ToOrErr);
168
822
    }
llvm::Expected<clang::CXXMethodDecl*> clang::ASTNodeImporter::import<clang::CXXMethodDecl>(clang::CXXMethodDecl*)
Line
Count
Source
163
28.4k
    Expected<T *> import(T *From) {
164
28.4k
      auto ToOrErr = Importer.Import(From);
165
28.4k
      if (!ToOrErr)
166
4
        return ToOrErr.takeError();
167
28.4k
      return cast_or_null<T>(*ToOrErr);
168
28.4k
    }
llvm::Expected<clang::Attr*> clang::ASTNodeImporter::import<clang::Attr>(clang::Attr*)
Line
Count
Source
163
543k
    Expected<T *> import(T *From) {
164
543k
      auto ToOrErr = Importer.Import(From);
165
543k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
543k
      return cast_or_null<T>(*ToOrErr);
168
543k
    }
llvm::Expected<clang::NamespaceDecl*> clang::ASTNodeImporter::import<clang::NamespaceDecl>(clang::NamespaceDecl*)
Line
Count
Source
163
104
    Expected<T *> import(T *From) {
164
104
      auto ToOrErr = Importer.Import(From);
165
104
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
104
      return cast_or_null<T>(*ToOrErr);
168
104
    }
llvm::Expected<clang::TypeAliasDecl*> clang::ASTNodeImporter::import<clang::TypeAliasDecl>(clang::TypeAliasDecl*)
Line
Count
Source
163
6.53k
    Expected<T *> import(T *From) {
164
6.53k
      auto ToOrErr = Importer.Import(From);
165
6.53k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
6.53k
      return cast_or_null<T>(*ToOrErr);
168
6.53k
    }
llvm::Expected<clang::LabelStmt*> clang::ASTNodeImporter::import<clang::LabelStmt>(clang::LabelStmt*)
Line
Count
Source
163
63
    Expected<T *> import(T *From) {
164
63
      auto ToOrErr = Importer.Import(From);
165
63
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
63
      return cast_or_null<T>(*ToOrErr);
168
63
    }
llvm::Expected<clang::FunctionDecl*> clang::ASTNodeImporter::import<clang::FunctionDecl>(clang::FunctionDecl*)
Line
Count
Source
163
863k
    Expected<T *> import(T *From) {
164
863k
      auto ToOrErr = Importer.Import(From);
165
863k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
863k
      return cast_or_null<T>(*ToOrErr);
168
863k
    }
llvm::Expected<clang::FunctionTemplateDecl*> clang::ASTNodeImporter::import<clang::FunctionTemplateDecl>(clang::FunctionTemplateDecl*)
Line
Count
Source
163
107k
    Expected<T *> import(T *From) {
164
107k
      auto ToOrErr = Importer.Import(From);
165
107k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
107k
      return cast_or_null<T>(*ToOrErr);
168
107k
    }
llvm::Expected<clang::Stmt*> clang::ASTNodeImporter::import<clang::Stmt>(clang::Stmt*)
Line
Count
Source
163
931k
    Expected<T *> import(T *From) {
164
931k
      auto ToOrErr = Importer.Import(From);
165
931k
      if (!ToOrErr)
166
56
        return ToOrErr.takeError();
167
931k
      return cast_or_null<T>(*ToOrErr);
168
931k
    }
llvm::Expected<clang::ParmVarDecl*> clang::ASTNodeImporter::import<clang::ParmVarDecl>(clang::ParmVarDecl*)
Line
Count
Source
163
647k
    Expected<T *> import(T *From) {
164
647k
      auto ToOrErr = Importer.Import(From);
165
647k
      if (!ToOrErr)
166
31
        return ToOrErr.takeError();
167
647k
      return cast_or_null<T>(*ToOrErr);
168
647k
    }
llvm::Expected<clang::CXXCtorInitializer*> clang::ASTNodeImporter::import<clang::CXXCtorInitializer>(clang::CXXCtorInitializer*)
Line
Count
Source
163
39.0k
    Expected<T *> import(T *From) {
164
39.0k
      auto ToOrErr = Importer.Import(From);
165
39.0k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
39.0k
      return cast_or_null<T>(*ToOrErr);
168
39.0k
    }
llvm::Expected<clang::NamedDecl*> clang::ASTNodeImporter::import<clang::NamedDecl>(clang::NamedDecl*)
Line
Count
Source
163
3.44M
    Expected<T *> import(T *From) {
164
3.44M
      auto ToOrErr = Importer.Import(From);
165
3.44M
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
3.44M
      return cast_or_null<T>(*ToOrErr);
168
3.44M
    }
llvm::Expected<clang::VarTemplateDecl*> clang::ASTNodeImporter::import<clang::VarTemplateDecl>(clang::VarTemplateDecl*)
Line
Count
Source
163
211
    Expected<T *> import(T *From) {
164
211
      auto ToOrErr = Importer.Import(From);
165
211
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
211
      return cast_or_null<T>(*ToOrErr);
168
211
    }
llvm::Expected<clang::ObjCCategoryImplDecl*> clang::ASTNodeImporter::import<clang::ObjCCategoryImplDecl>(clang::ObjCCategoryImplDecl*)
Line
Count
Source
163
6
    Expected<T *> import(T *From) {
164
6
      auto ToOrErr = Importer.Import(From);
165
6
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
6
      return cast_or_null<T>(*ToOrErr);
168
6
    }
llvm::Expected<clang::UsingShadowDecl*> clang::ASTNodeImporter::import<clang::UsingShadowDecl>(clang::UsingShadowDecl*)
Line
Count
Source
163
8.52k
    Expected<T *> import(T *From) {
164
8.52k
      auto ToOrErr = Importer.Import(From);
165
8.52k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
8.52k
      return cast_or_null<T>(*ToOrErr);
168
8.52k
    }
llvm::Expected<clang::UsingDecl*> clang::ASTNodeImporter::import<clang::UsingDecl>(clang::UsingDecl*)
Line
Count
Source
163
9.67k
    Expected<T *> import(T *From) {
164
9.67k
      auto ToOrErr = Importer.Import(From);
165
9.67k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
9.67k
      return cast_or_null<T>(*ToOrErr);
168
9.67k
    }
llvm::Expected<clang::ObjCCategoryDecl*> clang::ASTNodeImporter::import<clang::ObjCCategoryDecl>(clang::ObjCCategoryDecl*)
Line
Count
Source
163
2.42k
    Expected<T *> import(T *From) {
164
2.42k
      auto ToOrErr = Importer.Import(From);
165
2.42k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
2.42k
      return cast_or_null<T>(*ToOrErr);
168
2.42k
    }
llvm::Expected<clang::ObjCImplementationDecl*> clang::ASTNodeImporter::import<clang::ObjCImplementationDecl>(clang::ObjCImplementationDecl*)
Line
Count
Source
163
10
    Expected<T *> import(T *From) {
164
10
      auto ToOrErr = Importer.Import(From);
165
10
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
10
      return cast_or_null<T>(*ToOrErr);
168
10
    }
llvm::Expected<clang::ObjCTypeParamDecl*> clang::ASTNodeImporter::import<clang::ObjCTypeParamDecl>(clang::ObjCTypeParamDecl*)
Line
Count
Source
163
390
    Expected<T *> import(T *From) {
164
390
      auto ToOrErr = Importer.Import(From);
165
390
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
390
      return cast_or_null<T>(*ToOrErr);
168
390
    }
llvm::Expected<clang::ObjCMethodDecl*> clang::ASTNodeImporter::import<clang::ObjCMethodDecl>(clang::ObjCMethodDecl*)
Line
Count
Source
163
4.39k
    Expected<T *> import(T *From) {
164
4.39k
      auto ToOrErr = Importer.Import(From);
165
4.39k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
4.39k
      return cast_or_null<T>(*ToOrErr);
168
4.39k
    }
llvm::Expected<clang::ObjCIvarDecl*> clang::ASTNodeImporter::import<clang::ObjCIvarDecl>(clang::ObjCIvarDecl*)
Line
Count
Source
163
2.19k
    Expected<T *> import(T *From) {
164
2.19k
      auto ToOrErr = Importer.Import(From);
165
2.19k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
2.19k
      return cast_or_null<T>(*ToOrErr);
168
2.19k
    }
llvm::Expected<clang::FieldDecl*> clang::ASTNodeImporter::import<clang::FieldDecl>(clang::FieldDecl*)
Line
Count
Source
163
1.10k
    Expected<T *> import(T *From) {
164
1.10k
      auto ToOrErr = Importer.Import(From);
165
1.10k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
1.10k
      return cast_or_null<T>(*ToOrErr);
168
1.10k
    }
llvm::Expected<clang::VarTemplatePartialSpecializationDecl*> clang::ASTNodeImporter::import<clang::VarTemplatePartialSpecializationDecl>(clang::VarTemplatePartialSpecializationDecl*)
Line
Count
Source
163
2
    Expected<T *> import(T *From) {
164
2
      auto ToOrErr = Importer.Import(From);
165
2
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
2
      return cast_or_null<T>(*ToOrErr);
168
2
    }
llvm::Expected<clang::StringLiteral*> clang::ASTNodeImporter::import<clang::StringLiteral>(clang::StringLiteral*)
Line
Count
Source
163
9.81k
    Expected<T *> import(T *From) {
164
9.81k
      auto ToOrErr = Importer.Import(From);
165
9.81k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
9.81k
      return cast_or_null<T>(*ToOrErr);
168
9.81k
    }
Unexecuted instantiation: llvm::Expected<clang::AddrLabelExpr*> clang::ASTNodeImporter::import<clang::AddrLabelExpr>(clang::AddrLabelExpr*)
llvm::Expected<clang::LabelDecl*> clang::ASTNodeImporter::import<clang::LabelDecl>(clang::LabelDecl*)
Line
Count
Source
163
134
    Expected<T *> import(T *From) {
164
134
      auto ToOrErr = Importer.Import(From);
165
134
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
134
      return cast_or_null<T>(*ToOrErr);
168
134
    }
llvm::Expected<clang::SwitchCase*> clang::ASTNodeImporter::import<clang::SwitchCase>(clang::SwitchCase*)
Line
Count
Source
163
3.75k
    Expected<T *> import(T *From) {
164
3.75k
      auto ToOrErr = Importer.Import(From);
165
3.75k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
3.75k
      return cast_or_null<T>(*ToOrErr);
168
3.75k
    }
llvm::Expected<clang::CompoundStmt*> clang::ASTNodeImporter::import<clang::CompoundStmt>(clang::CompoundStmt*)
Line
Count
Source
163
12
    Expected<T *> import(T *From) {
164
12
      auto ToOrErr = Importer.Import(From);
165
12
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
12
      return cast_or_null<T>(*ToOrErr);
168
12
    }
llvm::Expected<clang::CXXCatchStmt*> clang::ASTNodeImporter::import<clang::CXXCatchStmt>(clang::CXXCatchStmt*)
Line
Count
Source
163
10
    Expected<T *> import(T *From) {
164
10
      auto ToOrErr = Importer.Import(From);
165
10
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
10
      return cast_or_null<T>(*ToOrErr);
168
10
    }
llvm::Expected<clang::DeclStmt*> clang::ASTNodeImporter::import<clang::DeclStmt>(clang::DeclStmt*)
Line
Count
Source
163
932
    Expected<T *> import(T *From) {
164
932
      auto ToOrErr = Importer.Import(From);
165
932
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
932
      return cast_or_null<T>(*ToOrErr);
168
932
    }
llvm::Expected<clang::ObjCAtFinallyStmt*> clang::ASTNodeImporter::import<clang::ObjCAtFinallyStmt>(clang::ObjCAtFinallyStmt*)
Line
Count
Source
163
6
    Expected<T *> import(T *From) {
164
6
      auto ToOrErr = Importer.Import(From);
165
6
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
6
      return cast_or_null<T>(*ToOrErr);
168
6
    }
llvm::Expected<clang::ObjCAtCatchStmt*> clang::ASTNodeImporter::import<clang::ObjCAtCatchStmt>(clang::ObjCAtCatchStmt*)
Line
Count
Source
163
6
    Expected<T *> import(T *From) {
164
6
      auto ToOrErr = Importer.Import(From);
165
6
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
6
      return cast_or_null<T>(*ToOrErr);
168
6
    }
llvm::Expected<clang::OpaqueValueExpr*> clang::ASTNodeImporter::import<clang::OpaqueValueExpr>(clang::OpaqueValueExpr*)
Line
Count
Source
163
118
    Expected<T *> import(T *From) {
164
118
      auto ToOrErr = Importer.Import(From);
165
118
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
118
      return cast_or_null<T>(*ToOrErr);
168
118
    }
llvm::Expected<clang::CXXBaseSpecifier*> clang::ASTNodeImporter::import<clang::CXXBaseSpecifier>(clang::CXXBaseSpecifier*)
Line
Count
Source
163
4.42k
    Expected<T *> import(T *From) {
164
4.42k
      auto ToOrErr = Importer.Import(From);
165
4.42k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
4.42k
      return cast_or_null<T>(*ToOrErr);
168
4.42k
    }
llvm::Expected<clang::CXXDestructorDecl*> clang::ASTNodeImporter::import<clang::CXXDestructorDecl>(clang::CXXDestructorDecl*)
Line
Count
Source
163
3.81k
    Expected<T *> import(T *From) {
164
3.81k
      auto ToOrErr = Importer.Import(From);
165
3.81k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
3.81k
      return cast_or_null<T>(*ToOrErr);
168
3.81k
    }
llvm::Expected<clang::CXXConstructorDecl*> clang::ASTNodeImporter::import<clang::CXXConstructorDecl>(clang::CXXConstructorDecl*)
Line
Count
Source
163
29.8k
    Expected<T *> import(T *From) {
164
29.8k
      auto ToOrErr = Importer.Import(From);
165
29.8k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
29.8k
      return cast_or_null<T>(*ToOrErr);
168
29.8k
    }
llvm::Expected<clang::LifetimeExtendedTemporaryDecl*> clang::ASTNodeImporter::import<clang::LifetimeExtendedTemporaryDecl>(clang::LifetimeExtendedTemporaryDecl*)
Line
Count
Source
163
11.3k
    Expected<T *> import(T *From) {
164
11.3k
      auto ToOrErr = Importer.Import(From);
165
11.3k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
11.3k
      return cast_or_null<T>(*ToOrErr);
168
11.3k
    }
llvm::Expected<clang::InitListExpr*> clang::ASTNodeImporter::import<clang::InitListExpr>(clang::InitListExpr*)
Line
Count
Source
163
820
    Expected<T *> import(T *From) {
164
820
      auto ToOrErr = Importer.Import(From);
165
820
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
820
      return cast_or_null<T>(*ToOrErr);
168
820
    }
llvm::Expected<clang::NonTypeTemplateParmDecl*> clang::ASTNodeImporter::import<clang::NonTypeTemplateParmDecl>(clang::NonTypeTemplateParmDecl*)
Line
Count
Source
163
25.3k
    Expected<T *> import(T *From) {
164
25.3k
      auto ToOrErr = Importer.Import(From);
165
25.3k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
25.3k
      return cast_or_null<T>(*ToOrErr);
168
25.3k
    }
169
170
    template <typename T>
171
730k
    Expected<T *> import(const T *From) {
172
730k
      return import(const_cast<T *>(From));
173
730k
    }
llvm::Expected<clang::Attr*> clang::ASTNodeImporter::import<clang::Attr>(clang::Attr const*)
Line
Count
Source
171
543k
    Expected<T *> import(const T *From) {
172
543k
      return import(const_cast<T *>(From));
173
543k
    }
llvm::Expected<clang::Expr*> clang::ASTNodeImporter::import<clang::Expr>(clang::Expr const*)
Line
Count
Source
171
42.8k
    Expected<T *> import(const T *From) {
172
42.8k
      return import(const_cast<T *>(From));
173
42.8k
    }
llvm::Expected<clang::VarDecl*> clang::ASTNodeImporter::import<clang::VarDecl>(clang::VarDecl const*)
Line
Count
Source
171
137k
    Expected<T *> import(const T *From) {
172
137k
      return import(const_cast<T *>(From));
173
137k
    }
llvm::Expected<clang::CXXDestructorDecl*> clang::ASTNodeImporter::import<clang::CXXDestructorDecl>(clang::CXXDestructorDecl const*)
Line
Count
Source
171
3.81k
    Expected<T *> import(const T *From) {
172
3.81k
      return import(const_cast<T *>(From));
173
3.81k
    }
llvm::Expected<clang::CXXMethodDecl*> clang::ASTNodeImporter::import<clang::CXXMethodDecl>(clang::CXXMethodDecl const*)
Line
Count
Source
171
2.40k
    Expected<T *> import(const T *From) {
172
2.40k
      return import(const_cast<T *>(From));
173
2.40k
    }
llvm::Expected<clang::FieldDecl*> clang::ASTNodeImporter::import<clang::FieldDecl>(clang::FieldDecl const*)
Line
Count
Source
171
2
    Expected<T *> import(const T *From) {
172
2
      return import(const_cast<T *>(From));
173
2
    }
Unexecuted instantiation: llvm::Expected<clang::AddrLabelExpr*> clang::ASTNodeImporter::import<clang::AddrLabelExpr>(clang::AddrLabelExpr const*)
llvm::Expected<clang::ValueDecl*> clang::ASTNodeImporter::import<clang::ValueDecl>(clang::ValueDecl const*)
Line
Count
Source
171
9
    Expected<T *> import(const T *From) {
172
9
      return import(const_cast<T *>(From));
173
9
    }
Unexecuted instantiation: llvm::Expected<clang::CXXRecordDecl*> clang::ASTNodeImporter::import<clang::CXXRecordDecl>(clang::CXXRecordDecl const*)
llvm::Expected<clang::Decl*> clang::ASTNodeImporter::import<clang::Decl>(clang::Decl const*)
Line
Count
Source
171
9
    Expected<T *> import(const T *From) {
172
9
      return import(const_cast<T *>(From));
173
9
    }
174
175
    // Call the import function of ASTImporter for type `T`.
176
    template <typename T>
177
25.0M
    Expected<T> import(const T &From) {
178
25.0M
      return Importer.Import(From);
179
25.0M
    }
llvm::Expected<clang::SourceLocation> clang::ASTNodeImporter::import<clang::SourceLocation>(clang::SourceLocation const&)
Line
Count
Source
177
11.9M
    Expected<T> import(const T &From) {
178
11.9M
      return Importer.Import(From);
179
11.9M
    }
llvm::Expected<clang::QualType> clang::ASTNodeImporter::import<clang::QualType>(clang::QualType const&)
Line
Count
Source
177
7.93M
    Expected<T> import(const T &From) {
178
7.93M
      return Importer.Import(From);
179
7.93M
    }
llvm::Expected<clang::TemplateName> clang::ASTNodeImporter::import<clang::TemplateName>(clang::TemplateName const&)
Line
Count
Source
177
538k
    Expected<T> import(const T &From) {
178
538k
      return Importer.Import(From);
179
538k
    }
llvm::Expected<clang::NestedNameSpecifierLoc> clang::ASTNodeImporter::import<clang::NestedNameSpecifierLoc>(clang::NestedNameSpecifierLoc const&)
Line
Count
Source
177
2.55M
    Expected<T> import(const T &From) {
178
2.55M
      return Importer.Import(From);
179
2.55M
    }
llvm::Expected<clang::SourceRange> clang::ASTNodeImporter::import<clang::SourceRange>(clang::SourceRange const&)
Line
Count
Source
177
496k
    Expected<T> import(const T &From) {
178
496k
      return Importer.Import(From);
179
496k
    }
llvm::Expected<clang::Selector> clang::ASTNodeImporter::import<clang::Selector>(clang::Selector const&)
Line
Count
Source
177
4.39k
    Expected<T> import(const T &From) {
178
4.39k
      return Importer.Import(From);
179
4.39k
    }
llvm::Expected<clang::DeclarationName> clang::ASTNodeImporter::import<clang::DeclarationName>(clang::DeclarationName const&)
Line
Count
Source
177
1.52M
    Expected<T> import(const T &From) {
178
1.52M
      return Importer.Import(From);
179
1.52M
    }
llvm::Expected<clang::APValue> clang::ASTNodeImporter::import<clang::APValue>(clang::APValue const&)
Line
Count
Source
177
48.6k
    Expected<T> import(const T &From) {
178
48.6k
      return Importer.Import(From);
179
48.6k
    }
llvm::Expected<llvm::PointerUnion<clang::BlockDecl*, clang::CompoundLiteralExpr*> > clang::ASTNodeImporter::import<llvm::PointerUnion<clang::BlockDecl*, clang::CompoundLiteralExpr*> >(llvm::PointerUnion<clang::BlockDecl*, clang::CompoundLiteralExpr*> const&)
Line
Count
Source
177
2
    Expected<T> import(const T &From) {
178
2
      return Importer.Import(From);
179
2
    }
180
181
    // Import an Optional<T> by importing the contained T, if any.
182
    template<typename T>
183
975
    Expected<Optional<T>> import(Optional<T> From) {
184
975
      if (!From)
185
890
        return Optional<T>();
186
85
      return import(*From);
187
85
    }
188
189
    // Helper for chaining together multiple imports. If an error is detected,
190
    // subsequent imports will return default constructed nodes, so that failure
191
    // can be detected with a single conditional branch after a sequence of
192
    // imports.
193
24.2M
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
24.2M
      if (Err)
196
632
        return T{};
197
24.2M
      Expected<T> MaybeVal = import(From);
198
24.2M
      if (!MaybeVal) {
199
340
        Err = MaybeVal.takeError();
200
340
        return T{};
201
340
      }
202
24.2M
      return *MaybeVal;
203
24.2M
    }
clang::QualType clang::ASTNodeImporter::importChecked<clang::QualType>(llvm::Error&, clang::QualType const&)
Line
Count
Source
193
4.12M
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
4.12M
      if (Err)
196
0
        return T{};
197
4.12M
      Expected<T> MaybeVal = import(From);
198
4.12M
      if (!MaybeVal) {
199
340
        Err = MaybeVal.takeError();
200
340
        return T{};
201
340
      }
202
4.12M
      return *MaybeVal;
203
4.12M
    }
clang::Expr const* clang::ASTNodeImporter::importChecked<clang::Expr const*>(llvm::Error&, clang::Expr const* const&)
Line
Count
Source
193
6.73k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
6.73k
      if (Err)
196
0
        return T{};
197
6.73k
      Expected<T> MaybeVal = import(From);
198
6.73k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
6.73k
      return *MaybeVal;
203
6.73k
    }
clang::Expr* clang::ASTNodeImporter::importChecked<clang::Expr*>(llvm::Error&, clang::Expr* const&)
Line
Count
Source
193
2.84M
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
2.84M
      if (Err)
196
13
        return T{};
197
2.84M
      Expected<T> MaybeVal = import(From);
198
2.84M
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
2.84M
      return *MaybeVal;
203
2.84M
    }
clang::SourceRange clang::ASTNodeImporter::importChecked<clang::SourceRange>(llvm::Error&, clang::SourceRange const&)
Line
Count
Source
193
62.3k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
62.3k
      if (Err)
196
0
        return T{};
197
62.3k
      Expected<T> MaybeVal = import(From);
198
62.3k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
62.3k
      return *MaybeVal;
203
62.3k
    }
clang::FunctionDecl* clang::ASTNodeImporter::importChecked<clang::FunctionDecl*>(llvm::Error&, clang::FunctionDecl* const&)
Line
Count
Source
193
762k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
762k
      if (Err)
196
0
        return T{};
197
762k
      Expected<T> MaybeVal = import(From);
198
762k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
762k
      return *MaybeVal;
203
762k
    }
clang::UnresolvedUsingTypenameDecl* clang::ASTNodeImporter::importChecked<clang::UnresolvedUsingTypenameDecl*>(llvm::Error&, clang::UnresolvedUsingTypenameDecl* const&)
Line
Count
Source
193
232
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
232
      if (Err)
196
0
        return T{};
197
232
      Expected<T> MaybeVal = import(From);
198
232
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
232
      return *MaybeVal;
203
232
    }
clang::Decl* clang::ASTNodeImporter::importChecked<clang::Decl*>(llvm::Error&, clang::Decl* const&)
Line
Count
Source
193
232
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
232
      if (Err)
196
0
        return T{};
197
232
      Expected<T> MaybeVal = import(From);
198
232
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
232
      return *MaybeVal;
203
232
    }
clang::SourceLocation clang::ASTNodeImporter::importChecked<clang::SourceLocation>(llvm::Error&, clang::SourceLocation const&)
Line
Count
Source
193
8.91M
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
8.91M
      if (Err)
196
266
        return T{};
197
8.91M
      Expected<T> MaybeVal = import(From);
198
8.91M
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
8.91M
      return *MaybeVal;
203
8.91M
    }
clang::StringLiteral* clang::ASTNodeImporter::importChecked<clang::StringLiteral*>(llvm::Error&, clang::StringLiteral* const&)
Line
Count
Source
193
9.79k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
9.79k
      if (Err)
196
0
        return T{};
197
9.79k
      Expected<T> MaybeVal = import(From);
198
9.79k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
9.79k
      return *MaybeVal;
203
9.79k
    }
clang::NestedNameSpecifierLoc clang::ASTNodeImporter::importChecked<clang::NestedNameSpecifierLoc>(llvm::Error&, clang::NestedNameSpecifierLoc const&)
Line
Count
Source
193
2.15M
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
2.15M
      if (Err)
196
13
        return T{};
197
2.15M
      Expected<T> MaybeVal = import(From);
198
2.15M
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
2.15M
      return *MaybeVal;
203
2.15M
    }
clang::NamespaceDecl* clang::ASTNodeImporter::importChecked<clang::NamespaceDecl*>(llvm::Error&, clang::NamespaceDecl* const&)
Line
Count
Source
193
104
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
104
      if (Err)
196
0
        return T{};
197
104
      Expected<T> MaybeVal = import(From);
198
104
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
104
      return *MaybeVal;
203
104
    }
clang::TypeSourceInfo* clang::ASTNodeImporter::importChecked<clang::TypeSourceInfo*>(llvm::Error&, clang::TypeSourceInfo* const&)
Line
Count
Source
193
1.58M
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
1.58M
      if (Err)
196
340
        return T{};
197
1.58M
      Expected<T> MaybeVal = import(From);
198
1.58M
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
1.58M
      return *MaybeVal;
203
1.58M
    }
clang::TemplateParameterList* clang::ASTNodeImporter::importChecked<clang::TemplateParameterList*>(llvm::Error&, clang::TemplateParameterList* const&)
Line
Count
Source
193
6.53k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
6.53k
      if (Err)
196
0
        return T{};
197
6.53k
      Expected<T> MaybeVal = import(From);
198
6.53k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
6.53k
      return *MaybeVal;
203
6.53k
    }
clang::TypeAliasDecl* clang::ASTNodeImporter::importChecked<clang::TypeAliasDecl*>(llvm::Error&, clang::TypeAliasDecl* const&)
Line
Count
Source
193
6.53k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
6.53k
      if (Err)
196
0
        return T{};
197
6.53k
      Expected<T> MaybeVal = import(From);
198
6.53k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
6.53k
      return *MaybeVal;
203
6.53k
    }
clang::DeclarationName clang::ASTNodeImporter::importChecked<clang::DeclarationName>(llvm::Error&, clang::DeclarationName const&)
Line
Count
Source
193
1.52M
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
1.52M
      if (Err)
196
0
        return T{};
197
1.52M
      Expected<T> MaybeVal = import(From);
198
1.52M
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
1.52M
      return *MaybeVal;
203
1.52M
    }
clang::Selector clang::ASTNodeImporter::importChecked<clang::Selector>(llvm::Error&, clang::Selector const&)
Line
Count
Source
193
4.39k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
4.39k
      if (Err)
196
0
        return T{};
197
4.39k
      Expected<T> MaybeVal = import(From);
198
4.39k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
4.39k
      return *MaybeVal;
203
4.39k
    }
clang::ObjCMethodDecl* clang::ASTNodeImporter::importChecked<clang::ObjCMethodDecl*>(llvm::Error&, clang::ObjCMethodDecl* const&)
Line
Count
Source
193
4.39k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
4.39k
      if (Err)
196
0
        return T{};
197
4.39k
      Expected<T> MaybeVal = import(From);
198
4.39k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
4.39k
      return *MaybeVal;
203
4.39k
    }
clang::ObjCIvarDecl* clang::ASTNodeImporter::importChecked<clang::ObjCIvarDecl*>(llvm::Error&, clang::ObjCIvarDecl* const&)
Line
Count
Source
193
2.19k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
2.19k
      if (Err)
196
0
        return T{};
197
2.19k
      Expected<T> MaybeVal = import(From);
198
2.19k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
2.19k
      return *MaybeVal;
203
2.19k
    }
clang::NamedDecl* clang::ASTNodeImporter::importChecked<clang::NamedDecl*>(llvm::Error&, clang::NamedDecl* const&)
Line
Count
Source
193
443k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
443k
      if (Err)
196
0
        return T{};
197
443k
      Expected<T> MaybeVal = import(From);
198
443k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
443k
      return *MaybeVal;
203
443k
    }
Unexecuted instantiation: clang::ConceptDecl* clang::ASTNodeImporter::importChecked<clang::ConceptDecl*>(llvm::Error&, clang::ConceptDecl* const&)
clang::DeclGroupRef clang::ASTNodeImporter::importChecked<clang::DeclGroupRef>(llvm::Error&, clang::DeclGroupRef const&)
Line
Count
Source
193
117k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
117k
      if (Err)
196
0
        return T{};
197
117k
      Expected<T> MaybeVal = import(From);
198
117k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
117k
      return *MaybeVal;
203
117k
    }
clang::Stmt* clang::ASTNodeImporter::importChecked<clang::Stmt*>(llvm::Error&, clang::Stmt* const&)
Line
Count
Source
193
250k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
250k
      if (Err)
196
0
        return T{};
197
250k
      Expected<T> MaybeVal = import(From);
198
250k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
250k
      return *MaybeVal;
203
250k
    }
clang::LabelDecl* clang::ASTNodeImporter::importChecked<clang::LabelDecl*>(llvm::Error&, clang::LabelDecl* const&)
Line
Count
Source
193
134
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
134
      if (Err)
196
0
        return T{};
197
134
      Expected<T> MaybeVal = import(From);
198
134
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
134
      return *MaybeVal;
203
134
    }
clang::VarDecl* clang::ASTNodeImporter::importChecked<clang::VarDecl*>(llvm::Error&, clang::VarDecl* const&)
Line
Count
Source
193
89.6k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
89.6k
      if (Err)
196
0
        return T{};
197
89.6k
      Expected<T> MaybeVal = import(From);
198
89.6k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
89.6k
      return *MaybeVal;
203
89.6k
    }
clang::VarDecl const* clang::ASTNodeImporter::importChecked<clang::VarDecl const*>(llvm::Error&, clang::VarDecl const* const&)
Line
Count
Source
193
137k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
137k
      if (Err)
196
0
        return T{};
197
137k
      Expected<T> MaybeVal = import(From);
198
137k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
137k
      return *MaybeVal;
203
137k
    }
clang::DeclStmt* clang::ASTNodeImporter::importChecked<clang::DeclStmt*>(llvm::Error&, clang::DeclStmt* const&)
Line
Count
Source
193
932
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
932
      if (Err)
196
0
        return T{};
197
932
      Expected<T> MaybeVal = import(From);
198
932
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
932
      return *MaybeVal;
203
932
    }
clang::ObjCAtFinallyStmt* clang::ASTNodeImporter::importChecked<clang::ObjCAtFinallyStmt*>(llvm::Error&, clang::ObjCAtFinallyStmt* const&)
Line
Count
Source
193
6
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
6
      if (Err)
196
0
        return T{};
197
6
      Expected<T> MaybeVal = import(From);
198
6
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
6
      return *MaybeVal;
203
6
    }
clang::CompoundStmt* clang::ASTNodeImporter::importChecked<clang::CompoundStmt*>(llvm::Error&, clang::CompoundStmt* const&)
Line
Count
Source
193
4
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
4
      if (Err)
196
0
        return T{};
197
4
      Expected<T> MaybeVal = import(From);
198
4
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
4
      return *MaybeVal;
203
4
    }
clang::ValueDecl* clang::ASTNodeImporter::importChecked<clang::ValueDecl*>(llvm::Error&, clang::ValueDecl* const&)
Line
Count
Source
193
1.09M
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
1.09M
      if (Err)
196
0
        return T{};
197
1.09M
      Expected<T> MaybeVal = import(From);
198
1.09M
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
1.09M
      return *MaybeVal;
203
1.09M
    }
clang::APValue clang::ASTNodeImporter::importChecked<clang::APValue>(llvm::Error&, clang::APValue const&)
Line
Count
Source
193
48.6k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
48.6k
      if (Err)
196
0
        return T{};
197
48.6k
      Expected<T> MaybeVal = import(From);
198
48.6k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
48.6k
      return *MaybeVal;
203
48.6k
    }
clang::OpaqueValueExpr* clang::ASTNodeImporter::importChecked<clang::OpaqueValueExpr*>(llvm::Error&, clang::OpaqueValueExpr* const&)
Line
Count
Source
193
118
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
118
      if (Err)
196
0
        return T{};
197
118
      Expected<T> MaybeVal = import(From);
198
118
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
118
      return *MaybeVal;
203
118
    }
clang::CXXConstructorDecl* clang::ASTNodeImporter::importChecked<clang::CXXConstructorDecl*>(llvm::Error&, clang::CXXConstructorDecl* const&)
Line
Count
Source
193
29.8k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
29.8k
      if (Err)
196
0
        return T{};
197
29.8k
      Expected<T> MaybeVal = import(From);
198
29.8k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
29.8k
      return *MaybeVal;
203
29.8k
    }
clang::LifetimeExtendedTemporaryDecl* clang::ASTNodeImporter::importChecked<clang::LifetimeExtendedTemporaryDecl*>(llvm::Error&, clang::LifetimeExtendedTemporaryDecl* const&)
Line
Count
Source
193
11.3k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
11.3k
      if (Err)
196
0
        return T{};
197
11.3k
      Expected<T> MaybeVal = import(From);
198
11.3k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
11.3k
      return *MaybeVal;
203
11.3k
    }
llvm::Optional<clang::Expr*> clang::ASTNodeImporter::importChecked<llvm::Optional<clang::Expr*> >(llvm::Error&, llvm::Optional<clang::Expr*> const&)
Line
Count
Source
193
975
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
975
      if (Err)
196
0
        return T{};
197
975
      Expected<T> MaybeVal = import(From);
198
975
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
975
      return *MaybeVal;
203
975
    }
clang::NonTypeTemplateParmDecl* clang::ASTNodeImporter::importChecked<clang::NonTypeTemplateParmDecl*>(llvm::Error&, clang::NonTypeTemplateParmDecl* const&)
Line
Count
Source
193
25.3k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
25.3k
      if (Err)
196
0
        return T{};
197
25.3k
      Expected<T> MaybeVal = import(From);
198
25.3k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
25.3k
      return *MaybeVal;
203
25.3k
    }
clang::FieldDecl const* clang::ASTNodeImporter::importChecked<clang::FieldDecl const*>(llvm::Error&, clang::FieldDecl const* const&)
Line
Count
Source
193
2
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
2
      if (Err)
196
0
        return T{};
197
2
      Expected<T> MaybeVal = import(From);
198
2
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
2
      return *MaybeVal;
203
2
    }
Unexecuted instantiation: clang::AddrLabelExpr const* clang::ASTNodeImporter::importChecked<clang::AddrLabelExpr const*>(llvm::Error&, clang::AddrLabelExpr const* const&)
clang::ValueDecl const* clang::ASTNodeImporter::importChecked<clang::ValueDecl const*>(llvm::Error&, clang::ValueDecl const* const&)
Line
Count
Source
193
9
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
9
      if (Err)
196
0
        return T{};
197
9
      Expected<T> MaybeVal = import(From);
198
9
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
9
      return *MaybeVal;
203
9
    }
Unexecuted instantiation: clang::CXXRecordDecl const* clang::ASTNodeImporter::importChecked<clang::CXXRecordDecl const*>(llvm::Error&, clang::CXXRecordDecl const* const&)
clang::Decl const* clang::ASTNodeImporter::importChecked<clang::Decl const*>(llvm::Error&, clang::Decl const* const&)
Line
Count
Source
193
9
    template <typename T> T importChecked(Error &Err, const T &From) {
194
      // Don't attempt to import nodes if we hit an error earlier.
195
9
      if (Err)
196
0
        return T{};
197
9
      Expected<T> MaybeVal = import(From);
198
9
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
9
      return *MaybeVal;
203
9
    }
204
205
    // Wrapper for an overload set.
206
    template <typename ToDeclT> struct CallOverloadedCreateFun {
207
2.20M
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
2.20M
        return ToDeclT::Create(std::forward<Args>(args)...);
209
2.20M
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::EmptyDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&)
Line
Count
Source
207
1
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
1
        return ToDeclT::Create(std::forward<Args>(args)...);
209
1
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::AccessSpecDecl>::operator()<clang::ASTContext&, clang::AccessSpecifier, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&>(clang::ASTContext&, clang::AccessSpecifier&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&)
Line
Count
Source
207
32.2k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
32.2k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
32.2k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::StaticAssertDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::Expr*&, clang::StringLiteral*&, clang::SourceLocation&, bool>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::Expr*&, clang::StringLiteral*&, clang::SourceLocation&, bool&&)
Line
Count
Source
207
9.79k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
9.79k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
9.79k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::NamespaceDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, bool, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, std::nullptr_t>(clang::ASTContext&, clang::DeclContext*&, bool&&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, std::nullptr_t&&)
Line
Count
Source
207
1.56k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
1.56k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
1.56k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::NamespaceAliasDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::NamespaceDecl*&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::NamespaceDecl*&)
Line
Count
Source
207
3
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
3
        return ToDeclT::Create(std::forward<Args>(args)...);
209
3
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TypeAliasDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::TypeSourceInfo*&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::TypeSourceInfo*&)
Line
Count
Source
207
9.77k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
9.77k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
9.77k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TypedefDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::TypeSourceInfo*&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::TypeSourceInfo*&)
Line
Count
Source
207
121k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
121k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
121k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TypeAliasTemplateDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::TypeAliasDecl*&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::TypeAliasDecl*&)
Line
Count
Source
207
6.32k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
6.32k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
6.32k
      }
Unexecuted instantiation: decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::LabelDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, clang::SourceLocation&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::SourceLocation&)
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::LabelDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&)
Line
Count
Source
207
63
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
63
        return ToDeclT::Create(std::forward<Args>(args)...);
209
63
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::EnumDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::EnumDecl*&, bool, bool, bool>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::EnumDecl*&, bool&&, bool&&, bool&&)
Line
Count
Source
207
2.07k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
2.07k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
2.07k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXRecordDecl>::operator()<clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::CXXRecordDecl*, bool const&>(clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::CXXRecordDecl*&&, bool const&)
Line
Count
Source
207
66.8k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
66.8k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
66.8k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXRecordDecl>::operator()<clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::CXXRecordDecl*>(clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::CXXRecordDecl*&&)
Line
Count
Source
207
50.4k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
50.4k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
50.4k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::RecordDecl>::operator()<clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::RecordDecl*&>(clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::RecordDecl*&)
Line
Count
Source
207
132
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
132
        return ToDeclT::Create(std::forward<Args>(args)...);
209
132
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::EnumConstantDecl>::operator()<clang::ASTContext&, clang::EnumDecl*, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::Expr*&, llvm::APSInt const&>(clang::ASTContext&, clang::EnumDecl*&&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::Expr*&, llvm::APSInt const&)
Line
Count
Source
207
4.57k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
4.57k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
4.57k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXConstructorDecl>::operator()<clang::ASTContext&, clang::CXXRecordDecl*, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::ExplicitSpecifier, bool, bool, clang::ConstexprSpecKind, clang::InheritedConstructor, clang::Expr*&>(clang::ASTContext&, clang::CXXRecordDecl*&&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::ExplicitSpecifier&&, bool&&, bool&&, clang::ConstexprSpecKind&&, clang::InheritedConstructor&&, clang::Expr*&)
Line
Count
Source
207
93.9k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
93.9k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
93.9k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXDestructorDecl>::operator()<clang::ASTContext&, clang::CXXRecordDecl*, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, bool, bool, clang::ConstexprSpecKind, clang::Expr*&>(clang::ASTContext&, clang::CXXRecordDecl*&&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, bool&&, bool&&, clang::ConstexprSpecKind&&, clang::Expr*&)
Line
Count
Source
207
14.0k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
14.0k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
14.0k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXConversionDecl>::operator()<clang::ASTContext&, clang::CXXRecordDecl*, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, bool, clang::ExplicitSpecifier, clang::ConstexprSpecKind, clang::SourceLocation, clang::Expr*&>(clang::ASTContext&, clang::CXXRecordDecl*&&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, bool&&, clang::ExplicitSpecifier&&, clang::ConstexprSpecKind&&, clang::SourceLocation&&, clang::Expr*&)
Line
Count
Source
207
2.58k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
2.58k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
2.58k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXMethodDecl>::operator()<clang::ASTContext&, clang::CXXRecordDecl*, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, bool, clang::ConstexprSpecKind, clang::SourceLocation, clang::Expr*&>(clang::ASTContext&, clang::CXXRecordDecl*&&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, bool&&, clang::ConstexprSpecKind&&, clang::SourceLocation&&, clang::Expr*&)
Line
Count
Source
207
295k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
295k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
295k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::FunctionDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, bool, bool, clang::ConstexprSpecKind, clang::Expr*&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, bool&&, bool&&, clang::ConstexprSpecKind&&, clang::Expr*&)
Line
Count
Source
207
69.3k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
69.3k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
69.3k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::FieldDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::TypeSourceInfo*&, clang::Expr*&, bool, clang::InClassInitStyle>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::TypeSourceInfo*&, clang::Expr*&, bool&&, clang::InClassInitStyle&&)
Line
Count
Source
207
38.7k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
38.7k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
38.7k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::IndirectFieldDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, llvm::MutableArrayRef<clang::NamedDecl*>&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, llvm::MutableArrayRef<clang::NamedDecl*>&)
Line
Count
Source
207
1.73k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
1.73k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
1.73k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::FriendDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, llvm::PointerUnion<clang::NamedDecl*, clang::TypeSourceInfo*>&, clang::SourceLocation&, llvm::SmallVector<clang::TemplateParameterList*, 1u>&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, llvm::PointerUnion<clang::NamedDecl*, clang::TypeSourceInfo*>&, clang::SourceLocation&, llvm::SmallVector<clang::TemplateParameterList*, 1u>&)
Line
Count
Source
207
21.4k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
21.4k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
21.4k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCIvarDecl>::operator()<clang::ASTContext&, clang::ObjCContainerDecl*, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::TypeSourceInfo*&, clang::ObjCIvarDecl::AccessControl, clang::Expr*&, bool>(clang::ASTContext&, clang::ObjCContainerDecl*&&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::TypeSourceInfo*&, clang::ObjCIvarDecl::AccessControl&&, clang::Expr*&, bool&&)
Line
Count
Source
207
1.58k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
1.58k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
1.58k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::VarDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&)
Line
Count
Source
207
137k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
137k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
137k
      }
Unexecuted instantiation: decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ImplicitParamDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::ImplicitParamDecl::ImplicitParamKind>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::ImplicitParamDecl::ImplicitParamKind&&)
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ParmVarDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, std::nullptr_t>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, std::nullptr_t&&)
Line
Count
Source
207
644k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
644k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
644k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCMethodDecl>::operator()<clang::ASTContext&, clang::SourceLocation&, clang::SourceLocation&, clang::Selector, clang::QualType&, clang::TypeSourceInfo*&, clang::DeclContext*&, bool, bool, bool, bool, bool, bool, clang::ObjCMethodDecl::ImplementationControl, bool>(clang::ASTContext&, clang::SourceLocation&, clang::SourceLocation&, clang::Selector&&, clang::QualType&, clang::TypeSourceInfo*&, clang::DeclContext*&, bool&&, bool&&, bool&&, bool&&, bool&&, bool&&, clang::ObjCMethodDecl::ImplementationControl&&, bool&&)
Line
Count
Source
207
8.43k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
8.43k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
8.43k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCTypeParamDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::ObjCTypeParamVariance, clang::SourceLocation&, unsigned int, clang::SourceLocation&, clang::IdentifierInfo*, clang::SourceLocation&, clang::TypeSourceInfo*&>(clang::ASTContext&, clang::DeclContext*&, clang::ObjCTypeParamVariance&&, clang::SourceLocation&, unsigned int&&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::SourceLocation&, clang::TypeSourceInfo*&)
Line
Count
Source
207
390
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
390
        return ToDeclT::Create(std::forward<Args>(args)...);
209
390
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCCategoryDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::ObjCInterfaceDecl*&, std::nullptr_t, clang::SourceLocation&, clang::SourceLocation&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::ObjCInterfaceDecl*&, std::nullptr_t&&, clang::SourceLocation&, clang::SourceLocation&)
Line
Count
Source
207
2.44k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
2.44k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
2.44k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCProtocolDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::IdentifierInfo*, clang::SourceLocation&, clang::SourceLocation&, std::nullptr_t>(clang::ASTContext&, clang::DeclContext*&, clang::IdentifierInfo*&&, clang::SourceLocation&, clang::SourceLocation&, std::nullptr_t&&)
Line
Count
Source
207
374
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
374
        return ToDeclT::Create(std::forward<Args>(args)...);
209
374
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::LinkageSpecDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::LinkageSpecDecl::LanguageIDs, bool&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::LinkageSpecDecl::LanguageIDs&&, bool&)
Line
Count
Source
207
4.39k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
4.39k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
4.39k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UsingDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::DeclarationNameInfo&, bool>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::DeclarationNameInfo&, bool&&)
Line
Count
Source
207
1.63k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
1.63k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
1.63k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UsingShadowDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::UsingDecl*&, clang::NamedDecl*&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::UsingDecl*&, clang::NamedDecl*&)
Line
Count
Source
207
8.52k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
8.52k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
8.52k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UsingDirectiveDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::NamespaceDecl*&, clang::DeclContext*&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::NamespaceDecl*&, clang::DeclContext*&)
Line
Count
Source
207
101
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
101
        return ToDeclT::Create(std::forward<Args>(args)...);
209
101
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UnresolvedUsingValueDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::DeclarationNameInfo&, clang::SourceLocation&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::DeclarationNameInfo&, clang::SourceLocation&)
Line
Count
Source
207
1
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
1
        return ToDeclT::Create(std::forward<Args>(args)...);
209
1
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UnresolvedUsingTypenameDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::DeclarationName&, clang::SourceLocation&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::DeclarationName&, clang::SourceLocation&)
Line
Count
Source
207
232
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
232
        return ToDeclT::Create(std::forward<Args>(args)...);
209
232
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCInterfaceDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, std::nullptr_t, std::nullptr_t, clang::SourceLocation&, bool>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, std::nullptr_t&&, std::nullptr_t&&, clang::SourceLocation&, bool&&)
Line
Count
Source
207
2.26k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
2.26k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
2.26k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCCategoryImplDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::IdentifierInfo*, clang::ObjCInterfaceDecl*, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&>(clang::ASTContext&, clang::DeclContext*&, clang::IdentifierInfo*&&, clang::ObjCInterfaceDecl*&&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&)
Line
Count
Source
207
4
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
4
        return ToDeclT::Create(std::forward<Args>(args)...);
209
4
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCImplementationDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::ObjCInterfaceDecl*&, clang::ObjCInterfaceDecl*&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&>(clang::ASTContext&, clang::DeclContext*&, clang::ObjCInterfaceDecl*&, clang::ObjCInterfaceDecl*&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&)
Line
Count
Source
207
10
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
10
        return ToDeclT::Create(std::forward<Args>(args)...);
209
10
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCPropertyDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, clang::SourceLocation&, clang::SourceLocation&, clang::QualType&, clang::TypeSourceInfo*&, clang::ObjCPropertyDecl::PropertyControl>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::SourceLocation&, clang::SourceLocation&, clang::QualType&, clang::TypeSourceInfo*&, clang::ObjCPropertyDecl::PropertyControl&&)
Line
Count
Source
207
2.19k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
2.19k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
2.19k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCPropertyImplDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::ObjCPropertyDecl*&, clang::ObjCPropertyImplDecl::Kind, clang::ObjCIvarDecl*&, clang::SourceLocation&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::ObjCPropertyDecl*&, clang::ObjCPropertyImplDecl::Kind&&, clang::ObjCIvarDecl*&, clang::SourceLocation&)
Line
Count
Source
207
4
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
4
        return ToDeclT::Create(std::forward<Args>(args)...);
209
4
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TemplateTypeParmDecl>::operator()<clang::ASTContext&, clang::TranslationUnitDecl*, clang::SourceLocation&, clang::SourceLocation&, unsigned int, unsigned int, clang::IdentifierInfo*, bool, bool, bool>(clang::ASTContext&, clang::TranslationUnitDecl*&&, clang::SourceLocation&, clang::SourceLocation&, unsigned int&&, unsigned int&&, clang::IdentifierInfo*&&, bool&&, bool&&, bool&&)
Line
Count
Source
207
313k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
313k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
313k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::NonTypeTemplateParmDecl>::operator()<clang::ASTContext&, clang::TranslationUnitDecl*, clang::SourceLocation&, clang::SourceLocation&, unsigned int, unsigned int, clang::IdentifierInfo*, clang::QualType&, bool, clang::TypeSourceInfo*&>(clang::ASTContext&, clang::TranslationUnitDecl*&&, clang::SourceLocation&, clang::SourceLocation&, unsigned int&&, unsigned int&&, clang::IdentifierInfo*&&, clang::QualType&, bool&&, clang::TypeSourceInfo*&)
Line
Count
Source
207
43.4k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
43.4k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
43.4k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TemplateTemplateParmDecl>::operator()<clang::ASTContext&, clang::TranslationUnitDecl*, clang::SourceLocation&, unsigned int, unsigned int, bool, clang::IdentifierInfo*, clang::TemplateParameterList*&>(clang::ASTContext&, clang::TranslationUnitDecl*&&, clang::SourceLocation&, unsigned int&&, unsigned int&&, bool&&, clang::IdentifierInfo*&&, clang::TemplateParameterList*&)
Line
Count
Source
207
435
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
435
        return ToDeclT::Create(std::forward<Args>(args)...);
209
435
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ClassTemplateDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::CXXRecordDecl*&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::CXXRecordDecl*&)
Line
Count
Source
207
31.8k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
31.8k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
31.8k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ClassTemplatePartialSpecializationDecl>::operator()<clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::TemplateParameterList*&, clang::ClassTemplateDecl*&, llvm::ArrayRef<clang::TemplateArgument>, clang::TemplateArgumentListInfo&, clang::QualType&, clang::ClassTemplatePartialSpecializationDecl*>(clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::TemplateParameterList*&, clang::ClassTemplateDecl*&, llvm::ArrayRef<clang::TemplateArgument>&&, clang::TemplateArgumentListInfo&, clang::QualType&, clang::ClassTemplatePartialSpecializationDecl*&&)
Line
Count
Source
207
991
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
991
        return ToDeclT::Create(std::forward<Args>(args)...);
209
991
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ClassTemplateSpecializationDecl>::operator()<clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::ClassTemplateDecl*&, llvm::SmallVector<clang::TemplateArgument, 2u>&, clang::ClassTemplateSpecializationDecl*&>(clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::ClassTemplateDecl*&, llvm::SmallVector<clang::TemplateArgument, 2u>&, clang::ClassTemplateSpecializationDecl*&)
Line
Count
Source
207
49.0k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
49.0k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
49.0k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::VarTemplateDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::VarDecl*&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::VarDecl*&)
Line
Count
Source
207
211
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
211
        return ToDeclT::Create(std::forward<Args>(args)...);
209
211
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::VarTemplatePartialSpecializationDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::TemplateParameterList*&, clang::VarTemplateDecl*&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, llvm::SmallVector<clang::TemplateArgument, 2u>&, clang::TemplateArgumentListInfo&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::TemplateParameterList*&, clang::VarTemplateDecl*&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, llvm::SmallVector<clang::TemplateArgument, 2u>&, clang::TemplateArgumentListInfo&)
Line
Count
Source
207
2
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
2
        return ToDeclT::Create(std::forward<Args>(args)...);
209
2
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::VarTemplateSpecializationDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::VarTemplateDecl*&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, llvm::SmallVector<clang::TemplateArgument, 2u>&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::VarTemplateDecl*&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, llvm::SmallVector<clang::TemplateArgument, 2u>&)
Line
Count
Source
207
6
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
6
        return ToDeclT::Create(std::forward<Args>(args)...);
209
6
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::FunctionTemplateDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::FunctionDecl*&>(clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::FunctionDecl*&)
Line
Count
Source
207
104k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
104k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
104k
      }
decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::LifetimeExtendedTemporaryDecl>::operator()<clang::Expr*&, clang::ValueDecl*&, unsigned int>(clang::Expr*&, clang::ValueDecl*&, unsigned int&&)
Line
Count
Source
207
2
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
2
        return ToDeclT::Create(std::forward<Args>(args)...);
209
2
      }
210
    };
211
212
    // Always use these functions to create a Decl during import. There are
213
    // certain tasks which must be done after the Decl was created, e.g. we
214
    // must immediately register that as an imported Decl.  The parameter `ToD`
215
    // will be set to the newly created Decl or if had been imported before
216
    // then to the already imported Decl.  Returns a bool value set to true if
217
    // the `FromD` had been imported before.
218
    template <typename ToDeclT, typename FromDeclT, typename... Args>
219
    LLVM_NODISCARD bool GetImportedOrCreateDecl(ToDeclT *&ToD, FromDeclT *FromD,
220
1.78M
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
1.78M
      CallOverloadedCreateFun<ToDeclT> OC;
225
1.78M
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
1.78M
                                            std::forward<Args>(args)...);
227
1.78M
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::EmptyDecl, clang::EmptyDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&>(clang::EmptyDecl*&, clang::EmptyDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&)
Line
Count
Source
220
1
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
1
      CallOverloadedCreateFun<ToDeclT> OC;
225
1
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
1
                                            std::forward<Args>(args)...);
227
1
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::AccessSpecDecl, clang::AccessSpecDecl, clang::ASTContext&, clang::AccessSpecifier, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&>(clang::AccessSpecDecl*&, clang::AccessSpecDecl*, clang::ASTContext&, clang::AccessSpecifier&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&)
Line
Count
Source
220
32.2k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
32.2k
      CallOverloadedCreateFun<ToDeclT> OC;
225
32.2k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
32.2k
                                            std::forward<Args>(args)...);
227
32.2k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::StaticAssertDecl, clang::StaticAssertDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::Expr*&, clang::StringLiteral*&, clang::SourceLocation&, bool>(clang::StaticAssertDecl*&, clang::StaticAssertDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::Expr*&, clang::StringLiteral*&, clang::SourceLocation&, bool&&)
Line
Count
Source
220
9.79k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
9.79k
      CallOverloadedCreateFun<ToDeclT> OC;
225
9.79k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
9.79k
                                            std::forward<Args>(args)...);
227
9.79k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::NamespaceDecl, clang::NamespaceDecl, clang::ASTContext&, clang::DeclContext*&, bool, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, std::nullptr_t>(clang::NamespaceDecl*&, clang::NamespaceDecl*, clang::ASTContext&, clang::DeclContext*&, bool&&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, std::nullptr_t&&)
Line
Count
Source
220
1.56k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
1.56k
      CallOverloadedCreateFun<ToDeclT> OC;
225
1.56k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
1.56k
                                            std::forward<Args>(args)...);
227
1.56k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::NamespaceAliasDecl, clang::NamespaceAliasDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::NamespaceDecl*&>(clang::NamespaceAliasDecl*&, clang::NamespaceAliasDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::NamespaceDecl*&)
Line
Count
Source
220
3
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
3
      CallOverloadedCreateFun<ToDeclT> OC;
225
3
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
3
                                            std::forward<Args>(args)...);
227
3
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::TypeAliasTemplateDecl, clang::TypeAliasTemplateDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::TypeAliasDecl*&>(clang::TypeAliasTemplateDecl*&, clang::TypeAliasTemplateDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::TypeAliasDecl*&)
Line
Count
Source
220
6.53k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
6.53k
      CallOverloadedCreateFun<ToDeclT> OC;
225
6.53k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
6.53k
                                            std::forward<Args>(args)...);
227
6.53k
    }
Unexecuted instantiation: bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::LabelDecl, clang::LabelDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, clang::SourceLocation&>(clang::LabelDecl*&, clang::LabelDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::SourceLocation&)
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::LabelDecl, clang::LabelDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*>(clang::LabelDecl*&, clang::LabelDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&)
Line
Count
Source
220
63
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
63
      CallOverloadedCreateFun<ToDeclT> OC;
225
63
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
63
                                            std::forward<Args>(args)...);
227
63
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::EnumDecl, clang::EnumDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::EnumDecl*&, bool, bool, bool>(clang::EnumDecl*&, clang::EnumDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::EnumDecl*&, bool&&, bool&&, bool&&)
Line
Count
Source
220
2.07k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
2.07k
      CallOverloadedCreateFun<ToDeclT> OC;
225
2.07k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
2.07k
                                            std::forward<Args>(args)...);
227
2.07k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::CXXRecordDecl, clang::RecordDecl, clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::CXXRecordDecl*, bool const&>(clang::CXXRecordDecl*&, clang::RecordDecl*, clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::CXXRecordDecl*&&, bool const&)
Line
Count
Source
220
66.8k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
66.8k
      CallOverloadedCreateFun<ToDeclT> OC;
225
66.8k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
66.8k
                                            std::forward<Args>(args)...);
227
66.8k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::CXXRecordDecl, clang::RecordDecl, clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::CXXRecordDecl*>(clang::CXXRecordDecl*&, clang::RecordDecl*, clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::CXXRecordDecl*&&)
Line
Count
Source
220
51.0k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
51.0k
      CallOverloadedCreateFun<ToDeclT> OC;
225
51.0k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
51.0k
                                            std::forward<Args>(args)...);
227
51.0k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::RecordDecl, clang::RecordDecl, clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::RecordDecl*&>(clang::RecordDecl*&, clang::RecordDecl*, clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::RecordDecl*&)
Line
Count
Source
220
145
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
145
      CallOverloadedCreateFun<ToDeclT> OC;
225
145
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
145
                                            std::forward<Args>(args)...);
227
145
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::EnumConstantDecl, clang::EnumConstantDecl, clang::ASTContext&, clang::EnumDecl*, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::Expr*&, llvm::APSInt const&>(clang::EnumConstantDecl*&, clang::EnumConstantDecl*, clang::ASTContext&, clang::EnumDecl*&&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::Expr*&, llvm::APSInt const&)
Line
Count
Source
220
4.57k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
4.57k
      CallOverloadedCreateFun<ToDeclT> OC;
225
4.57k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
4.57k
                                            std::forward<Args>(args)...);
227
4.57k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::FunctionDecl, clang::FunctionDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, bool, bool, clang::ConstexprSpecKind, clang::Expr*&>(clang::FunctionDecl*&, clang::FunctionDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, bool&&, bool&&, clang::ConstexprSpecKind&&, clang::Expr*&)
Line
Count
Source
220
69.3k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
69.3k
      CallOverloadedCreateFun<ToDeclT> OC;
225
69.3k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
69.3k
                                            std::forward<Args>(args)...);
227
69.3k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::FieldDecl, clang::FieldDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::TypeSourceInfo*&, clang::Expr*&, bool, clang::InClassInitStyle>(clang::FieldDecl*&, clang::FieldDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::TypeSourceInfo*&, clang::Expr*&, bool&&, clang::InClassInitStyle&&)
Line
Count
Source
220
38.9k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
38.9k
      CallOverloadedCreateFun<ToDeclT> OC;
225
38.9k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
38.9k
                                            std::forward<Args>(args)...);
227
38.9k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::IndirectFieldDecl, clang::IndirectFieldDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, llvm::MutableArrayRef<clang::NamedDecl*>&>(clang::IndirectFieldDecl*&, clang::IndirectFieldDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, llvm::MutableArrayRef<clang::NamedDecl*>&)
Line
Count
Source
220
1.73k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
1.73k
      CallOverloadedCreateFun<ToDeclT> OC;
225
1.73k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
1.73k
                                            std::forward<Args>(args)...);
227
1.73k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::FriendDecl, clang::FriendDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, llvm::PointerUnion<clang::NamedDecl*, clang::TypeSourceInfo*>&, clang::SourceLocation&, llvm::SmallVector<clang::TemplateParameterList*, 1u>&>(clang::FriendDecl*&, clang::FriendDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, llvm::PointerUnion<clang::NamedDecl*, clang::TypeSourceInfo*>&, clang::SourceLocation&, llvm::SmallVector<clang::TemplateParameterList*, 1u>&)
Line
Count
Source
220
21.4k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
21.4k
      CallOverloadedCreateFun<ToDeclT> OC;
225
21.4k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
21.4k
                                            std::forward<Args>(args)...);
227
21.4k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ObjCIvarDecl, clang::ObjCIvarDecl, clang::ASTContext&, clang::ObjCContainerDecl*, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::TypeSourceInfo*&, clang::ObjCIvarDecl::AccessControl, clang::Expr*&, bool>(clang::ObjCIvarDecl*&, clang::ObjCIvarDecl*, clang::ASTContext&, clang::ObjCContainerDecl*&&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::TypeSourceInfo*&, clang::ObjCIvarDecl::AccessControl&&, clang::Expr*&, bool&&)
Line
Count
Source
220
1.58k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
1.58k
      CallOverloadedCreateFun<ToDeclT> OC;
225
1.58k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
1.58k
                                            std::forward<Args>(args)...);
227
1.58k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::VarDecl, clang::VarDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass>(clang::VarDecl*&, clang::VarDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&)
Line
Count
Source
220
137k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
137k
      CallOverloadedCreateFun<ToDeclT> OC;
225
137k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
137k
                                            std::forward<Args>(args)...);
227
137k
    }
Unexecuted instantiation: bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ImplicitParamDecl, clang::ImplicitParamDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::ImplicitParamDecl::ImplicitParamKind>(clang::ImplicitParamDecl*&, clang::ImplicitParamDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::ImplicitParamDecl::ImplicitParamKind&&)
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ParmVarDecl, clang::ParmVarDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, std::nullptr_t>(clang::ParmVarDecl*&, clang::ParmVarDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, std::nullptr_t&&)
Line
Count
Source
220
644k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
644k
      CallOverloadedCreateFun<ToDeclT> OC;
225
644k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
644k
                                            std::forward<Args>(args)...);
227
644k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ObjCMethodDecl, clang::ObjCMethodDecl, clang::ASTContext&, clang::SourceLocation&, clang::SourceLocation&, clang::Selector, clang::QualType&, clang::TypeSourceInfo*&, clang::DeclContext*&, bool, bool, bool, bool, bool, bool, clang::ObjCMethodDecl::ImplementationControl, bool>(clang::ObjCMethodDecl*&, clang::ObjCMethodDecl*, clang::ASTContext&, clang::SourceLocation&, clang::SourceLocation&, clang::Selector&&, clang::QualType&, clang::TypeSourceInfo*&, clang::DeclContext*&, bool&&, bool&&, bool&&, bool&&, bool&&, bool&&, clang::ObjCMethodDecl::ImplementationControl&&, bool&&)
Line
Count
Source
220
8.43k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
8.43k
      CallOverloadedCreateFun<ToDeclT> OC;
225
8.43k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
8.43k
                                            std::forward<Args>(args)...);
227
8.43k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ObjCTypeParamDecl, clang::ObjCTypeParamDecl, clang::ASTContext&, clang::DeclContext*&, clang::ObjCTypeParamVariance, clang::SourceLocation&, unsigned int, clang::SourceLocation&, clang::IdentifierInfo*, clang::SourceLocation&, clang::TypeSourceInfo*&>(clang::ObjCTypeParamDecl*&, clang::ObjCTypeParamDecl*, clang::ASTContext&, clang::DeclContext*&, clang::ObjCTypeParamVariance&&, clang::SourceLocation&, unsigned int&&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::SourceLocation&, clang::TypeSourceInfo*&)
Line
Count
Source
220
390
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
390
      CallOverloadedCreateFun<ToDeclT> OC;
225
390
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
390
                                            std::forward<Args>(args)...);
227
390
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ObjCCategoryDecl, clang::ObjCCategoryDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::ObjCInterfaceDecl*&, std::nullptr_t, clang::SourceLocation&, clang::SourceLocation&>(clang::ObjCCategoryDecl*&, clang::ObjCCategoryDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::ObjCInterfaceDecl*&, std::nullptr_t&&, clang::SourceLocation&, clang::SourceLocation&)
Line
Count
Source
220
2.44k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
2.44k
      CallOverloadedCreateFun<ToDeclT> OC;
225
2.44k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
2.44k
                                            std::forward<Args>(args)...);
227
2.44k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ObjCProtocolDecl, clang::ObjCProtocolDecl, clang::ASTContext&, clang::DeclContext*&, clang::IdentifierInfo*, clang::SourceLocation&, clang::SourceLocation&, std::nullptr_t>(clang::ObjCProtocolDecl*&, clang::ObjCProtocolDecl*, clang::ASTContext&, clang::DeclContext*&, clang::IdentifierInfo*&&, clang::SourceLocation&, clang::SourceLocation&, std::nullptr_t&&)
Line
Count
Source
220
374
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
374
      CallOverloadedCreateFun<ToDeclT> OC;
225
374
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
374
                                            std::forward<Args>(args)...);
227
374
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::LinkageSpecDecl, clang::LinkageSpecDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::LinkageSpecDecl::LanguageIDs, bool&>(clang::LinkageSpecDecl*&, clang::LinkageSpecDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::LinkageSpecDecl::LanguageIDs&&, bool&)
Line
Count
Source
220
4.39k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
4.39k
      CallOverloadedCreateFun<ToDeclT> OC;
225
4.39k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
4.39k
                                            std::forward<Args>(args)...);
227
4.39k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::UsingDecl, clang::UsingDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::DeclarationNameInfo&, bool>(clang::UsingDecl*&, clang::UsingDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::DeclarationNameInfo&, bool&&)
Line
Count
Source
220
1.63k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
1.63k
      CallOverloadedCreateFun<ToDeclT> OC;
225
1.63k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
1.63k
                                            std::forward<Args>(args)...);
227
1.63k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::UsingShadowDecl, clang::UsingShadowDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::UsingDecl*&, clang::NamedDecl*&>(clang::UsingShadowDecl*&, clang::UsingShadowDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::UsingDecl*&, clang::NamedDecl*&)
Line
Count
Source
220
9.67k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
9.67k
      CallOverloadedCreateFun<ToDeclT> OC;
225
9.67k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
9.67k
                                            std::forward<Args>(args)...);
227
9.67k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::UsingDirectiveDecl, clang::UsingDirectiveDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::NamespaceDecl*&, clang::DeclContext*&>(clang::UsingDirectiveDecl*&, clang::UsingDirectiveDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::NamespaceDecl*&, clang::DeclContext*&)
Line
Count
Source
220
101
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
101
      CallOverloadedCreateFun<ToDeclT> OC;
225
101
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
101
                                            std::forward<Args>(args)...);
227
101
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::UnresolvedUsingValueDecl, clang::UnresolvedUsingValueDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::DeclarationNameInfo&, clang::SourceLocation&>(clang::UnresolvedUsingValueDecl*&, clang::UnresolvedUsingValueDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::DeclarationNameInfo&, clang::SourceLocation&)
Line
Count
Source
220
1
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
1
      CallOverloadedCreateFun<ToDeclT> OC;
225
1
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
1
                                            std::forward<Args>(args)...);
227
1
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::UnresolvedUsingTypenameDecl, clang::UnresolvedUsingTypenameDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::DeclarationName&, clang::SourceLocation&>(clang::UnresolvedUsingTypenameDecl*&, clang::UnresolvedUsingTypenameDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::DeclarationName&, clang::SourceLocation&)
Line
Count
Source
220
241
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
241
      CallOverloadedCreateFun<ToDeclT> OC;
225
241
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
241
                                            std::forward<Args>(args)...);
227
241
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ObjCInterfaceDecl, clang::ObjCInterfaceDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, std::nullptr_t, std::nullptr_t, clang::SourceLocation&, bool>(clang::ObjCInterfaceDecl*&, clang::ObjCInterfaceDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, std::nullptr_t&&, std::nullptr_t&&, clang::SourceLocation&, bool&&)
Line
Count
Source
220
2.26k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
2.26k
      CallOverloadedCreateFun<ToDeclT> OC;
225
2.26k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
2.26k
                                            std::forward<Args>(args)...);
227
2.26k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ObjCCategoryImplDecl, clang::ObjCCategoryImplDecl, clang::ASTContext&, clang::DeclContext*&, clang::IdentifierInfo*, clang::ObjCInterfaceDecl*, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&>(clang::ObjCCategoryImplDecl*&, clang::ObjCCategoryImplDecl*, clang::ASTContext&, clang::DeclContext*&, clang::IdentifierInfo*&&, clang::ObjCInterfaceDecl*&&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&)
Line
Count
Source
220
4
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
4
      CallOverloadedCreateFun<ToDeclT> OC;
225
4
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
4
                                            std::forward<Args>(args)...);
227
4
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ObjCImplementationDecl, clang::ObjCImplementationDecl, clang::ASTContext&, clang::DeclContext*&, clang::ObjCInterfaceDecl*&, clang::ObjCInterfaceDecl*&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&>(clang::ObjCImplementationDecl*&, clang::ObjCImplementationDecl*, clang::ASTContext&, clang::DeclContext*&, clang::ObjCInterfaceDecl*&, clang::ObjCInterfaceDecl*&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&)
Line
Count
Source
220
10
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
10
      CallOverloadedCreateFun<ToDeclT> OC;
225
10
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
10
                                            std::forward<Args>(args)...);
227
10
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ObjCPropertyDecl, clang::ObjCPropertyDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, clang::SourceLocation&, clang::SourceLocation&, clang::QualType&, clang::TypeSourceInfo*&, clang::ObjCPropertyDecl::PropertyControl>(clang::ObjCPropertyDecl*&, clang::ObjCPropertyDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::SourceLocation&, clang::SourceLocation&, clang::QualType&, clang::TypeSourceInfo*&, clang::ObjCPropertyDecl::PropertyControl&&)
Line
Count
Source
220
2.19k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
2.19k
      CallOverloadedCreateFun<ToDeclT> OC;
225
2.19k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
2.19k
                                            std::forward<Args>(args)...);
227
2.19k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ObjCPropertyImplDecl, clang::ObjCPropertyImplDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::ObjCPropertyDecl*&, clang::ObjCPropertyImplDecl::Kind, clang::ObjCIvarDecl*&, clang::SourceLocation&>(clang::ObjCPropertyImplDecl*&, clang::ObjCPropertyImplDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::ObjCPropertyDecl*&, clang::ObjCPropertyImplDecl::Kind&&, clang::ObjCIvarDecl*&, clang::SourceLocation&)
Line
Count
Source
220
4
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
4
      CallOverloadedCreateFun<ToDeclT> OC;
225
4
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
4
                                            std::forward<Args>(args)...);
227
4
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::TemplateTypeParmDecl, clang::TemplateTypeParmDecl, clang::ASTContext&, clang::TranslationUnitDecl*, clang::SourceLocation&, clang::SourceLocation&, unsigned int, unsigned int, clang::IdentifierInfo*, bool, bool, bool>(clang::TemplateTypeParmDecl*&, clang::TemplateTypeParmDecl*, clang::ASTContext&, clang::TranslationUnitDecl*&&, clang::SourceLocation&, clang::SourceLocation&, unsigned int&&, unsigned int&&, clang::IdentifierInfo*&&, bool&&, bool&&, bool&&)
Line
Count
Source
220
313k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
313k
      CallOverloadedCreateFun<ToDeclT> OC;
225
313k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
313k
                                            std::forward<Args>(args)...);
227
313k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::NonTypeTemplateParmDecl, clang::NonTypeTemplateParmDecl, clang::ASTContext&, clang::TranslationUnitDecl*, clang::SourceLocation&, clang::SourceLocation&, unsigned int, unsigned int, clang::IdentifierInfo*, clang::QualType&, bool, clang::TypeSourceInfo*&>(clang::NonTypeTemplateParmDecl*&, clang::NonTypeTemplateParmDecl*, clang::ASTContext&, clang::TranslationUnitDecl*&&, clang::SourceLocation&, clang::SourceLocation&, unsigned int&&, unsigned int&&, clang::IdentifierInfo*&&, clang::QualType&, bool&&, clang::TypeSourceInfo*&)
Line
Count
Source
220
43.4k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
43.4k
      CallOverloadedCreateFun<ToDeclT> OC;
225
43.4k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
43.4k
                                            std::forward<Args>(args)...);
227
43.4k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::TemplateTemplateParmDecl, clang::TemplateTemplateParmDecl, clang::ASTContext&, clang::TranslationUnitDecl*, clang::SourceLocation&, unsigned int, unsigned int, bool, clang::IdentifierInfo*, clang::TemplateParameterList*&>(clang::TemplateTemplateParmDecl*&, clang::TemplateTemplateParmDecl*, clang::ASTContext&, clang::TranslationUnitDecl*&&, clang::SourceLocation&, unsigned int&&, unsigned int&&, bool&&, clang::IdentifierInfo*&&, clang::TemplateParameterList*&)
Line
Count
Source
220
435
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
435
      CallOverloadedCreateFun<ToDeclT> OC;
225
435
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
435
                                            std::forward<Args>(args)...);
227
435
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ClassTemplateDecl, clang::ClassTemplateDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::CXXRecordDecl*&>(clang::ClassTemplateDecl*&, clang::ClassTemplateDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::CXXRecordDecl*&)
Line
Count
Source
220
63.5k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
63.5k
      CallOverloadedCreateFun<ToDeclT> OC;
225
63.5k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
63.5k
                                            std::forward<Args>(args)...);
227
63.5k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ClassTemplateSpecializationDecl, clang::ClassTemplateSpecializationDecl, clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::ClassTemplateDecl*&, llvm::SmallVector<clang::TemplateArgument, 2u>&, clang::ClassTemplateSpecializationDecl*&>(clang::ClassTemplateSpecializationDecl*&, clang::ClassTemplateSpecializationDecl*, clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::ClassTemplateDecl*&, llvm::SmallVector<clang::TemplateArgument, 2u>&, clang::ClassTemplateSpecializationDecl*&)
Line
Count
Source
220
49.0k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
49.0k
      CallOverloadedCreateFun<ToDeclT> OC;
225
49.0k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
49.0k
                                            std::forward<Args>(args)...);
227
49.0k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::VarTemplateDecl, clang::VarTemplateDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::VarDecl*&>(clang::VarTemplateDecl*&, clang::VarTemplateDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::VarDecl*&)
Line
Count
Source
220
398
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
398
      CallOverloadedCreateFun<ToDeclT> OC;
225
398
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
398
                                            std::forward<Args>(args)...);
227
398
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::VarTemplatePartialSpecializationDecl, clang::VarTemplateSpecializationDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::TemplateParameterList*&, clang::VarTemplateDecl*&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, llvm::SmallVector<clang::TemplateArgument, 2u>&, clang::TemplateArgumentListInfo&>(clang::VarTemplatePartialSpecializationDecl*&, clang::VarTemplateSpecializationDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::TemplateParameterList*&, clang::VarTemplateDecl*&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, llvm::SmallVector<clang::TemplateArgument, 2u>&, clang::TemplateArgumentListInfo&)
Line
Count
Source
220
2
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
2
      CallOverloadedCreateFun<ToDeclT> OC;
225
2
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
2
                                            std::forward<Args>(args)...);
227
2
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::VarTemplateSpecializationDecl, clang::VarTemplateSpecializationDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::VarTemplateDecl*&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, llvm::SmallVector<clang::TemplateArgument, 2u>&>(clang::VarTemplateSpecializationDecl*&, clang::VarTemplateSpecializationDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::VarTemplateDecl*&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, llvm::SmallVector<clang::TemplateArgument, 2u>&)
Line
Count
Source
220
6
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
6
      CallOverloadedCreateFun<ToDeclT> OC;
225
6
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
6
                                            std::forward<Args>(args)...);
227
6
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::FunctionTemplateDecl, clang::FunctionTemplateDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::FunctionDecl*&>(clang::FunctionTemplateDecl*&, clang::FunctionTemplateDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::FunctionDecl*&)
Line
Count
Source
220
190k
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
190k
      CallOverloadedCreateFun<ToDeclT> OC;
225
190k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
190k
                                            std::forward<Args>(args)...);
227
190k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::LifetimeExtendedTemporaryDecl, clang::LifetimeExtendedTemporaryDecl, clang::Expr*&, clang::ValueDecl*&, unsigned int>(clang::LifetimeExtendedTemporaryDecl*&, clang::LifetimeExtendedTemporaryDecl*, clang::Expr*&, clang::ValueDecl*&, unsigned int&&)
Line
Count
Source
220
2
                                                Args &&... args) {
221
      // There may be several overloads of ToDeclT::Create. We must make sure
222
      // to call the one which would be chosen by the arguments, thus we use a
223
      // wrapper for the overload set.
224
2
      CallOverloadedCreateFun<ToDeclT> OC;
225
2
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
2
                                            std::forward<Args>(args)...);
227
2
    }
228
    // Use this overload if a special Type is needed to be created.  E.g if we
229
    // want to create a `TypeAliasDecl` and assign that to a `TypedefNameDecl`
230
    // then:
231
    // TypedefNameDecl *ToTypedef;
232
    // GetImportedOrCreateDecl<TypeAliasDecl>(ToTypedef, FromD, ...);
233
    template <typename NewDeclT, typename ToDeclT, typename FromDeclT,
234
              typename... Args>
235
    LLVM_NODISCARD bool GetImportedOrCreateDecl(ToDeclT *&ToD, FromDeclT *FromD,
236
541k
                                                Args &&... args) {
237
541k
      CallOverloadedCreateFun<NewDeclT> OC;
238
541k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
541k
                                            std::forward<Args>(args)...);
240
541k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::TypeAliasDecl, clang::TypedefNameDecl, clang::TypedefNameDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::TypeSourceInfo*&>(clang::TypedefNameDecl*&, clang::TypedefNameDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::TypeSourceInfo*&)
Line
Count
Source
236
9.99k
                                                Args &&... args) {
237
9.99k
      CallOverloadedCreateFun<NewDeclT> OC;
238
9.99k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
9.99k
                                            std::forward<Args>(args)...);
240
9.99k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::TypedefDecl, clang::TypedefNameDecl, clang::TypedefNameDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::TypeSourceInfo*&>(clang::TypedefNameDecl*&, clang::TypedefNameDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::TypeSourceInfo*&)
Line
Count
Source
236
123k
                                                Args &&... args) {
237
123k
      CallOverloadedCreateFun<NewDeclT> OC;
238
123k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
123k
                                            std::forward<Args>(args)...);
240
123k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::CXXConstructorDecl, clang::FunctionDecl, clang::FunctionDecl, clang::ASTContext&, clang::CXXRecordDecl*, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::ExplicitSpecifier, bool, bool, clang::ConstexprSpecKind, clang::InheritedConstructor, clang::Expr*&>(clang::FunctionDecl*&, clang::FunctionDecl*, clang::ASTContext&, clang::CXXRecordDecl*&&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::ExplicitSpecifier&&, bool&&, bool&&, clang::ConstexprSpecKind&&, clang::InheritedConstructor&&, clang::Expr*&)
Line
Count
Source
236
94.1k
                                                Args &&... args) {
237
94.1k
      CallOverloadedCreateFun<NewDeclT> OC;
238
94.1k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
94.1k
                                            std::forward<Args>(args)...);
240
94.1k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::CXXDestructorDecl, clang::FunctionDecl, clang::FunctionDecl, clang::ASTContext&, clang::CXXRecordDecl*, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, bool, bool, clang::ConstexprSpecKind, clang::Expr*&>(clang::FunctionDecl*&, clang::FunctionDecl*, clang::ASTContext&, clang::CXXRecordDecl*&&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, bool&&, bool&&, clang::ConstexprSpecKind&&, clang::Expr*&)
Line
Count
Source
236
14.0k
                                                Args &&... args) {
237
14.0k
      CallOverloadedCreateFun<NewDeclT> OC;
238
14.0k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
14.0k
                                            std::forward<Args>(args)...);
240
14.0k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::CXXConversionDecl, clang::FunctionDecl, clang::FunctionDecl, clang::ASTContext&, clang::CXXRecordDecl*, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, bool, clang::ExplicitSpecifier, clang::ConstexprSpecKind, clang::SourceLocation, clang::Expr*&>(clang::FunctionDecl*&, clang::FunctionDecl*, clang::ASTContext&, clang::CXXRecordDecl*&&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, bool&&, clang::ExplicitSpecifier&&, clang::ConstexprSpecKind&&, clang::SourceLocation&&, clang::Expr*&)
Line
Count
Source
236
2.58k
                                                Args &&... args) {
237
2.58k
      CallOverloadedCreateFun<NewDeclT> OC;
238
2.58k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
2.58k
                                            std::forward<Args>(args)...);
240
2.58k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::CXXMethodDecl, clang::FunctionDecl, clang::FunctionDecl, clang::ASTContext&, clang::CXXRecordDecl*, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, bool, clang::ConstexprSpecKind, clang::SourceLocation, clang::Expr*&>(clang::FunctionDecl*&, clang::FunctionDecl*, clang::ASTContext&, clang::CXXRecordDecl*&&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, bool&&, clang::ConstexprSpecKind&&, clang::SourceLocation&&, clang::Expr*&)
Line
Count
Source
236
296k
                                                Args &&... args) {
237
296k
      CallOverloadedCreateFun<NewDeclT> OC;
238
296k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
296k
                                            std::forward<Args>(args)...);
240
296k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::ClassTemplatePartialSpecializationDecl, clang::ClassTemplateSpecializationDecl, clang::ClassTemplateSpecializationDecl, clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::TemplateParameterList*&, clang::ClassTemplateDecl*&, llvm::ArrayRef<clang::TemplateArgument>, clang::TemplateArgumentListInfo&, clang::QualType&, clang::ClassTemplatePartialSpecializationDecl*>(clang::ClassTemplateSpecializationDecl*&, clang::ClassTemplateSpecializationDecl*, clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::TemplateParameterList*&, clang::ClassTemplateDecl*&, llvm::ArrayRef<clang::TemplateArgument>&&, clang::TemplateArgumentListInfo&, clang::QualType&, clang::ClassTemplatePartialSpecializationDecl*&&)
Line
Count
Source
236
991
                                                Args &&... args) {
237
991
      CallOverloadedCreateFun<NewDeclT> OC;
238
991
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
991
                                            std::forward<Args>(args)...);
240
991
    }
241
    // Use this version if a special create function must be
242
    // used, e.g. CXXRecordDecl::CreateLambda .
243
    template <typename ToDeclT, typename CreateFunT, typename FromDeclT,
244
              typename... Args>
245
    LLVM_NODISCARD bool
246
    GetImportedOrCreateSpecialDecl(ToDeclT *&ToD, CreateFunT CreateFun,
247
2.32M
                                   FromDeclT *FromD, Args &&... args) {
248
2.32M
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
4
        ToD = nullptr;
250
4
        return true; // Already imported but with error.
251
4
      }
252
2.32M
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
2.32M
      if (ToD)
254
122k
        return true; // Already imported.
255
2.20M
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
2.20M
      Importer.RegisterImportedDecl(FromD, ToD);
258
2.20M
      InitializeImportedDecl(FromD, ToD);
259
2.20M
      return false; // A new Decl is created.
260
2.20M
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::EmptyDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::EmptyDecl>, clang::EmptyDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&>(clang::EmptyDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::EmptyDecl>, clang::EmptyDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&)
Line
Count
Source
247
1
                                   FromDeclT *FromD, Args &&... args) {
248
1
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
1
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
1
      if (ToD)
254
0
        return true; // Already imported.
255
1
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
1
      Importer.RegisterImportedDecl(FromD, ToD);
258
1
      InitializeImportedDecl(FromD, ToD);
259
1
      return false; // A new Decl is created.
260
1
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::AccessSpecDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::AccessSpecDecl>, clang::AccessSpecDecl, clang::ASTContext&, clang::AccessSpecifier, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&>(clang::AccessSpecDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::AccessSpecDecl>, clang::AccessSpecDecl*, clang::ASTContext&, clang::AccessSpecifier&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&)
Line
Count
Source
247
32.2k
                                   FromDeclT *FromD, Args &&... args) {
248
32.2k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
32.2k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
32.2k
      if (ToD)
254
0
        return true; // Already imported.
255
32.2k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
32.2k
      Importer.RegisterImportedDecl(FromD, ToD);
258
32.2k
      InitializeImportedDecl(FromD, ToD);
259
32.2k
      return false; // A new Decl is created.
260
32.2k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::StaticAssertDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::StaticAssertDecl>, clang::StaticAssertDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::Expr*&, clang::StringLiteral*&, clang::SourceLocation&, bool>(clang::StaticAssertDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::StaticAssertDecl>, clang::StaticAssertDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::Expr*&, clang::StringLiteral*&, clang::SourceLocation&, bool&&)
Line
Count
Source
247
9.79k
                                   FromDeclT *FromD, Args &&... args) {
248
9.79k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
9.79k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
9.79k
      if (ToD)
254
0
        return true; // Already imported.
255
9.79k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
9.79k
      Importer.RegisterImportedDecl(FromD, ToD);
258
9.79k
      InitializeImportedDecl(FromD, ToD);
259
9.79k
      return false; // A new Decl is created.
260
9.79k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::NamespaceDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::NamespaceDecl>, clang::NamespaceDecl, clang::ASTContext&, clang::DeclContext*&, bool, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, std::nullptr_t>(clang::NamespaceDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::NamespaceDecl>, clang::NamespaceDecl*, clang::ASTContext&, clang::DeclContext*&, bool&&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, std::nullptr_t&&)
Line
Count
Source
247
1.56k
                                   FromDeclT *FromD, Args &&... args) {
248
1.56k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
1.56k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
1.56k
      if (ToD)
254
0
        return true; // Already imported.
255
1.56k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
1.56k
      Importer.RegisterImportedDecl(FromD, ToD);
258
1.56k
      InitializeImportedDecl(FromD, ToD);
259
1.56k
      return false; // A new Decl is created.
260
1.56k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::NamespaceAliasDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::NamespaceAliasDecl>, clang::NamespaceAliasDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::NamespaceDecl*&>(clang::NamespaceAliasDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::NamespaceAliasDecl>, clang::NamespaceAliasDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::NamespaceDecl*&)
Line
Count
Source
247
3
                                   FromDeclT *FromD, Args &&... args) {
248
3
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
3
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
3
      if (ToD)
254
0
        return true; // Already imported.
255
3
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
3
      Importer.RegisterImportedDecl(FromD, ToD);
258
3
      InitializeImportedDecl(FromD, ToD);
259
3
      return false; // A new Decl is created.
260
3
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::TypedefNameDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TypeAliasDecl>, clang::TypedefNameDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::TypeSourceInfo*&>(clang::TypedefNameDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TypeAliasDecl>, clang::TypedefNameDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::TypeSourceInfo*&)
Line
Count
Source
247
9.99k
                                   FromDeclT *FromD, Args &&... args) {
248
9.99k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
9.99k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
9.99k
      if (ToD)
254
219
        return true; // Already imported.
255
9.77k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
9.77k
      Importer.RegisterImportedDecl(FromD, ToD);
258
9.77k
      InitializeImportedDecl(FromD, ToD);
259
9.77k
      return false; // A new Decl is created.
260
9.77k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::TypedefNameDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TypedefDecl>, clang::TypedefNameDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::TypeSourceInfo*&>(clang::TypedefNameDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TypedefDecl>, clang::TypedefNameDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::TypeSourceInfo*&)
Line
Count
Source
247
123k
                                   FromDeclT *FromD, Args &&... args) {
248
123k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
123k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
123k
      if (ToD)
254
2.32k
        return true; // Already imported.
255
121k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
121k
      Importer.RegisterImportedDecl(FromD, ToD);
258
121k
      InitializeImportedDecl(FromD, ToD);
259
121k
      return false; // A new Decl is created.
260
121k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::TypeAliasTemplateDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TypeAliasTemplateDecl>, clang::TypeAliasTemplateDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::TypeAliasDecl*&>(clang::TypeAliasTemplateDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TypeAliasTemplateDecl>, clang::TypeAliasTemplateDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::TypeAliasDecl*&)
Line
Count
Source
247
6.53k
                                   FromDeclT *FromD, Args &&... args) {
248
6.53k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
6.53k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
6.53k
      if (ToD)
254
219
        return true; // Already imported.
255
6.32k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
6.32k
      Importer.RegisterImportedDecl(FromD, ToD);
258
6.32k
      InitializeImportedDecl(FromD, ToD);
259
6.32k
      return false; // A new Decl is created.
260
6.32k
    }
Unexecuted instantiation: bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::LabelDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::LabelDecl>, clang::LabelDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, clang::SourceLocation&>(clang::LabelDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::LabelDecl>, clang::LabelDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::SourceLocation&)
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::LabelDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::LabelDecl>, clang::LabelDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*>(clang::LabelDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::LabelDecl>, clang::LabelDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&)
Line
Count
Source
247
63
                                   FromDeclT *FromD, Args &&... args) {
248
63
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
63
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
63
      if (ToD)
254
0
        return true; // Already imported.
255
63
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
63
      Importer.RegisterImportedDecl(FromD, ToD);
258
63
      InitializeImportedDecl(FromD, ToD);
259
63
      return false; // A new Decl is created.
260
63
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::EnumDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::EnumDecl>, clang::EnumDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::EnumDecl*&, bool, bool, bool>(clang::EnumDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::EnumDecl>, clang::EnumDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::EnumDecl*&, bool&&, bool&&, bool&&)
Line
Count
Source
247
2.07k
                                   FromDeclT *FromD, Args &&... args) {
248
2.07k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
2.07k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
2.07k
      if (ToD)
254
0
        return true; // Already imported.
255
2.07k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
2.07k
      Importer.RegisterImportedDecl(FromD, ToD);
258
2.07k
      InitializeImportedDecl(FromD, ToD);
259
2.07k
      return false; // A new Decl is created.
260
2.07k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::CXXRecordDecl, clang::CXXRecordDecl* (*)(clang::ASTContext const&, clang::DeclContext*, clang::TypeSourceInfo*, clang::SourceLocation, bool, bool, clang::LambdaCaptureDefault), clang::RecordDecl, clang::ASTContext&, clang::DeclContext*&, clang::TypeSourceInfo*&, clang::SourceLocation&, bool, bool, clang::LambdaCaptureDefault>(clang::CXXRecordDecl*&, clang::CXXRecordDecl* (*)(clang::ASTContext const&, clang::DeclContext*, clang::TypeSourceInfo*, clang::SourceLocation, bool, bool, clang::LambdaCaptureDefault), clang::RecordDecl*, clang::ASTContext&, clang::DeclContext*&, clang::TypeSourceInfo*&, clang::SourceLocation&, bool&&, bool&&, clang::LambdaCaptureDefault&&)
Line
Count
Source
247
77
                                   FromDeclT *FromD, Args &&... args) {
248
77
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
77
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
77
      if (ToD)
254
0
        return true; // Already imported.
255
77
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
77
      Importer.RegisterImportedDecl(FromD, ToD);
258
77
      InitializeImportedDecl(FromD, ToD);
259
77
      return false; // A new Decl is created.
260
77
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::CXXRecordDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXRecordDecl>, clang::RecordDecl, clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::CXXRecordDecl*, bool const&>(clang::CXXRecordDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXRecordDecl>, clang::RecordDecl*, clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::CXXRecordDecl*&&, bool const&)
Line
Count
Source
247
66.8k
                                   FromDeclT *FromD, Args &&... args) {
248
66.8k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
66.8k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
66.8k
      if (ToD)
254
0
        return true; // Already imported.
255
66.8k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
66.8k
      Importer.RegisterImportedDecl(FromD, ToD);
258
66.8k
      InitializeImportedDecl(FromD, ToD);
259
66.8k
      return false; // A new Decl is created.
260
66.8k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::CXXRecordDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXRecordDecl>, clang::RecordDecl, clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::CXXRecordDecl*>(clang::CXXRecordDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXRecordDecl>, clang::RecordDecl*, clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::CXXRecordDecl*&&)
Line
Count
Source
247
51.0k
                                   FromDeclT *FromD, Args &&... args) {
248
51.0k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
4
        ToD = nullptr;
250
4
        return true; // Already imported but with error.
251
4
      }
252
51.0k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
51.0k
      if (ToD)
254
591
        return true; // Already imported.
255
50.4k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
50.4k
      Importer.RegisterImportedDecl(FromD, ToD);
258
50.4k
      InitializeImportedDecl(FromD, ToD);
259
50.4k
      return false; // A new Decl is created.
260
50.4k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::RecordDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::RecordDecl>, clang::RecordDecl, clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::RecordDecl*&>(clang::RecordDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::RecordDecl>, clang::RecordDecl*, clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::RecordDecl*&)
Line
Count
Source
247
145
                                   FromDeclT *FromD, Args &&... args) {
248
145
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
145
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
145
      if (ToD)
254
13
        return true; // Already imported.
255
132
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
132
      Importer.RegisterImportedDecl(FromD, ToD);
258
132
      InitializeImportedDecl(FromD, ToD);
259
132
      return false; // A new Decl is created.
260
132
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::EnumConstantDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::EnumConstantDecl>, clang::EnumConstantDecl, clang::ASTContext&, clang::EnumDecl*, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::Expr*&, llvm::APSInt const&>(clang::EnumConstantDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::EnumConstantDecl>, clang::EnumConstantDecl*, clang::ASTContext&, clang::EnumDecl*&&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::Expr*&, llvm::APSInt const&)
Line
Count
Source
247
4.57k
                                   FromDeclT *FromD, Args &&... args) {
248
4.57k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
4.57k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
4.57k
      if (ToD)
254
0
        return true; // Already imported.
255
4.57k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
4.57k
      Importer.RegisterImportedDecl(FromD, ToD);
258
4.57k
      InitializeImportedDecl(FromD, ToD);
259
4.57k
      return false; // A new Decl is created.
260
4.57k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::FunctionDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXConstructorDecl>, clang::FunctionDecl, clang::ASTContext&, clang::CXXRecordDecl*, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::ExplicitSpecifier, bool, bool, clang::ConstexprSpecKind, clang::InheritedConstructor, clang::Expr*&>(clang::FunctionDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXConstructorDecl>, clang::FunctionDecl*, clang::ASTContext&, clang::CXXRecordDecl*&&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::ExplicitSpecifier&&, bool&&, bool&&, clang::ConstexprSpecKind&&, clang::InheritedConstructor&&, clang::Expr*&)
Line
Count
Source
247
94.1k
                                   FromDeclT *FromD, Args &&... args) {
248
94.1k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
94.1k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
94.1k
      if (ToD)
254
273
        return true; // Already imported.
255
93.9k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
93.9k
      Importer.RegisterImportedDecl(FromD, ToD);
258
93.9k
      InitializeImportedDecl(FromD, ToD);
259
93.9k
      return false; // A new Decl is created.
260
93.9k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::FunctionDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXDestructorDecl>, clang::FunctionDecl, clang::ASTContext&, clang::CXXRecordDecl*, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, bool, bool, clang::ConstexprSpecKind, clang::Expr*&>(clang::FunctionDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXDestructorDecl>, clang::FunctionDecl*, clang::ASTContext&, clang::CXXRecordDecl*&&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, bool&&, bool&&, clang::ConstexprSpecKind&&, clang::Expr*&)
Line
Count
Source
247
14.0k
                                   FromDeclT *FromD, Args &&... args) {
248
14.0k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
14.0k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
14.0k
      if (ToD)
254
0
        return true; // Already imported.
255
14.0k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
14.0k
      Importer.RegisterImportedDecl(FromD, ToD);
258
14.0k
      InitializeImportedDecl(FromD, ToD);
259
14.0k
      return false; // A new Decl is created.
260
14.0k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::FunctionDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXConversionDecl>, clang::FunctionDecl, clang::ASTContext&, clang::CXXRecordDecl*, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, bool, clang::ExplicitSpecifier, clang::ConstexprSpecKind, clang::SourceLocation, clang::Expr*&>(clang::FunctionDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXConversionDecl>, clang::FunctionDecl*, clang::ASTContext&, clang::CXXRecordDecl*&&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, bool&&, clang::ExplicitSpecifier&&, clang::ConstexprSpecKind&&, clang::SourceLocation&&, clang::Expr*&)
Line
Count
Source
247
2.58k
                                   FromDeclT *FromD, Args &&... args) {
248
2.58k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
2.58k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
2.58k
      if (ToD)
254
0
        return true; // Already imported.
255
2.58k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
2.58k
      Importer.RegisterImportedDecl(FromD, ToD);
258
2.58k
      InitializeImportedDecl(FromD, ToD);
259
2.58k
      return false; // A new Decl is created.
260
2.58k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::FunctionDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXMethodDecl>, clang::FunctionDecl, clang::ASTContext&, clang::CXXRecordDecl*, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, bool, clang::ConstexprSpecKind, clang::SourceLocation, clang::Expr*&>(clang::FunctionDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::CXXMethodDecl>, clang::FunctionDecl*, clang::ASTContext&, clang::CXXRecordDecl*&&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, bool&&, clang::ConstexprSpecKind&&, clang::SourceLocation&&, clang::Expr*&)
Line
Count
Source
247
296k
                                   FromDeclT *FromD, Args &&... args) {
248
296k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
296k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
296k
      if (ToD)
254
333
        return true; // Already imported.
255
295k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
295k
      Importer.RegisterImportedDecl(FromD, ToD);
258
295k
      InitializeImportedDecl(FromD, ToD);
259
295k
      return false; // A new Decl is created.
260
295k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::FunctionDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::FunctionDecl>, clang::FunctionDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, bool, bool, clang::ConstexprSpecKind, clang::Expr*&>(clang::FunctionDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::FunctionDecl>, clang::FunctionDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationNameInfo&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, bool&&, bool&&, clang::ConstexprSpecKind&&, clang::Expr*&)
Line
Count
Source
247
69.3k
                                   FromDeclT *FromD, Args &&... args) {
248
69.3k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
69.3k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
69.3k
      if (ToD)
254
14
        return true; // Already imported.
255
69.3k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
69.3k
      Importer.RegisterImportedDecl(FromD, ToD);
258
69.3k
      InitializeImportedDecl(FromD, ToD);
259
69.3k
      return false; // A new Decl is created.
260
69.3k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::FieldDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::FieldDecl>, clang::FieldDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::TypeSourceInfo*&, clang::Expr*&, bool, clang::InClassInitStyle>(clang::FieldDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::FieldDecl>, clang::FieldDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::TypeSourceInfo*&, clang::Expr*&, bool&&, clang::InClassInitStyle&&)
Line
Count
Source
247
38.9k
                                   FromDeclT *FromD, Args &&... args) {
248
38.9k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
38.9k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
38.9k
      if (ToD)
254
153
        return true; // Already imported.
255
38.7k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
38.7k
      Importer.RegisterImportedDecl(FromD, ToD);
258
38.7k
      InitializeImportedDecl(FromD, ToD);
259
38.7k
      return false; // A new Decl is created.
260
38.7k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::IndirectFieldDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::IndirectFieldDecl>, clang::IndirectFieldDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, llvm::MutableArrayRef<clang::NamedDecl*>&>(clang::IndirectFieldDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::IndirectFieldDecl>, clang::IndirectFieldDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, llvm::MutableArrayRef<clang::NamedDecl*>&)
Line
Count
Source
247
1.73k
                                   FromDeclT *FromD, Args &&... args) {
248
1.73k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
1.73k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
1.73k
      if (ToD)
254
0
        return true; // Already imported.
255
1.73k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
1.73k
      Importer.RegisterImportedDecl(FromD, ToD);
258
1.73k
      InitializeImportedDecl(FromD, ToD);
259
1.73k
      return false; // A new Decl is created.
260
1.73k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::FriendDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::FriendDecl>, clang::FriendDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, llvm::PointerUnion<clang::NamedDecl*, clang::TypeSourceInfo*>&, clang::SourceLocation&, llvm::SmallVector<clang::TemplateParameterList*, 1u>&>(clang::FriendDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::FriendDecl>, clang::FriendDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, llvm::PointerUnion<clang::NamedDecl*, clang::TypeSourceInfo*>&, clang::SourceLocation&, llvm::SmallVector<clang::TemplateParameterList*, 1u>&)
Line
Count
Source
247
21.4k
                                   FromDeclT *FromD, Args &&... args) {
248
21.4k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
21.4k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
21.4k
      if (ToD)
254
0
        return true; // Already imported.
255
21.4k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
21.4k
      Importer.RegisterImportedDecl(FromD, ToD);
258
21.4k
      InitializeImportedDecl(FromD, ToD);
259
21.4k
      return false; // A new Decl is created.
260
21.4k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ObjCIvarDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCIvarDecl>, clang::ObjCIvarDecl, clang::ASTContext&, clang::ObjCContainerDecl*, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::TypeSourceInfo*&, clang::ObjCIvarDecl::AccessControl, clang::Expr*&, bool>(clang::ObjCIvarDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCIvarDecl>, clang::ObjCIvarDecl*, clang::ASTContext&, clang::ObjCContainerDecl*&&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::TypeSourceInfo*&, clang::ObjCIvarDecl::AccessControl&&, clang::Expr*&, bool&&)
Line
Count
Source
247
1.58k
                                   FromDeclT *FromD, Args &&... args) {
248
1.58k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
1.58k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
1.58k
      if (ToD)
254
0
        return true; // Already imported.
255
1.58k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
1.58k
      Importer.RegisterImportedDecl(FromD, ToD);
258
1.58k
      InitializeImportedDecl(FromD, ToD);
259
1.58k
      return false; // A new Decl is created.
260
1.58k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::VarDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::VarDecl>, clang::VarDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass>(clang::VarDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::VarDecl>, clang::VarDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&)
Line
Count
Source
247
137k
                                   FromDeclT *FromD, Args &&... args) {
248
137k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
137k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
137k
      if (ToD)
254
3
        return true; // Already imported.
255
137k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
137k
      Importer.RegisterImportedDecl(FromD, ToD);
258
137k
      InitializeImportedDecl(FromD, ToD);
259
137k
      return false; // A new Decl is created.
260
137k
    }
Unexecuted instantiation: bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ImplicitParamDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ImplicitParamDecl>, clang::ImplicitParamDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::ImplicitParamDecl::ImplicitParamKind>(clang::ImplicitParamDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ImplicitParamDecl>, clang::ImplicitParamDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::ImplicitParamDecl::ImplicitParamKind&&)
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ParmVarDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ParmVarDecl>, clang::ParmVarDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, std::nullptr_t>(clang::ParmVarDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ParmVarDecl>, clang::ParmVarDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, std::nullptr_t&&)
Line
Count
Source
247
644k
                                   FromDeclT *FromD, Args &&... args) {
248
644k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
644k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
644k
      if (ToD)
254
0
        return true; // Already imported.
255
644k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
644k
      Importer.RegisterImportedDecl(FromD, ToD);
258
644k
      InitializeImportedDecl(FromD, ToD);
259
644k
      return false; // A new Decl is created.
260
644k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ObjCMethodDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCMethodDecl>, clang::ObjCMethodDecl, clang::ASTContext&, clang::SourceLocation&, clang::SourceLocation&, clang::Selector, clang::QualType&, clang::TypeSourceInfo*&, clang::DeclContext*&, bool, bool, bool, bool, bool, bool, clang::ObjCMethodDecl::ImplementationControl, bool>(clang::ObjCMethodDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCMethodDecl>, clang::ObjCMethodDecl*, clang::ASTContext&, clang::SourceLocation&, clang::SourceLocation&, clang::Selector&&, clang::QualType&, clang::TypeSourceInfo*&, clang::DeclContext*&, bool&&, bool&&, bool&&, bool&&, bool&&, bool&&, clang::ObjCMethodDecl::ImplementationControl&&, bool&&)
Line
Count
Source
247
8.43k
                                   FromDeclT *FromD, Args &&... args) {
248
8.43k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
8.43k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
8.43k
      if (ToD)
254
0
        return true; // Already imported.
255
8.43k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
8.43k
      Importer.RegisterImportedDecl(FromD, ToD);
258
8.43k
      InitializeImportedDecl(FromD, ToD);
259
8.43k
      return false; // A new Decl is created.
260
8.43k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ObjCTypeParamDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCTypeParamDecl>, clang::ObjCTypeParamDecl, clang::ASTContext&, clang::DeclContext*&, clang::ObjCTypeParamVariance, clang::SourceLocation&, unsigned int, clang::SourceLocation&, clang::IdentifierInfo*, clang::SourceLocation&, clang::TypeSourceInfo*&>(clang::ObjCTypeParamDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCTypeParamDecl>, clang::ObjCTypeParamDecl*, clang::ASTContext&, clang::DeclContext*&, clang::ObjCTypeParamVariance&&, clang::SourceLocation&, unsigned int&&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::SourceLocation&, clang::TypeSourceInfo*&)
Line
Count
Source
247
390
                                   FromDeclT *FromD, Args &&... args) {
248
390
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
390
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
390
      if (ToD)
254
0
        return true; // Already imported.
255
390
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
390
      Importer.RegisterImportedDecl(FromD, ToD);
258
390
      InitializeImportedDecl(FromD, ToD);
259
390
      return false; // A new Decl is created.
260
390
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ObjCCategoryDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCCategoryDecl>, clang::ObjCCategoryDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*, clang::ObjCInterfaceDecl*&, std::nullptr_t, clang::SourceLocation&, clang::SourceLocation&>(clang::ObjCCategoryDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCCategoryDecl>, clang::ObjCCategoryDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::ObjCInterfaceDecl*&, std::nullptr_t&&, clang::SourceLocation&, clang::SourceLocation&)
Line
Count
Source
247
2.44k
                                   FromDeclT *FromD, Args &&... args) {
248
2.44k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
2.44k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
2.44k
      if (ToD)
254
0
        return true; // Already imported.
255
2.44k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
2.44k
      Importer.RegisterImportedDecl(FromD, ToD);
258
2.44k
      InitializeImportedDecl(FromD, ToD);
259
2.44k
      return false; // A new Decl is created.
260
2.44k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ObjCProtocolDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCProtocolDecl>, clang::ObjCProtocolDecl, clang::ASTContext&, clang::DeclContext*&, clang::IdentifierInfo*, clang::SourceLocation&, clang::SourceLocation&, std::nullptr_t>(clang::ObjCProtocolDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCProtocolDecl>, clang::ObjCProtocolDecl*, clang::ASTContext&, clang::DeclContext*&, clang::IdentifierInfo*&&, clang::SourceLocation&, clang::SourceLocation&, std::nullptr_t&&)
Line
Count
Source
247
374
                                   FromDeclT *FromD, Args &&... args) {
248
374
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
374
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
374
      if (ToD)
254
0
        return true; // Already imported.
255
374
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
374
      Importer.RegisterImportedDecl(FromD, ToD);
258
374
      InitializeImportedDecl(FromD, ToD);
259
374
      return false; // A new Decl is created.
260
374
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::LinkageSpecDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::LinkageSpecDecl>, clang::LinkageSpecDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::LinkageSpecDecl::LanguageIDs, bool&>(clang::LinkageSpecDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::LinkageSpecDecl>, clang::LinkageSpecDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::LinkageSpecDecl::LanguageIDs&&, bool&)
Line
Count
Source
247
4.39k
                                   FromDeclT *FromD, Args &&... args) {
248
4.39k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
4.39k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
4.39k
      if (ToD)
254
0
        return true; // Already imported.
255
4.39k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
4.39k
      Importer.RegisterImportedDecl(FromD, ToD);
258
4.39k
      InitializeImportedDecl(FromD, ToD);
259
4.39k
      return false; // A new Decl is created.
260
4.39k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::UsingDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UsingDecl>, clang::UsingDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::DeclarationNameInfo&, bool>(clang::UsingDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UsingDecl>, clang::UsingDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::DeclarationNameInfo&, bool&&)
Line
Count
Source
247
1.63k
                                   FromDeclT *FromD, Args &&... args) {
248
1.63k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
1.63k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
1.63k
      if (ToD)
254
0
        return true; // Already imported.
255
1.63k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
1.63k
      Importer.RegisterImportedDecl(FromD, ToD);
258
1.63k
      InitializeImportedDecl(FromD, ToD);
259
1.63k
      return false; // A new Decl is created.
260
1.63k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::UsingShadowDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UsingShadowDecl>, clang::UsingShadowDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::UsingDecl*&, clang::NamedDecl*&>(clang::UsingShadowDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UsingShadowDecl>, clang::UsingShadowDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::UsingDecl*&, clang::NamedDecl*&)
Line
Count
Source
247
9.67k
                                   FromDeclT *FromD, Args &&... args) {
248
9.67k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
9.67k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
9.67k
      if (ToD)
254
1.15k
        return true; // Already imported.
255
8.52k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
8.52k
      Importer.RegisterImportedDecl(FromD, ToD);
258
8.52k
      InitializeImportedDecl(FromD, ToD);
259
8.52k
      return false; // A new Decl is created.
260
8.52k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::UsingDirectiveDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UsingDirectiveDecl>, clang::UsingDirectiveDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::NamespaceDecl*&, clang::DeclContext*&>(clang::UsingDirectiveDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UsingDirectiveDecl>, clang::UsingDirectiveDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::NamespaceDecl*&, clang::DeclContext*&)
Line
Count
Source
247
101
                                   FromDeclT *FromD, Args &&... args) {
248
101
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
101
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
101
      if (ToD)
254
0
        return true; // Already imported.
255
101
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
101
      Importer.RegisterImportedDecl(FromD, ToD);
258
101
      InitializeImportedDecl(FromD, ToD);
259
101
      return false; // A new Decl is created.
260
101
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::UnresolvedUsingValueDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UnresolvedUsingValueDecl>, clang::UnresolvedUsingValueDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::DeclarationNameInfo&, clang::SourceLocation&>(clang::UnresolvedUsingValueDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UnresolvedUsingValueDecl>, clang::UnresolvedUsingValueDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::DeclarationNameInfo&, clang::SourceLocation&)
Line
Count
Source
247
1
                                   FromDeclT *FromD, Args &&... args) {
248
1
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
1
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
1
      if (ToD)
254
0
        return true; // Already imported.
255
1
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
1
      Importer.RegisterImportedDecl(FromD, ToD);
258
1
      InitializeImportedDecl(FromD, ToD);
259
1
      return false; // A new Decl is created.
260
1
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::UnresolvedUsingTypenameDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UnresolvedUsingTypenameDecl>, clang::UnresolvedUsingTypenameDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::DeclarationName&, clang::SourceLocation&>(clang::UnresolvedUsingTypenameDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::UnresolvedUsingTypenameDecl>, clang::UnresolvedUsingTypenameDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::NestedNameSpecifierLoc&, clang::SourceLocation&, clang::DeclarationName&, clang::SourceLocation&)
Line
Count
Source
247
241
                                   FromDeclT *FromD, Args &&... args) {
248
241
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
241
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
241
      if (ToD)
254
9
        return true; // Already imported.
255
232
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
232
      Importer.RegisterImportedDecl(FromD, ToD);
258
232
      InitializeImportedDecl(FromD, ToD);
259
232
      return false; // A new Decl is created.
260
232
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ObjCInterfaceDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCInterfaceDecl>, clang::ObjCInterfaceDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, std::nullptr_t, std::nullptr_t, clang::SourceLocation&, bool>(clang::ObjCInterfaceDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCInterfaceDecl>, clang::ObjCInterfaceDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, std::nullptr_t&&, std::nullptr_t&&, clang::SourceLocation&, bool&&)
Line
Count
Source
247
2.26k
                                   FromDeclT *FromD, Args &&... args) {
248
2.26k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
2.26k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
2.26k
      if (ToD)
254
0
        return true; // Already imported.
255
2.26k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
2.26k
      Importer.RegisterImportedDecl(FromD, ToD);
258
2.26k
      InitializeImportedDecl(FromD, ToD);
259
2.26k
      return false; // A new Decl is created.
260
2.26k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ObjCCategoryImplDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCCategoryImplDecl>, clang::ObjCCategoryImplDecl, clang::ASTContext&, clang::DeclContext*&, clang::IdentifierInfo*, clang::ObjCInterfaceDecl*, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&>(clang::ObjCCategoryImplDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCCategoryImplDecl>, clang::ObjCCategoryImplDecl*, clang::ASTContext&, clang::DeclContext*&, clang::IdentifierInfo*&&, clang::ObjCInterfaceDecl*&&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&)
Line
Count
Source
247
4
                                   FromDeclT *FromD, Args &&... args) {
248
4
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
4
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
4
      if (ToD)
254
0
        return true; // Already imported.
255
4
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
4
      Importer.RegisterImportedDecl(FromD, ToD);
258
4
      InitializeImportedDecl(FromD, ToD);
259
4
      return false; // A new Decl is created.
260
4
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ObjCImplementationDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCImplementationDecl>, clang::ObjCImplementationDecl, clang::ASTContext&, clang::DeclContext*&, clang::ObjCInterfaceDecl*&, clang::ObjCInterfaceDecl*&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&>(clang::ObjCImplementationDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCImplementationDecl>, clang::ObjCImplementationDecl*, clang::ASTContext&, clang::DeclContext*&, clang::ObjCInterfaceDecl*&, clang::ObjCInterfaceDecl*&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&, clang::SourceLocation&)
Line
Count
Source
247
10
                                   FromDeclT *FromD, Args &&... args) {
248
10
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
10
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
10
      if (ToD)
254
0
        return true; // Already imported.
255
10
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
10
      Importer.RegisterImportedDecl(FromD, ToD);
258
10
      InitializeImportedDecl(FromD, ToD);
259
10
      return false; // A new Decl is created.
260
10
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ObjCPropertyDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCPropertyDecl>, clang::ObjCPropertyDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*, clang::SourceLocation&, clang::SourceLocation&, clang::QualType&, clang::TypeSourceInfo*&, clang::ObjCPropertyDecl::PropertyControl>(clang::ObjCPropertyDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCPropertyDecl>, clang::ObjCPropertyDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::IdentifierInfo*&&, clang::SourceLocation&, clang::SourceLocation&, clang::QualType&, clang::TypeSourceInfo*&, clang::ObjCPropertyDecl::PropertyControl&&)
Line
Count
Source
247
2.19k
                                   FromDeclT *FromD, Args &&... args) {
248
2.19k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
2.19k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
2.19k
      if (ToD)
254
0
        return true; // Already imported.
255
2.19k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
2.19k
      Importer.RegisterImportedDecl(FromD, ToD);
258
2.19k
      InitializeImportedDecl(FromD, ToD);
259
2.19k
      return false; // A new Decl is created.
260
2.19k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ObjCPropertyImplDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCPropertyImplDecl>, clang::ObjCPropertyImplDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::ObjCPropertyDecl*&, clang::ObjCPropertyImplDecl::Kind, clang::ObjCIvarDecl*&, clang::SourceLocation&>(clang::ObjCPropertyImplDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ObjCPropertyImplDecl>, clang::ObjCPropertyImplDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::ObjCPropertyDecl*&, clang::ObjCPropertyImplDecl::Kind&&, clang::ObjCIvarDecl*&, clang::SourceLocation&)
Line
Count
Source
247
4
                                   FromDeclT *FromD, Args &&... args) {
248
4
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
4
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
4
      if (ToD)
254
0
        return true; // Already imported.
255
4
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
4
      Importer.RegisterImportedDecl(FromD, ToD);
258
4
      InitializeImportedDecl(FromD, ToD);
259
4
      return false; // A new Decl is created.
260
4
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::TemplateTypeParmDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TemplateTypeParmDecl>, clang::TemplateTypeParmDecl, clang::ASTContext&, clang::TranslationUnitDecl*, clang::SourceLocation&, clang::SourceLocation&, unsigned int, unsigned int, clang::IdentifierInfo*, bool, bool, bool>(clang::TemplateTypeParmDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TemplateTypeParmDecl>, clang::TemplateTypeParmDecl*, clang::ASTContext&, clang::TranslationUnitDecl*&&, clang::SourceLocation&, clang::SourceLocation&, unsigned int&&, unsigned int&&, clang::IdentifierInfo*&&, bool&&, bool&&, bool&&)
Line
Count
Source
247
313k
                                   FromDeclT *FromD, Args &&... args) {
248
313k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
313k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
313k
      if (ToD)
254
0
        return true; // Already imported.
255
313k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
313k
      Importer.RegisterImportedDecl(FromD, ToD);
258
313k
      InitializeImportedDecl(FromD, ToD);
259
313k
      return false; // A new Decl is created.
260
313k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::NonTypeTemplateParmDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::NonTypeTemplateParmDecl>, clang::NonTypeTemplateParmDecl, clang::ASTContext&, clang::TranslationUnitDecl*, clang::SourceLocation&, clang::SourceLocation&, unsigned int, unsigned int, clang::IdentifierInfo*, clang::QualType&, bool, clang::TypeSourceInfo*&>(clang::NonTypeTemplateParmDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::NonTypeTemplateParmDecl>, clang::NonTypeTemplateParmDecl*, clang::ASTContext&, clang::TranslationUnitDecl*&&, clang::SourceLocation&, clang::SourceLocation&, unsigned int&&, unsigned int&&, clang::IdentifierInfo*&&, clang::QualType&, bool&&, clang::TypeSourceInfo*&)
Line
Count
Source
247
43.4k
                                   FromDeclT *FromD, Args &&... args) {
248
43.4k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
43.4k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
43.4k
      if (ToD)
254
3
        return true; // Already imported.
255
43.4k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
43.4k
      Importer.RegisterImportedDecl(FromD, ToD);
258
43.4k
      InitializeImportedDecl(FromD, ToD);
259
43.4k
      return false; // A new Decl is created.
260
43.4k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::TemplateTemplateParmDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TemplateTemplateParmDecl>, clang::TemplateTemplateParmDecl, clang::ASTContext&, clang::TranslationUnitDecl*, clang::SourceLocation&, unsigned int, unsigned int, bool, clang::IdentifierInfo*, clang::TemplateParameterList*&>(clang::TemplateTemplateParmDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::TemplateTemplateParmDecl>, clang::TemplateTemplateParmDecl*, clang::ASTContext&, clang::TranslationUnitDecl*&&, clang::SourceLocation&, unsigned int&&, unsigned int&&, bool&&, clang::IdentifierInfo*&&, clang::TemplateParameterList*&)
Line
Count
Source
247
435
                                   FromDeclT *FromD, Args &&... args) {
248
435
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
435
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
435
      if (ToD)
254
0
        return true; // Already imported.
255
435
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
435
      Importer.RegisterImportedDecl(FromD, ToD);
258
435
      InitializeImportedDecl(FromD, ToD);
259
435
      return false; // A new Decl is created.
260
435
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ClassTemplateDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ClassTemplateDecl>, clang::ClassTemplateDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::CXXRecordDecl*&>(clang::ClassTemplateDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ClassTemplateDecl>, clang::ClassTemplateDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::CXXRecordDecl*&)
Line
Count
Source
247
63.5k
                                   FromDeclT *FromD, Args &&... args) {
248
63.5k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
63.5k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
63.5k
      if (ToD)
254
31.7k
        return true; // Already imported.
255
31.8k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
31.8k
      Importer.RegisterImportedDecl(FromD, ToD);
258
31.8k
      InitializeImportedDecl(FromD, ToD);
259
31.8k
      return false; // A new Decl is created.
260
31.8k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ClassTemplateSpecializationDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ClassTemplatePartialSpecializationDecl>, clang::ClassTemplateSpecializationDecl, clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::TemplateParameterList*&, clang::ClassTemplateDecl*&, llvm::ArrayRef<clang::TemplateArgument>, clang::TemplateArgumentListInfo&, clang::QualType&, clang::ClassTemplatePartialSpecializationDecl*>(clang::ClassTemplateSpecializationDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ClassTemplatePartialSpecializationDecl>, clang::ClassTemplateSpecializationDecl*, clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::TemplateParameterList*&, clang::ClassTemplateDecl*&, llvm::ArrayRef<clang::TemplateArgument>&&, clang::TemplateArgumentListInfo&, clang::QualType&, clang::ClassTemplatePartialSpecializationDecl*&&)
Line
Count
Source
247
991
                                   FromDeclT *FromD, Args &&... args) {
248
991
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
991
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
991
      if (ToD)
254
0
        return true; // Already imported.
255
991
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
991
      Importer.RegisterImportedDecl(FromD, ToD);
258
991
      InitializeImportedDecl(FromD, ToD);
259
991
      return false; // A new Decl is created.
260
991
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::ClassTemplateSpecializationDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ClassTemplateSpecializationDecl>, clang::ClassTemplateSpecializationDecl, clang::ASTContext&, clang::TagTypeKind, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::ClassTemplateDecl*&, llvm::SmallVector<clang::TemplateArgument, 2u>&, clang::ClassTemplateSpecializationDecl*&>(clang::ClassTemplateSpecializationDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::ClassTemplateSpecializationDecl>, clang::ClassTemplateSpecializationDecl*, clang::ASTContext&, clang::TagTypeKind&&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::ClassTemplateDecl*&, llvm::SmallVector<clang::TemplateArgument, 2u>&, clang::ClassTemplateSpecializationDecl*&)
Line
Count
Source
247
49.0k
                                   FromDeclT *FromD, Args &&... args) {
248
49.0k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
49.0k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
49.0k
      if (ToD)
254
7
        return true; // Already imported.
255
49.0k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
49.0k
      Importer.RegisterImportedDecl(FromD, ToD);
258
49.0k
      InitializeImportedDecl(FromD, ToD);
259
49.0k
      return false; // A new Decl is created.
260
49.0k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::VarTemplateDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::VarTemplateDecl>, clang::VarTemplateDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::VarDecl*&>(clang::VarTemplateDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::VarTemplateDecl>, clang::VarTemplateDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::VarDecl*&)
Line
Count
Source
247
398
                                   FromDeclT *FromD, Args &&... args) {
248
398
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
398
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
398
      if (ToD)
254
187
        return true; // Already imported.
255
211
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
211
      Importer.RegisterImportedDecl(FromD, ToD);
258
211
      InitializeImportedDecl(FromD, ToD);
259
211
      return false; // A new Decl is created.
260
211
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::VarTemplatePartialSpecializationDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::VarTemplatePartialSpecializationDecl>, clang::VarTemplateSpecializationDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::TemplateParameterList*&, clang::VarTemplateDecl*&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, llvm::SmallVector<clang::TemplateArgument, 2u>&, clang::TemplateArgumentListInfo&>(clang::VarTemplatePartialSpecializationDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::VarTemplatePartialSpecializationDecl>, clang::VarTemplateSpecializationDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::TemplateParameterList*&, clang::VarTemplateDecl*&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, llvm::SmallVector<clang::TemplateArgument, 2u>&, clang::TemplateArgumentListInfo&)
Line
Count
Source
247
2
                                   FromDeclT *FromD, Args &&... args) {
248
2
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
2
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
2
      if (ToD)
254
0
        return true; // Already imported.
255
2
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
2
      Importer.RegisterImportedDecl(FromD, ToD);
258
2
      InitializeImportedDecl(FromD, ToD);
259
2
      return false; // A new Decl is created.
260
2
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::VarTemplateSpecializationDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::VarTemplateSpecializationDecl>, clang::VarTemplateSpecializationDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::VarTemplateDecl*&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass, llvm::SmallVector<clang::TemplateArgument, 2u>&>(clang::VarTemplateSpecializationDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::VarTemplateSpecializationDecl>, clang::VarTemplateSpecializationDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::SourceLocation&, clang::VarTemplateDecl*&, clang::QualType&, clang::TypeSourceInfo*&, clang::StorageClass&&, llvm::SmallVector<clang::TemplateArgument, 2u>&)
Line
Count
Source
247
6
                                   FromDeclT *FromD, Args &&... args) {
248
6
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
6
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
6
      if (ToD)
254
0
        return true; // Already imported.
255
6
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
6
      Importer.RegisterImportedDecl(FromD, ToD);
258
6
      InitializeImportedDecl(FromD, ToD);
259
6
      return false; // A new Decl is created.
260
6
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::FunctionTemplateDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::FunctionTemplateDecl>, clang::FunctionTemplateDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::FunctionDecl*&>(clang::FunctionTemplateDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::FunctionTemplateDecl>, clang::FunctionTemplateDecl*, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&, clang::DeclarationName&, clang::TemplateParameterList*&, clang::FunctionDecl*&)
Line
Count
Source
247
190k
                                   FromDeclT *FromD, Args &&... args) {
248
190k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
190k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
190k
      if (ToD)
254
85.6k
        return true; // Already imported.
255
104k
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
104k
      Importer.RegisterImportedDecl(FromD, ToD);
258
104k
      InitializeImportedDecl(FromD, ToD);
259
104k
      return false; // A new Decl is created.
260
104k
    }
bool clang::ASTNodeImporter::GetImportedOrCreateSpecialDecl<clang::LifetimeExtendedTemporaryDecl, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::LifetimeExtendedTemporaryDecl>, clang::LifetimeExtendedTemporaryDecl, clang::Expr*&, clang::ValueDecl*&, unsigned int>(clang::LifetimeExtendedTemporaryDecl*&, clang::ASTNodeImporter::CallOverloadedCreateFun<clang::LifetimeExtendedTemporaryDecl>, clang::LifetimeExtendedTemporaryDecl*, clang::Expr*&, clang::ValueDecl*&, unsigned int&&)
Line
Count
Source
247
2
                                   FromDeclT *FromD, Args &&... args) {
248
2
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
2
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
2
      if (ToD)
254
0
        return true; // Already imported.
255
2
      ToD = CreateFun(std::forward<Args>(args)...);
256
      // Keep track of imported Decls.
257
2
      Importer.RegisterImportedDecl(FromD, ToD);
258
2
      InitializeImportedDecl(FromD, ToD);
259
2
      return false; // A new Decl is created.
260
2
    }
261
262
2.20M
    void InitializeImportedDecl(Decl *FromD, Decl *ToD) {
263
2.20M
      ToD->IdentifierNamespace = FromD->IdentifierNamespace;
264
2.20M
      if (FromD->hasAttrs())
265
543k
        
for (const Attr *FromAttr : FromD->getAttrs())365k
{
266
          // FIXME: Return of the error here is not possible until store of
267
          // import errors is implemented.
268
543k
          auto ToAttrOrErr = import(FromAttr);
269
543k
          if (ToAttrOrErr)
270
543k
            ToD->addAttr(*ToAttrOrErr);
271
0
          else
272
0
            llvm::consumeError(ToAttrOrErr.takeError());
273
543k
        }
274
2.20M
      if (FromD->isUsed())
275
99.9k
        ToD->setIsUsed();
276
2.20M
      if (FromD->isImplicit())
277
119k
        ToD->setImplicit();
278
2.20M
    }
279
280
    // Check if we have found an existing definition.  Returns with that
281
    // definition if yes, otherwise returns null.
282
59.9k
    Decl *FindAndMapDefinition(FunctionDecl *D, FunctionDecl *FoundFunction) {
283
59.9k
      const FunctionDecl *Definition = nullptr;
284
59.9k
      if (D->doesThisDeclarationHaveABody() &&
285
32.8k
          FoundFunction->hasBody(Definition))
286
2.88k
        return Importer.MapImported(D, const_cast<FunctionDecl *>(Definition));
287
57.1k
      return nullptr;
288
57.1k
    }
289
290
763k
    void addDeclToContexts(Decl *FromD, Decl *ToD) {
291
763k
      if (Importer.isMinimalImport()) {
292
        // In minimal import case the decl must be added even if it is not
293
        // contained in original context, for LLDB compatibility.
294
        // FIXME: Check if a better solution is possible.
295
757k
        if (!FromD->getDescribedTemplate() &&
296
603k
            FromD->getFriendObjectKind() == Decl::FOK_None)
297
595k
          ToD->getLexicalDeclContext()->addDeclInternal(ToD);
298
757k
        return;
299
757k
      }
300
301
5.95k
      DeclContext *FromDC = FromD->getDeclContext();
302
5.95k
      DeclContext *FromLexicalDC = FromD->getLexicalDeclContext();
303
5.95k
      DeclContext *ToDC = ToD->getDeclContext();
304
5.95k
      DeclContext *ToLexicalDC = ToD->getLexicalDeclContext();
305
306
5.95k
      bool Visible = false;
307
5.95k
      if (FromDC->containsDeclAndLoad(FromD)) {
308
4.51k
        ToDC->addDeclInternal(ToD);
309
4.51k
        Visible = true;
310
4.51k
      }
311
5.95k
      if (ToDC != ToLexicalDC && 
FromLexicalDC->containsDeclAndLoad(FromD)210
) {
312
93
        ToLexicalDC->addDeclInternal(ToD);
313
93
        Visible = true;
314
93
      }
315
316
      // If the Decl was added to any context, it was made already visible.
317
      // Otherwise it is still possible that it should be visible.
318
5.95k
      if (!Visible) {
319
1.34k
        if (auto *FromNamed = dyn_cast<NamedDecl>(FromD)) {
320
1.34k
          auto *ToNamed = cast<NamedDecl>(ToD);
321
1.34k
          DeclContextLookupResult FromLookup =
322
1.34k
              FromDC->lookup(FromNamed->getDeclName());
323
1.34k
          for (NamedDecl *ND : FromLookup)
324
1.31k
            if (ND == FromNamed) {
325
29
              ToDC->makeDeclVisibleInContext(ToNamed);
326
29
              break;
327
29
            }
328
1.34k
        }
329
1.34k
      }
330
5.95k
    }
331
332
  public:
333
9.05M
    explicit ASTNodeImporter(ASTImporter &Importer) : Importer(Importer) {}
334
335
    using TypeVisitor<ASTNodeImporter, ExpectedType>::Visit;
336
    using DeclVisitor<ASTNodeImporter, ExpectedDecl>::Visit;
337
    using StmtVisitor<ASTNodeImporter, ExpectedStmt>::Visit;
338
339
    // Importing types
340
    ExpectedType VisitType(const Type *T);
341
    ExpectedType VisitAtomicType(const AtomicType *T);
342
    ExpectedType VisitBuiltinType(const BuiltinType *T);
343
    ExpectedType VisitDecayedType(const DecayedType *T);
344
    ExpectedType VisitComplexType(const ComplexType *T);
345
    ExpectedType VisitPointerType(const PointerType *T);
346
    ExpectedType VisitBlockPointerType(const BlockPointerType *T);
347
    ExpectedType VisitLValueReferenceType(const LValueReferenceType *T);
348
    ExpectedType VisitRValueReferenceType(const RValueReferenceType *T);
349
    ExpectedType VisitMemberPointerType(const MemberPointerType *T);
350
    ExpectedType VisitConstantArrayType(const ConstantArrayType *T);
351
    ExpectedType VisitIncompleteArrayType(const IncompleteArrayType *T);
352
    ExpectedType VisitVariableArrayType(const VariableArrayType *T);
353
    ExpectedType VisitDependentSizedArrayType(const DependentSizedArrayType *T);
354
    // FIXME: DependentSizedExtVectorType
355
    ExpectedType VisitVectorType(const VectorType *T);
356
    ExpectedType VisitExtVectorType(const ExtVectorType *T);
357
    ExpectedType VisitFunctionNoProtoType(const FunctionNoProtoType *T);
358
    ExpectedType VisitFunctionProtoType(const FunctionProtoType *T);
359
    ExpectedType VisitUnresolvedUsingType(const UnresolvedUsingType *T);
360
    ExpectedType VisitParenType(const ParenType *T);
361
    ExpectedType VisitTypedefType(const TypedefType *T);
362
    ExpectedType VisitTypeOfExprType(const TypeOfExprType *T);
363
    // FIXME: DependentTypeOfExprType
364
    ExpectedType VisitTypeOfType(const TypeOfType *T);
365
    ExpectedType VisitDecltypeType(const DecltypeType *T);
366
    ExpectedType VisitUnaryTransformType(const UnaryTransformType *T);
367
    ExpectedType VisitAutoType(const AutoType *T);
368
    ExpectedType VisitInjectedClassNameType(const InjectedClassNameType *T);
369
    // FIXME: DependentDecltypeType
370
    ExpectedType VisitRecordType(const RecordType *T);
371
    ExpectedType VisitEnumType(const EnumType *T);
372
    ExpectedType VisitAttributedType(const AttributedType *T);
373
    ExpectedType VisitTemplateTypeParmType(const TemplateTypeParmType *T);
374
    ExpectedType VisitSubstTemplateTypeParmType(
375
        const SubstTemplateTypeParmType *T);
376
    ExpectedType VisitTemplateSpecializationType(
377
        const TemplateSpecializationType *T);
378
    ExpectedType VisitElaboratedType(const ElaboratedType *T);
379
    ExpectedType VisitDependentNameType(const DependentNameType *T);
380
    ExpectedType VisitPackExpansionType(const PackExpansionType *T);
381
    ExpectedType VisitDependentTemplateSpecializationType(
382
        const DependentTemplateSpecializationType *T);
383
    ExpectedType VisitObjCInterfaceType(const ObjCInterfaceType *T);
384
    ExpectedType VisitObjCObjectType(const ObjCObjectType *T);
385
    ExpectedType VisitObjCObjectPointerType(const ObjCObjectPointerType *T);
386
387
    // Importing declarations
388
    Error ImportDeclParts(
389
        NamedDecl *D, DeclContext *&DC, DeclContext *&LexicalDC,
390
        DeclarationName &Name, NamedDecl *&ToD, SourceLocation &Loc);
391
    Error ImportDefinitionIfNeeded(Decl *FromD, Decl *ToD = nullptr);
392
    Error ImportDeclarationNameLoc(
393
        const DeclarationNameInfo &From, DeclarationNameInfo &To);
394
    Error ImportDeclContext(DeclContext *FromDC, bool ForceImport = false);
395
    Error ImportDeclContext(
396
        Decl *From, DeclContext *&ToDC, DeclContext *&ToLexicalDC);
397
    Error ImportImplicitMethods(const CXXRecordDecl *From, CXXRecordDecl *To);
398
399
    Expected<CXXCastPath> ImportCastPath(CastExpr *E);
400
    Expected<APValue> ImportAPValue(const APValue &FromValue);
401
402
    using Designator = DesignatedInitExpr::Designator;
403
404
    /// What we should import from the definition.
405
    enum ImportDefinitionKind {
406
      /// Import the default subset of the definition, which might be
407
      /// nothing (if minimal import is set) or might be everything (if minimal
408
      /// import is not set).
409
      IDK_Default,
410
      /// Import everything.
411
      IDK_Everything,
412
      /// Import only the bare bones needed to establish a valid
413
      /// DeclContext.
414
      IDK_Basic
415
    };
416
417
81.1k
    bool shouldForceImportDeclContext(ImportDefinitionKind IDK) {
418
81.1k
      return IDK == IDK_Everything ||
419
80.8k
             (IDK == IDK_Default && 
!Importer.isMinimalImport()79.5k
);
420
81.1k
    }
421
422
    Error ImportInitializer(VarDecl *From, VarDecl *To);
423
    Error ImportDefinition(
424
        RecordDecl *From, RecordDecl *To,
425
        ImportDefinitionKind Kind = IDK_Default);
426
    Error ImportDefinition(
427
        EnumDecl *From, EnumDecl *To,
428
        ImportDefinitionKind Kind = IDK_Default);
429
    Error ImportDefinition(
430
        ObjCInterfaceDecl *From, ObjCInterfaceDecl *To,
431
        ImportDefinitionKind Kind = IDK_Default);
432
    Error ImportDefinition(
433
        ObjCProtocolDecl *From, ObjCProtocolDecl *To,
434
        ImportDefinitionKind Kind = IDK_Default);
435
    Error ImportTemplateArguments(
436
        const TemplateArgument *FromArgs, unsigned NumFromArgs,
437
        SmallVectorImpl<TemplateArgument> &ToArgs);
438
    Expected<TemplateArgument>
439
    ImportTemplateArgument(const TemplateArgument &From);
440
441
    template <typename InContainerTy>
442
    Error ImportTemplateArgumentListInfo(
443
        const InContainerTy &Container, TemplateArgumentListInfo &ToTAInfo);
444
445
    template<typename InContainerTy>
446
    Error ImportTemplateArgumentListInfo(
447
      SourceLocation FromLAngleLoc, SourceLocation FromRAngleLoc,
448
      const InContainerTy &Container, TemplateArgumentListInfo &Result);
449
450
    using TemplateArgsTy = SmallVector<TemplateArgument, 8>;
451
    using FunctionTemplateAndArgsTy =
452
        std::tuple<FunctionTemplateDecl *, TemplateArgsTy>;
453
    Expected<FunctionTemplateAndArgsTy>
454
    ImportFunctionTemplateWithTemplateArgsFromSpecialization(
455
        FunctionDecl *FromFD);
456
    Error ImportTemplateParameterLists(const DeclaratorDecl *FromD,
457
                                       DeclaratorDecl *ToD);
458
459
    Error ImportTemplateInformation(FunctionDecl *FromFD, FunctionDecl *ToFD);
460
461
    Error ImportFunctionDeclBody(FunctionDecl *FromFD, FunctionDecl *ToFD);
462
463
    Error ImportDefaultArgOfParmVarDecl(const ParmVarDecl *FromParam,
464
                                        ParmVarDecl *ToParam);
465
466
    template <typename T>
467
    bool hasSameVisibilityContextAndLinkage(T *Found, T *From);
468
469
    bool IsStructuralMatch(Decl *From, Decl *To, bool Complain);
470
    bool IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord,
471
                           bool Complain = true);
472
    bool IsStructuralMatch(VarDecl *FromVar, VarDecl *ToVar,
473
                           bool Complain = true);
474
    bool IsStructuralMatch(EnumDecl *FromEnum, EnumDecl *ToRecord);
475
    bool IsStructuralMatch(EnumConstantDecl *FromEC, EnumConstantDecl *ToEC);
476
    bool IsStructuralMatch(FunctionTemplateDecl *From,
477
                           FunctionTemplateDecl *To);
478
    bool IsStructuralMatch(FunctionDecl *From, FunctionDecl *To);
479
    bool IsStructuralMatch(ClassTemplateDecl *From, ClassTemplateDecl *To);
480
    bool IsStructuralMatch(VarTemplateDecl *From, VarTemplateDecl *To);
481
    ExpectedDecl VisitDecl(Decl *D);
482
    ExpectedDecl VisitImportDecl(ImportDecl *D);
483
    ExpectedDecl VisitEmptyDecl(EmptyDecl *D);
484
    ExpectedDecl VisitAccessSpecDecl(AccessSpecDecl *D);
485
    ExpectedDecl VisitStaticAssertDecl(StaticAssertDecl *D);
486
    ExpectedDecl VisitTranslationUnitDecl(TranslationUnitDecl *D);
487
    ExpectedDecl VisitNamespaceDecl(NamespaceDecl *D);
488
    ExpectedDecl VisitNamespaceAliasDecl(NamespaceAliasDecl *D);
489
    ExpectedDecl VisitTypedefNameDecl(TypedefNameDecl *D, bool IsAlias);
490
    ExpectedDecl VisitTypedefDecl(TypedefDecl *D);
491
    ExpectedDecl VisitTypeAliasDecl(TypeAliasDecl *D);
492
    ExpectedDecl VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D);
493
    ExpectedDecl VisitLabelDecl(LabelDecl *D);
494
    ExpectedDecl VisitEnumDecl(EnumDecl *D);
495
    ExpectedDecl VisitRecordDecl(RecordDecl *D);
496
    ExpectedDecl VisitEnumConstantDecl(EnumConstantDecl *D);
497
    ExpectedDecl VisitFunctionDecl(FunctionDecl *D);
498
    ExpectedDecl VisitCXXMethodDecl(CXXMethodDecl *D);
499
    ExpectedDecl VisitCXXConstructorDecl(CXXConstructorDecl *D);
500
    ExpectedDecl VisitCXXDestructorDecl(CXXDestructorDecl *D);
501
    ExpectedDecl VisitCXXConversionDecl(CXXConversionDecl *D);
502
    ExpectedDecl VisitFieldDecl(FieldDecl *D);
503
    ExpectedDecl VisitIndirectFieldDecl(IndirectFieldDecl *D);
504
    ExpectedDecl VisitFriendDecl(FriendDecl *D);
505
    ExpectedDecl VisitObjCIvarDecl(ObjCIvarDecl *D);
506
    ExpectedDecl VisitVarDecl(VarDecl *D);
507
    ExpectedDecl VisitImplicitParamDecl(ImplicitParamDecl *D);
508
    ExpectedDecl VisitParmVarDecl(ParmVarDecl *D);
509
    ExpectedDecl VisitObjCMethodDecl(ObjCMethodDecl *D);
510
    ExpectedDecl VisitObjCTypeParamDecl(ObjCTypeParamDecl *D);
511
    ExpectedDecl VisitObjCCategoryDecl(ObjCCategoryDecl *D);
512
    ExpectedDecl VisitObjCProtocolDecl(ObjCProtocolDecl *D);
513
    ExpectedDecl VisitLinkageSpecDecl(LinkageSpecDecl *D);
514
    ExpectedDecl VisitUsingDecl(UsingDecl *D);
515
    ExpectedDecl VisitUsingShadowDecl(UsingShadowDecl *D);
516
    ExpectedDecl VisitUsingDirectiveDecl(UsingDirectiveDecl *D);
517
    ExpectedDecl VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D);
518
    ExpectedDecl VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D);
519
    ExpectedDecl VisitBuiltinTemplateDecl(BuiltinTemplateDecl *D);
520
    ExpectedDecl
521
    VisitLifetimeExtendedTemporaryDecl(LifetimeExtendedTemporaryDecl *D);
522
523
    Expected<ObjCTypeParamList *>
524
    ImportObjCTypeParamList(ObjCTypeParamList *list);
525
526
    ExpectedDecl VisitObjCInterfaceDecl(ObjCInterfaceDecl *D);
527
    ExpectedDecl VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D);
528
    ExpectedDecl VisitObjCImplementationDecl(ObjCImplementationDecl *D);
529
    ExpectedDecl VisitObjCPropertyDecl(ObjCPropertyDecl *D);
530
    ExpectedDecl VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D);
531
    ExpectedDecl VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D);
532
    ExpectedDecl VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D);
533
    ExpectedDecl VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D);
534
    ExpectedDecl VisitClassTemplateDecl(ClassTemplateDecl *D);
535
    ExpectedDecl VisitClassTemplateSpecializationDecl(
536
                                            ClassTemplateSpecializationDecl *D);
537
    ExpectedDecl VisitVarTemplateDecl(VarTemplateDecl *D);
538
    ExpectedDecl VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D);
539
    ExpectedDecl VisitFunctionTemplateDecl(FunctionTemplateDecl *D);
540
541
    // Importing statements
542
    ExpectedStmt VisitStmt(Stmt *S);
543
    ExpectedStmt VisitGCCAsmStmt(GCCAsmStmt *S);
544
    ExpectedStmt VisitDeclStmt(DeclStmt *S);
545
    ExpectedStmt VisitNullStmt(NullStmt *S);
546
    ExpectedStmt VisitCompoundStmt(CompoundStmt *S);
547
    ExpectedStmt VisitCaseStmt(CaseStmt *S);
548
    ExpectedStmt VisitDefaultStmt(DefaultStmt *S);
549
    ExpectedStmt VisitLabelStmt(LabelStmt *S);
550
    ExpectedStmt VisitAttributedStmt(AttributedStmt *S);
551
    ExpectedStmt VisitIfStmt(IfStmt *S);
552
    ExpectedStmt VisitSwitchStmt(SwitchStmt *S);
553
    ExpectedStmt VisitWhileStmt(WhileStmt *S);
554
    ExpectedStmt VisitDoStmt(DoStmt *S);
555
    ExpectedStmt VisitForStmt(ForStmt *S);
556
    ExpectedStmt VisitGotoStmt(GotoStmt *S);
557
    ExpectedStmt VisitIndirectGotoStmt(IndirectGotoStmt *S);
558
    ExpectedStmt VisitContinueStmt(ContinueStmt *S);
559
    ExpectedStmt VisitBreakStmt(BreakStmt *S);
560
    ExpectedStmt VisitReturnStmt(ReturnStmt *S);
561
    // FIXME: MSAsmStmt
562
    // FIXME: SEHExceptStmt
563
    // FIXME: SEHFinallyStmt
564
    // FIXME: SEHTryStmt
565
    // FIXME: SEHLeaveStmt
566
    // FIXME: CapturedStmt
567
    ExpectedStmt VisitCXXCatchStmt(CXXCatchStmt *S);
568
    ExpectedStmt VisitCXXTryStmt(CXXTryStmt *S);
569
    ExpectedStmt VisitCXXForRangeStmt(CXXForRangeStmt *S);
570
    // FIXME: MSDependentExistsStmt
571
    ExpectedStmt VisitObjCForCollectionStmt(ObjCForCollectionStmt *S);
572
    ExpectedStmt VisitObjCAtCatchStmt(ObjCAtCatchStmt *S);
573
    ExpectedStmt VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S);
574
    ExpectedStmt VisitObjCAtTryStmt(ObjCAtTryStmt *S);
575
    ExpectedStmt VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S);
576
    ExpectedStmt VisitObjCAtThrowStmt(ObjCAtThrowStmt *S);
577
    ExpectedStmt VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S);
578
579
    // Importing expressions
580
    ExpectedStmt VisitExpr(Expr *E);
581
    ExpectedStmt VisitVAArgExpr(VAArgExpr *E);
582
    ExpectedStmt VisitChooseExpr(ChooseExpr *E);
583
    ExpectedStmt VisitGNUNullExpr(GNUNullExpr *E);
584
    ExpectedStmt VisitPredefinedExpr(PredefinedExpr *E);
585
    ExpectedStmt VisitDeclRefExpr(DeclRefExpr *E);
586
    ExpectedStmt VisitImplicitValueInitExpr(ImplicitValueInitExpr *E);
587
    ExpectedStmt VisitDesignatedInitExpr(DesignatedInitExpr *E);
588
    ExpectedStmt VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E);
589
    ExpectedStmt VisitIntegerLiteral(IntegerLiteral *E);
590
    ExpectedStmt VisitFloatingLiteral(FloatingLiteral *E);
591
    ExpectedStmt VisitImaginaryLiteral(ImaginaryLiteral *E);
592
    ExpectedStmt VisitFixedPointLiteral(FixedPointLiteral *E);
593
    ExpectedStmt VisitCharacterLiteral(CharacterLiteral *E);
594
    ExpectedStmt VisitStringLiteral(StringLiteral *E);
595
    ExpectedStmt VisitCompoundLiteralExpr(CompoundLiteralExpr *E);
596
    ExpectedStmt VisitAtomicExpr(AtomicExpr *E);
597
    ExpectedStmt VisitAddrLabelExpr(AddrLabelExpr *E);
598
    ExpectedStmt VisitConstantExpr(ConstantExpr *E);
599
    ExpectedStmt VisitParenExpr(ParenExpr *E);
600
    ExpectedStmt VisitParenListExpr(ParenListExpr *E);
601
    ExpectedStmt VisitStmtExpr(StmtExpr *E);
602
    ExpectedStmt VisitUnaryOperator(UnaryOperator *E);
603
    ExpectedStmt VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E);
604
    ExpectedStmt VisitBinaryOperator(BinaryOperator *E);
605
    ExpectedStmt VisitConditionalOperator(ConditionalOperator *E);
606
    ExpectedStmt VisitBinaryConditionalOperator(BinaryConditionalOperator *E);
607
    ExpectedStmt VisitOpaqueValueExpr(OpaqueValueExpr *E);
608
    ExpectedStmt VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E);
609
    ExpectedStmt VisitExpressionTraitExpr(ExpressionTraitExpr *E);
610
    ExpectedStmt VisitArraySubscriptExpr(ArraySubscriptExpr *E);
611
    ExpectedStmt VisitCompoundAssignOperator(CompoundAssignOperator *E);
612
    ExpectedStmt VisitImplicitCastExpr(ImplicitCastExpr *E);
613
    ExpectedStmt VisitExplicitCastExpr(ExplicitCastExpr *E);
614
    ExpectedStmt VisitOffsetOfExpr(OffsetOfExpr *OE);
615
    ExpectedStmt VisitCXXThrowExpr(CXXThrowExpr *E);
616
    ExpectedStmt VisitCXXNoexceptExpr(CXXNoexceptExpr *E);
617
    ExpectedStmt VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E);
618
    ExpectedStmt VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E);
619
    ExpectedStmt VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E);
620
    ExpectedStmt VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E);
621
    ExpectedStmt VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E);
622
    ExpectedStmt VisitPackExpansionExpr(PackExpansionExpr *E);
623
    ExpectedStmt VisitSizeOfPackExpr(SizeOfPackExpr *E);
624
    ExpectedStmt VisitCXXNewExpr(CXXNewExpr *E);
625
    ExpectedStmt VisitCXXDeleteExpr(CXXDeleteExpr *E);
626
    ExpectedStmt VisitCXXConstructExpr(CXXConstructExpr *E);
627
    ExpectedStmt VisitCXXMemberCallExpr(CXXMemberCallExpr *E);
628
    ExpectedStmt VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E);
629
    ExpectedStmt VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E);
630
    ExpectedStmt VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E);
631
    ExpectedStmt VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E);
632
    ExpectedStmt VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E);
633
    ExpectedStmt VisitExprWithCleanups(ExprWithCleanups *E);
634
    ExpectedStmt VisitCXXThisExpr(CXXThisExpr *E);
635
    ExpectedStmt VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E);
636
    ExpectedStmt VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E);
637
    ExpectedStmt VisitMemberExpr(MemberExpr *E);
638
    ExpectedStmt VisitCallExpr(CallExpr *E);
639
    ExpectedStmt VisitLambdaExpr(LambdaExpr *LE);
640
    ExpectedStmt VisitInitListExpr(InitListExpr *E);
641
    ExpectedStmt VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E);
642
    ExpectedStmt VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E);
643
    ExpectedStmt VisitArrayInitLoopExpr(ArrayInitLoopExpr *E);
644
    ExpectedStmt VisitArrayInitIndexExpr(ArrayInitIndexExpr *E);
645
    ExpectedStmt VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E);
646
    ExpectedStmt VisitCXXNamedCastExpr(CXXNamedCastExpr *E);
647
    ExpectedStmt VisitSubstNonTypeTemplateParmExpr(SubstNonTypeTemplateParmExpr *E);
648
    ExpectedStmt VisitTypeTraitExpr(TypeTraitExpr *E);
649
    ExpectedStmt VisitCXXTypeidExpr(CXXTypeidExpr *E);
650
651
    template<typename IIter, typename OIter>
652
1.25M
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
653
1.25M
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
654
3.11M
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin1.86M
) {
655
1.86M
        Expected<ItemT> ToOrErr = import(*Ibegin);
656
1.86M
        if (!ToOrErr)
657
28
          return ToOrErr.takeError();
658
1.86M
        *Obegin = *ToOrErr;
659
1.86M
      }
660
1.25M
      return Error::success();
661
1.25M
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::NamedDecl* const*, clang::NamedDecl**>(clang::NamedDecl* const*, clang::NamedDecl* const*, clang::NamedDecl**)
Line
Count
Source
652
262k
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
653
262k
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
654
740k
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin478k
) {
655
478k
        Expected<ItemT> ToOrErr = import(*Ibegin);
656
478k
        if (!ToOrErr)
657
0
          return ToOrErr.takeError();
658
478k
        *Obegin = *ToOrErr;
659
478k
      }
660
262k
      return Error::success();
661
262k
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::CXXCtorInitializer**, clang::CXXCtorInitializer**>(clang::CXXCtorInitializer**, clang::CXXCtorInitializer**, clang::CXXCtorInitializer**)
Line
Count
Source
652
25.9k
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
653
25.9k
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
654
64.9k
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin39.0k
) {
655
39.0k
        Expected<ItemT> ToOrErr = import(*Ibegin);
656
39.0k
        if (!ToOrErr)
657
0
          return ToOrErr.takeError();
658
39.0k
        *Obegin = *ToOrErr;
659
39.0k
      }
660
25.9k
      return Error::success();
661
25.9k
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::Stmt::CastIterator<clang::Expr, clang::Expr*, clang::Stmt*>, clang::Expr**>(clang::Stmt::CastIterator<clang::Expr, clang::Expr*, clang::Stmt*>, clang::Stmt::CastIterator<clang::Expr, clang::Expr*, clang::Stmt*>, clang::Expr**)
Line
Count
Source
652
612k
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
653
612k
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
654
1.34M
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin727k
) {
655
727k
        Expected<ItemT> ToOrErr = import(*Ibegin);
656
727k
        if (!ToOrErr)
657
0
          return ToOrErr.takeError();
658
727k
        *Obegin = *ToOrErr;
659
727k
      }
660
612k
      return Error::success();
661
612k
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::Stmt::CastIterator<clang::AddrLabelExpr, clang::AddrLabelExpr*, clang::Stmt*>, clang::Expr**>(clang::Stmt::CastIterator<clang::AddrLabelExpr, clang::AddrLabelExpr*, clang::Stmt*>, clang::Stmt::CastIterator<clang::AddrLabelExpr, clang::AddrLabelExpr*, clang::Stmt*>, clang::Expr**)
Line
Count
Source
652
3
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
653
3
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
654
3
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin0
) {
655
0
        Expected<ItemT> ToOrErr = import(*Ibegin);
656
0
        if (!ToOrErr)
657
0
          return ToOrErr.takeError();
658
0
        *Obegin = *ToOrErr;
659
0
      }
660
3
      return Error::success();
661
3
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::Stmt**, clang::Stmt**>(clang::Stmt**, clang::Stmt**, clang::Stmt**)
Line
Count
Source
652
238k
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
653
238k
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
654
732k
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin493k
) {
655
493k
        Expected<ItemT> ToOrErr = import(*Ibegin);
656
493k
        if (!ToOrErr)
657
28
          return ToOrErr.takeError();
658
493k
        *Obegin = *ToOrErr;
659
493k
      }
660
238k
      return Error::success();
661
238k
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::Attr const* const*, clang::Attr const**>(clang::Attr const* const*, clang::Attr const* const*, clang::Attr const**)
Line
Count
Source
652
56
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
653
56
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
654
112
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin56
) {
655
56
        Expected<ItemT> ToOrErr = import(*Ibegin);
656
56
        if (!ToOrErr)
657
0
          return ToOrErr.takeError();
658
56
        *Obegin = *ToOrErr;
659
56
      }
660
56
      return Error::success();
661
56
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::DesignatedInitExpr::Designator*, clang::DesignatedInitExpr::Designator*>(clang::DesignatedInitExpr::Designator*, clang::DesignatedInitExpr::Designator*, clang::DesignatedInitExpr::Designator*)
Line
Count
Source
652
44
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
653
44
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
654
117
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin73
) {
655
73
        Expected<ItemT> ToOrErr = import(*Ibegin);
656
73
        if (!ToOrErr)
657
0
          return ToOrErr.takeError();
658
73
        *Obegin = *ToOrErr;
659
73
      }
660
44
      return Error::success();
661
44
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::SourceLocation const*, clang::SourceLocation*>(clang::SourceLocation const*, clang::SourceLocation const*, clang::SourceLocation*)
Line
Count
Source
652
21.1k
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
653
21.1k
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
654
39.6k
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin18.4k
) {
655
18.4k
        Expected<ItemT> ToOrErr = import(*Ibegin);
656
18.4k
        if (!ToOrErr)
657
0
          return ToOrErr.takeError();
658
18.4k
        *Obegin = *ToOrErr;
659
18.4k
      }
660
21.1k
      return Error::success();
661
21.1k
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::Expr**, clang::Expr**>(clang::Expr**, clang::Expr**, clang::Expr**)
Line
Count
Source
652
38.4k
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
653
38.4k
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
654
69.0k
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin30.5k
) {
655
30.5k
        Expected<ItemT> ToOrErr = import(*Ibegin);
656
30.5k
        if (!ToOrErr)
657
0
          return ToOrErr.takeError();
658
30.5k
        *Obegin = *ToOrErr;
659
30.5k
      }
660
38.4k
      return Error::success();
661
38.4k
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::Expr* const*, clang::Expr**>(clang::Expr* const*, clang::Expr* const*, clang::Expr**)
Line
Count
Source
652
37.8k
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
653
37.8k
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
654
94.1k
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin56.3k
) {
655
56.3k
        Expected<ItemT> ToOrErr = import(*Ibegin);
656
56.3k
        if (!ToOrErr)
657
0
          return ToOrErr.takeError();
658
56.3k
        *Obegin = *ToOrErr;
659
56.3k
      }
660
37.8k
      return Error::success();
661
37.8k
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<llvm::PointerUnion<clang::BlockDecl*, clang::CompoundLiteralExpr*> const*, llvm::PointerUnion<clang::BlockDecl*, clang::CompoundLiteralExpr*>*>(llvm::PointerUnion<clang::BlockDecl*, clang::CompoundLiteralExpr*> const*, llvm::PointerUnion<clang::BlockDecl*, clang::CompoundLiteralExpr*> const*, llvm::PointerUnion<clang::BlockDecl*, clang::CompoundLiteralExpr*>*)
Line
Count
Source
652
8.78k
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
653
8.78k
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
654
8.79k
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin2
) {
655
2
        Expected<ItemT> ToOrErr = import(*Ibegin);
656
2
        if (!ToOrErr)
657
0
          return ToOrErr.takeError();
658
2
        *Obegin = *ToOrErr;
659
2
      }
660
8.78k
      return Error::success();
661
8.78k
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::TypeSourceInfo* const*, clang::TypeSourceInfo**>(clang::TypeSourceInfo* const*, clang::TypeSourceInfo* const*, clang::TypeSourceInfo**)
Line
Count
Source
652
10.6k
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
653
10.6k
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
654
28.3k
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin17.6k
) {
655
17.6k
        Expected<ItemT> ToOrErr = import(*Ibegin);
656
17.6k
        if (!ToOrErr)
657
0
          return ToOrErr.takeError();
658
17.6k
        *Obegin = *ToOrErr;
659
17.6k
      }
660
10.6k
      return Error::success();
661
10.6k
    }
662
663
    // Import every item from a container structure into an output container.
664
    // If error occurs, stops at first error and returns the error.
665
    // The output container should have space for all needed elements (it is not
666
    // expanded, new items are put into from the beginning).
667
    template<typename InContainerTy, typename OutContainerTy>
668
    Error ImportContainerChecked(
669
1.20M
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
1.20M
      return ImportArrayChecked(
671
1.20M
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
1.20M
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<clang::TemplateParameterList, llvm::SmallVector<clang::NamedDecl*, 4u> >(clang::TemplateParameterList const&, llvm::SmallVector<clang::NamedDecl*, 4u>&)
Line
Count
Source
669
262k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
262k
      return ImportArrayChecked(
671
262k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
262k
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::iterator_range<clang::CXXCtorInitializer**>, llvm::SmallVector<clang::CXXCtorInitializer*, 4u> >(llvm::iterator_range<clang::CXXCtorInitializer**> const&, llvm::SmallVector<clang::CXXCtorInitializer*, 4u>&)
Line
Count
Source
669
25.9k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
25.9k
      return ImportArrayChecked(
671
25.9k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
25.9k
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::SmallVector<clang::SourceLocation, 12u>, llvm::SmallVector<clang::SourceLocation, 12u> >(llvm::SmallVector<clang::SourceLocation, 12u> const&, llvm::SmallVector<clang::SourceLocation, 12u>&)
Line
Count
Source
669
8.40k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
8.40k
      return ImportArrayChecked(
671
8.40k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
8.40k
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr*, clang::Stmt*> >, llvm::SmallVector<clang::Expr*, 4u> >(llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr*, clang::Stmt*> > const&, llvm::SmallVector<clang::Expr*, 4u>&)
Line
Count
Source
669
35.2k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
35.2k
      return ImportArrayChecked(
671
35.2k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
35.2k
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::iterator_range<clang::Stmt**>, llvm::SmallVector<clang::Stmt*, 8u> >(llvm::iterator_range<clang::Stmt**> const&, llvm::SmallVector<clang::Stmt*, 8u>&)
Line
Count
Source
669
238k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
238k
      return ImportArrayChecked(
671
238k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
238k
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::ArrayRef<clang::Attr const*>, llvm::SmallVector<clang::Attr const*, 1u> >(llvm::ArrayRef<clang::Attr const*> const&, llvm::SmallVector<clang::Attr const*, 1u>&)
Line
Count
Source
669
56
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
56
      return ImportArrayChecked(
671
56
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
56
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::MutableArrayRef<clang::DesignatedInitExpr::Designator>, llvm::SmallVector<clang::DesignatedInitExpr::Designator, 4u> >(llvm::MutableArrayRef<clang::DesignatedInitExpr::Designator> const&, llvm::SmallVector<clang::DesignatedInitExpr::Designator, 4u>&)
Line
Count
Source
669
44
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
44
      return ImportArrayChecked(
671
44
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
44
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::ArrayRef<clang::Expr*>, llvm::SmallVector<clang::Expr*, 4u> >(llvm::ArrayRef<clang::Expr*> const&, llvm::SmallVector<clang::Expr*, 4u>&)
Line
Count
Source
669
37.8k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
37.8k
      return ImportArrayChecked(
671
37.8k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
37.8k
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr*, clang::Stmt*> >, llvm::SmallVector<clang::Expr*, 8u> >(llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr*, clang::Stmt*> > const&, llvm::SmallVector<clang::Expr*, 8u>&)
Line
Count
Source
669
8.16k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
8.16k
      return ImportArrayChecked(
671
8.16k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
8.16k
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr*, clang::Stmt*> >, llvm::SmallVector<clang::Expr*, 6u> >(llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr*, clang::Stmt*> > const&, llvm::SmallVector<clang::Expr*, 6u>&)
Line
Count
Source
669
21.6k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
21.6k
      return ImportArrayChecked(
671
21.6k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
21.6k
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::ArrayRef<llvm::PointerUnion<clang::BlockDecl*, clang::CompoundLiteralExpr*> >, llvm::SmallVector<llvm::PointerUnion<clang::BlockDecl*, clang::CompoundLiteralExpr*>, 8u> >(llvm::ArrayRef<llvm::PointerUnion<clang::BlockDecl*, clang::CompoundLiteralExpr*> > const&, llvm::SmallVector<llvm::PointerUnion<clang::BlockDecl*, clang::CompoundLiteralExpr*>, 8u>&)
Line
Count
Source
669
8.78k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
8.78k
      return ImportArrayChecked(
671
8.78k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
8.78k
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr*, clang::Stmt*> >, llvm::SmallVector<clang::Expr*, 2u> >(llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr*, clang::Stmt*> > const&, llvm::SmallVector<clang::Expr*, 2u>&)
Line
Count
Source
669
547k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
547k
      return ImportArrayChecked(
671
547k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
547k
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::iterator_range<clang::Expr**>, llvm::SmallVector<clang::Expr*, 8u> >(llvm::iterator_range<clang::Expr**> const&, llvm::SmallVector<clang::Expr*, 8u>&)
Line
Count
Source
669
47
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
47
      return ImportArrayChecked(
671
47
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
47
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::ArrayRef<clang::TypeSourceInfo*>, llvm::SmallVector<clang::TypeSourceInfo*, 4u> >(llvm::ArrayRef<clang::TypeSourceInfo*> const&, llvm::SmallVector<clang::TypeSourceInfo*, 4u>&)
Line
Count
Source
669
10.6k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
670
10.6k
      return ImportArrayChecked(
671
10.6k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
672
10.6k
    }
673
674
    template<typename InContainerTy, typename OIter>
675
6
    Error ImportArrayChecked(const InContainerTy &InContainer, OIter Obegin) {
676
6
      return ImportArrayChecked(InContainer.begin(), InContainer.end(), Obegin);
677
6
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr*, clang::Stmt*> >, clang::Expr**>(llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr*, clang::Stmt*> > const&, clang::Expr**)
Line
Count
Source
675
3
    Error ImportArrayChecked(const InContainerTy &InContainer, OIter Obegin) {
676
3
      return ImportArrayChecked(InContainer.begin(), InContainer.end(), Obegin);
677
3
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<llvm::iterator_range<clang::Stmt::CastIterator<clang::AddrLabelExpr, clang::AddrLabelExpr*, clang::Stmt*> >, clang::Expr**>(llvm::iterator_range<clang::Stmt::CastIterator<clang::AddrLabelExpr, clang::AddrLabelExpr*, clang::Stmt*> > const&, clang::Expr**)
Line
Count
Source
675
3
    Error ImportArrayChecked(const InContainerTy &InContainer, OIter Obegin) {
676
3
      return ImportArrayChecked(InContainer.begin(), InContainer.end(), Obegin);
677
3
    }
678
679
    Error ImportOverriddenMethods(CXXMethodDecl *ToMethod,
680
                                  CXXMethodDecl *FromMethod);
681
682
    Expected<FunctionDecl *> FindFunctionTemplateSpecialization(
683
        FunctionDecl *FromFD);
684
685
    // Returns true if the given function has a placeholder return type and
686
    // that type is declared inside the body of the function.
687
    // E.g. auto f() { struct X{}; return X(); }
688
    bool hasAutoReturnTypeDeclaredInside(FunctionDecl *D);
689
  };
690
691
template <typename InContainerTy>
692
Error ASTNodeImporter::ImportTemplateArgumentListInfo(
693
    SourceLocation FromLAngleLoc, SourceLocation FromRAngleLoc,
694
29.3k
    const InContainerTy &Container, TemplateArgumentListInfo &Result) {
695
29.3k
  auto ToLAngleLocOrErr = import(FromLAngleLoc);
696
29.3k
  if (!ToLAngleLocOrErr)
697
0
    return ToLAngleLocOrErr.takeError();
698
29.3k
  auto ToRAngleLocOrErr = import(FromRAngleLoc);
699
29.3k
  if (!ToRAngleLocOrErr)
700
0
    return ToRAngleLocOrErr.takeError();
701
702
29.3k
  TemplateArgumentListInfo ToTAInfo(*ToLAngleLocOrErr, *ToRAngleLocOrErr);
703
29.3k
  if (auto Err = ImportTemplateArgumentListInfo(Container, ToTAInfo))
704
0
    return Err;
705
29.3k
  Result = ToTAInfo;
706
29.3k
  return Error::success();
707
29.3k
}
708
709
template <>
710
Error ASTNodeImporter::ImportTemplateArgumentListInfo<TemplateArgumentListInfo>(
711
400
    const TemplateArgumentListInfo &From, TemplateArgumentListInfo &Result) {
712
400
  return ImportTemplateArgumentListInfo(
713
400
      From.getLAngleLoc(), From.getRAngleLoc(), From.arguments(), Result);
714
400
}
715
716
template <>
717
Error ASTNodeImporter::ImportTemplateArgumentListInfo<
718
    ASTTemplateArgumentListInfo>(
719
        const ASTTemplateArgumentListInfo &From,
720
2.17k
        TemplateArgumentListInfo &Result) {
721
2.17k
  return ImportTemplateArgumentListInfo(
722
2.17k
      From.LAngleLoc, From.RAngleLoc, From.arguments(), Result);
723
2.17k
}
724
725
Expected<ASTNodeImporter::FunctionTemplateAndArgsTy>
726
ASTNodeImporter::ImportFunctionTemplateWithTemplateArgsFromSpecialization(
727
28.3k
    FunctionDecl *FromFD) {
728
28.3k
  assert(FromFD->getTemplatedKind() ==
729
28.3k
      FunctionDecl::TK_FunctionTemplateSpecialization);
730
731
28.3k
  FunctionTemplateAndArgsTy Result;
732
733
28.3k
  auto *FTSInfo = FromFD->getTemplateSpecializationInfo();
734
28.3k
  if (Error Err = importInto(std::get<0>(Result), FTSInfo->getTemplate()))
735
0
    return std::move(Err);
736
737
  // Import template arguments.
738
28.3k
  auto TemplArgs = FTSInfo->TemplateArguments->asArray();
739
28.3k
  if (Error Err = ImportTemplateArguments(TemplArgs.data(), TemplArgs.size(),
740
0
      std::get<1>(Result)))
741
0
    return std::move(Err);
742
743
28.3k
  return Result;
744
28.3k
}
745
746
template <>
747
Expected<TemplateParameterList *>
748
262k
ASTNodeImporter::import(TemplateParameterList *From) {
749
262k
  SmallVector<NamedDecl *, 4> To(From->size());
750
262k
  if (Error Err = ImportContainerChecked(*From, To))
751
0
    return std::move(Err);
752
753
262k
  ExpectedExpr ToRequiresClause = import(From->getRequiresClause());
754
262k
  if (!ToRequiresClause)
755
0
    return ToRequiresClause.takeError();
756
757
262k
  auto ToTemplateLocOrErr = import(From->getTemplateLoc());
758
262k
  if (!ToTemplateLocOrErr)
759
0
    return ToTemplateLocOrErr.takeError();
760
262k
  auto ToLAngleLocOrErr = import(From->getLAngleLoc());
761
262k
  if (!ToLAngleLocOrErr)
762
0
    return ToLAngleLocOrErr.takeError();
763
262k
  auto ToRAngleLocOrErr = import(From->getRAngleLoc());
764
262k
  if (!ToRAngleLocOrErr)
765
0
    return ToRAngleLocOrErr.takeError();
766
767
262k
  return TemplateParameterList::Create(
768
262k
      Importer.getToContext(),
769
262k
      *ToTemplateLocOrErr,
770
262k
      *ToLAngleLocOrErr,
771
262k
      To,
772
262k
      *ToRAngleLocOrErr,
773
262k
      *ToRequiresClause);
774
262k
}
775
776
template <>
777
Expected<TemplateArgument>
778
1.15M
ASTNodeImporter::import(const TemplateArgument &From) {
779
1.15M
  switch (From.getKind()) {
780
0
  case TemplateArgument::Null:
781
0
    return TemplateArgument();
782
783
925k
  case TemplateArgument::Type: {
784
925k
    ExpectedType ToTypeOrErr = import(From.getAsType());
785
925k
    if (!ToTypeOrErr)
786
0
      return ToTypeOrErr.takeError();
787
925k
    return TemplateArgument(*ToTypeOrErr);
788
925k
  }
789
790
30.1k
  case TemplateArgument::Integral: {
791
30.1k
    ExpectedType ToTypeOrErr = import(From.getIntegralType());
792
30.1k
    if (!ToTypeOrErr)
793
0
      return ToTypeOrErr.takeError();
794
30.1k
    return TemplateArgument(From, *ToTypeOrErr);
795
30.1k
  }
796
797
0
  case TemplateArgument::Declaration: {
798
0
    Expected<ValueDecl *> ToOrErr = import(From.getAsDecl());
799
0
    if (!ToOrErr)
800
0
      return ToOrErr.takeError();
801
0
    ExpectedType ToTypeOrErr = import(From.getParamTypeForDecl());
802
0
    if (!ToTypeOrErr)
803
0
      return ToTypeOrErr.takeError();
804
0
    return TemplateArgument(*ToOrErr, *ToTypeOrErr);
805
0
  }
806
807
0
  case TemplateArgument::NullPtr: {
808
0
    ExpectedType ToTypeOrErr = import(From.getNullPtrType());
809
0
    if (!ToTypeOrErr)
810
0
      return ToTypeOrErr.takeError();
811
0
    return TemplateArgument(*ToTypeOrErr, /*isNullPtr*/true);
812
0
  }
813
814
500
  case TemplateArgument::Template: {
815
500
    Expected<TemplateName> ToTemplateOrErr = import(From.getAsTemplate());
816
500
    if (!ToTemplateOrErr)
817
0
      return ToTemplateOrErr.takeError();
818
819
500
    return TemplateArgument(*ToTemplateOrErr);
820
500
  }
821
822
0
  case TemplateArgument::TemplateExpansion: {
823
0
    Expected<TemplateName> ToTemplateOrErr =
824
0
        import(From.getAsTemplateOrTemplatePattern());
825
0
    if (!ToTemplateOrErr)
826
0
      return ToTemplateOrErr.takeError();
827
828
0
    return TemplateArgument(
829
0
        *ToTemplateOrErr, From.getNumTemplateExpansions());
830
0
  }
831
832
179k
  case TemplateArgument::Expression:
833
179k
    if (ExpectedExpr ToExpr = import(From.getAsExpr()))
834
179k
      return TemplateArgument(*ToExpr);
835
0
    else
836
0
      return ToExpr.takeError();
837
838
17.7k
  case TemplateArgument::Pack: {
839
17.7k
    SmallVector<TemplateArgument, 2> ToPack;
840
17.7k
    ToPack.reserve(From.pack_size());
841
17.7k
    if (Error Err = ImportTemplateArguments(
842
0
        From.pack_begin(), From.pack_size(), ToPack))
843
0
      return std::move(Err);
844
845
17.7k
    return TemplateArgument(
846
17.7k
        llvm::makeArrayRef(ToPack).copy(Importer.getToContext()));
847
17.7k
  }
848
0
  }
849
850
0
  llvm_unreachable("Invalid template argument kind");
851
0
}
852
853
template <>
854
Expected<TemplateArgumentLoc>
855
51.3k
ASTNodeImporter::import(const TemplateArgumentLoc &TALoc) {
856
51.3k
  Expected<TemplateArgument> ArgOrErr = import(TALoc.getArgument());
857
51.3k
  if (!ArgOrErr)
858
0
    return ArgOrErr.takeError();
859
51.3k
  TemplateArgument Arg = *ArgOrErr;
860
861
51.3k
  TemplateArgumentLocInfo FromInfo = TALoc.getLocInfo();
862
863
51.3k
  TemplateArgumentLocInfo ToInfo;
864
51.3k
  if (Arg.getKind() == TemplateArgument::Expression) {
865
5.54k
    ExpectedExpr E = import(FromInfo.getAsExpr());
866
5.54k
    if (!E)
867
0
      return E.takeError();
868
5.54k
    ToInfo = TemplateArgumentLocInfo(*E);
869
45.8k
  } else if (Arg.getKind() == TemplateArgument::Type) {
870
45.6k
    if (auto TSIOrErr = import(FromInfo.getAsTypeSourceInfo()))
871
45.6k
      ToInfo = TemplateArgumentLocInfo(*TSIOrErr);
872
0
    else
873
0
      return TSIOrErr.takeError();
874
162
  } else {
875
162
    auto ToTemplateQualifierLocOrErr =
876
162
        import(FromInfo.getTemplateQualifierLoc());
877
162
    if (!ToTemplateQualifierLocOrErr)
878
0
      return ToTemplateQualifierLocOrErr.takeError();
879
162
    auto ToTemplateNameLocOrErr = import(FromInfo.getTemplateNameLoc());
880
162
    if (!ToTemplateNameLocOrErr)
881
0
      return ToTemplateNameLocOrErr.takeError();
882
162
    auto ToTemplateEllipsisLocOrErr =
883
162
        import(FromInfo.getTemplateEllipsisLoc());
884
162
    if (!ToTemplateEllipsisLocOrErr)
885
0
      return ToTemplateEllipsisLocOrErr.takeError();
886
162
    ToInfo = TemplateArgumentLocInfo(
887
162
        Importer.getToContext(), *ToTemplateQualifierLocOrErr,
888
162
        *ToTemplateNameLocOrErr, *ToTemplateEllipsisLocOrErr);
889
162
  }
890
891
51.3k
  return TemplateArgumentLoc(Arg, ToInfo);
892
51.3k
}
893
894
template <>
895
117k
Expected<DeclGroupRef> ASTNodeImporter::import(const DeclGroupRef &DG) {
896
117k
  if (DG.isNull())
897
0
    return DeclGroupRef::Create(Importer.getToContext(), nullptr, 0);
898
117k
  size_t NumDecls = DG.end() - DG.begin();
899
117k
  SmallVector<Decl *, 1> ToDecls;
900
117k
  ToDecls.reserve(NumDecls);
901
118k
  for (Decl *FromD : DG) {
902
118k
    if (auto ToDOrErr = import(FromD))
903
118k
      ToDecls.push_back(*ToDOrErr);
904
0
    else
905
0
      return ToDOrErr.takeError();
906
118k
  }
907
117k
  return DeclGroupRef::Create(Importer.getToContext(),
908
117k
                              ToDecls.begin(),
909
117k
                              NumDecls);
910
117k
}
911
912
template <>
913
Expected<ASTNodeImporter::Designator>
914
73
ASTNodeImporter::import(const Designator &D) {
915
73
  if (D.isFieldDesignator()) {
916
47
    IdentifierInfo *ToFieldName = Importer.Import(D.getFieldName());
917
918
47
    ExpectedSLoc ToDotLocOrErr = import(D.getDotLoc());
919
47
    if (!ToDotLocOrErr)
920
0
      return ToDotLocOrErr.takeError();
921
922
47
    ExpectedSLoc ToFieldLocOrErr = import(D.getFieldLoc());
923
47
    if (!ToFieldLocOrErr)
924
0
      return ToFieldLocOrErr.takeError();
925
926
47
    return Designator(ToFieldName, *ToDotLocOrErr, *ToFieldLocOrErr);
927
47
  }
928
929
26
  ExpectedSLoc ToLBracketLocOrErr = import(D.getLBracketLoc());
930
26
  if (!ToLBracketLocOrErr)
931
0
    return ToLBracketLocOrErr.takeError();
932
933
26
  ExpectedSLoc ToRBracketLocOrErr = import(D.getRBracketLoc());
934
26
  if (!ToRBracketLocOrErr)
935
0
    return ToRBracketLocOrErr.takeError();
936
937
26
  if (D.isArrayDesignator())
938
26
    return Designator(D.getFirstExprIndex(),
939
26
                      *ToLBracketLocOrErr, *ToRBracketLocOrErr);
940
941
0
  ExpectedSLoc ToEllipsisLocOrErr = import(D.getEllipsisLoc());
942
0
  if (!ToEllipsisLocOrErr)
943
0
    return ToEllipsisLocOrErr.takeError();
944
945
0
  assert(D.isArrayRangeDesignator());
946
0
  return Designator(
947
0
      D.getFirstExprIndex(), *ToLBracketLocOrErr, *ToEllipsisLocOrErr,
948
0
      *ToRBracketLocOrErr);
949
0
}
950
951
template <>
952
18
Expected<LambdaCapture> ASTNodeImporter::import(const LambdaCapture &From) {
953
18
  VarDecl *Var = nullptr;
954
18
  if (From.capturesVariable()) {
955
17
    if (auto VarOrErr = import(From.getCapturedVar()))
956
17
      Var = *VarOrErr;
957
0
    else
958
0
      return VarOrErr.takeError();
959
18
  }
960
961
18
  auto LocationOrErr = import(From.getLocation());
962
18
  if (!LocationOrErr)
963
0
    return LocationOrErr.takeError();
964
965
18
  SourceLocation EllipsisLoc;
966
18
  if (From.isPackExpansion())
967
0
    if (Error Err = importInto(EllipsisLoc, From.getEllipsisLoc()))
968
0
      return std::move(Err);
969
970
18
  return LambdaCapture(
971
18
      *LocationOrErr, From.isImplicit(), From.getCaptureKind(), Var,
972
18
      EllipsisLoc);
973
18
}
974
975
template <typename T>
976
2.09M
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
2.09M
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
430
    return false;
979
980
2.09M
  if (From->hasExternalFormalLinkage())
981
2.09M
    return Found->hasExternalFormalLinkage();
982
546
  if (Importer.GetFromTU(Found) != From->getTranslationUnitDecl())
983
181
    return false;
984
365
  if (From->isInAnonymousNamespace())
985
52
    return Found->isInAnonymousNamespace();
986
313
  else
987
313
    return !Found->isInAnonymousNamespace() &&
988
313
           !Found->hasExternalFormalLinkage();
989
365
}
bool clang::ASTNodeImporter::hasSameVisibilityContextAndLinkage<clang::EnumDecl>(clang::EnumDecl*, clang::EnumDecl*)
Line
Count
Source
976
136
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
136
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
0
    return false;
979
980
136
  if (From->hasExternalFormalLinkage())
981
116
    return Found->hasExternalFormalLinkage();
982
20
  if (Importer.GetFromTU(Found) != From->getTranslationUnitDecl())
983
16
    return false;
984
4
  if (From->isInAnonymousNamespace())
985
4
    return Found->isInAnonymousNamespace();
986
0
  else
987
0
    return !Found->isInAnonymousNamespace() &&
988
0
           !Found->hasExternalFormalLinkage();
989
4
}
bool clang::ASTNodeImporter::hasSameVisibilityContextAndLinkage<clang::RecordDecl>(clang::RecordDecl*, clang::RecordDecl*)
Line
Count
Source
976
6.24k
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
6.24k
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
0
    return false;
979
980
6.24k
  if (From->hasExternalFormalLinkage())
981
6.21k
    return Found->hasExternalFormalLinkage();
982
25
  if (Importer.GetFromTU(Found) != From->getTranslationUnitDecl())
983
17
    return false;
984
8
  if (From->isInAnonymousNamespace())
985
8
    return Found->isInAnonymousNamespace();
986
0
  else
987
0
    return !Found->isInAnonymousNamespace() &&
988
0
           !Found->hasExternalFormalLinkage();
989
8
}
bool clang::ASTNodeImporter::hasSameVisibilityContextAndLinkage<clang::FunctionDecl>(clang::FunctionDecl*, clang::FunctionDecl*)
Line
Count
Source
976
602k
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
602k
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
118
    return false;
979
980
602k
  if (From->hasExternalFormalLinkage())
981
601k
    return Found->hasExternalFormalLinkage();
982
241
  if (Importer.GetFromTU(Found) != From->getTranslationUnitDecl())
983
36
    return false;
984
205
  if (From->isInAnonymousNamespace())
985
8
    return Found->isInAnonymousNamespace();
986
197
  else
987
197
    return !Found->isInAnonymousNamespace() &&
988
197
           !Found->hasExternalFormalLinkage();
989
205
}
bool clang::ASTNodeImporter::hasSameVisibilityContextAndLinkage<clang::VarDecl>(clang::VarDecl*, clang::VarDecl*)
Line
Count
Source
976
4.01k
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
4.01k
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
64
    return false;
979
980
3.94k
  if (From->hasExternalFormalLinkage())
981
3.86k
    return Found->hasExternalFormalLinkage();
982
84
  if (Importer.GetFromTU(Found) != From->getTranslationUnitDecl())
983
64
    return false;
984
20
  if (From->isInAnonymousNamespace())
985
16
    return Found->isInAnonymousNamespace();
986
4
  else
987
4
    return !Found->isInAnonymousNamespace() &&
988
4
           !Found->hasExternalFormalLinkage();
989
20
}
bool clang::ASTNodeImporter::hasSameVisibilityContextAndLinkage<clang::ClassTemplateDecl>(clang::ClassTemplateDecl*, clang::ClassTemplateDecl*)
Line
Count
Source
976
32.2k
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
32.2k
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
0
    return false;
979
980
32.2k
  if (From->hasExternalFormalLinkage())
981
32.2k
    return Found->hasExternalFormalLinkage();
982
24
  if (Importer.GetFromTU(Found) != From->getTranslationUnitDecl())
983
16
    return false;
984
8
  if (From->isInAnonymousNamespace())
985
8
    return Found->isInAnonymousNamespace();
986
0
  else
987
0
    return !Found->isInAnonymousNamespace() &&
988
0
           !Found->hasExternalFormalLinkage();
989
8
}
bool clang::ASTNodeImporter::hasSameVisibilityContextAndLinkage<clang::FunctionTemplateDecl>(clang::FunctionTemplateDecl*, clang::FunctionTemplateDecl*)
Line
Count
Source
976
1.45M
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
1.45M
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
248
    return false;
979
980
1.45M
  if (From->hasExternalFormalLinkage())
981
1.45M
    return Found->hasExternalFormalLinkage();
982
152
  if (Importer.GetFromTU(Found) != From->getTranslationUnitDecl())
983
32
    return false;
984
120
  if (From->isInAnonymousNamespace())
985
8
    return Found->isInAnonymousNamespace();
986
112
  else
987
112
    return !Found->isInAnonymousNamespace() &&
988
112
           !Found->hasExternalFormalLinkage();
989
120
}
990
991
template <>
992
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(TypedefNameDecl *Found,
993
13.8k
                                               TypedefNameDecl *From) {
994
13.8k
  if (Found->getLinkageInternal() != From->getLinkageInternal())
995
0
    return false;
996
997
13.8k
  if (From->isInAnonymousNamespace() && 
Found->isInAnonymousNamespace()32
)
998
32
    return Importer.GetFromTU(Found) == From->getTranslationUnitDecl();
999
13.8k
  return From->isInAnonymousNamespace() == Found->isInAnonymousNamespace();
1000
13.8k
}
1001
1002
} // namespace clang
1003
1004
//----------------------------------------------------------------------------
1005
// Import Types
1006
//----------------------------------------------------------------------------
1007
1008
using namespace clang;
1009
1010
327
ExpectedType ASTNodeImporter::VisitType(const Type *T) {
1011
327
  Importer.FromDiag(SourceLocation(), diag::err_unsupported_ast_node)
1012
327
    << T->getTypeClassName();
1013
327
  return make_error<ImportError>(ImportError::UnsupportedConstruct);
1014
327
}
1015
1016
58
ExpectedType ASTNodeImporter::VisitAtomicType(const AtomicType *T){
1017
58
  ExpectedType UnderlyingTypeOrErr = import(T->getValueType());
1018
58
  if (!UnderlyingTypeOrErr)
1019
0
    return UnderlyingTypeOrErr.takeError();
1020
1021
58
  return Importer.getToContext().getAtomicType(*UnderlyingTypeOrErr);
1022
58
}
1023
1024
25.8k
ExpectedType ASTNodeImporter::VisitBuiltinType(const BuiltinType *T) {
1025
25.8k
  switch (T->getKind()) {
1026
0
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
1027
0
  case BuiltinType::Id: \
1028
0
    return Importer.getToContext().SingletonId;
1029
0
#include "clang/Basic/OpenCLImageTypes.def"
1030
0
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
1031
0
  case BuiltinType::Id: \
1032
0
    return Importer.getToContext().Id##Ty;
1033
0
#include "clang/Basic/OpenCLExtensionTypes.def"
1034
0
#define SVE_TYPE(Name, Id, SingletonId) \
1035
13
  case BuiltinType::Id: \
1036
13
    return Importer.getToContext().SingletonId;
1037
0
#include "clang/Basic/AArch64SVEACLETypes.def"
1038
0
#define SHARED_SINGLETON_TYPE(Expansion)
1039
0
#define BUILTIN_TYPE(Id, SingletonId) \
1040
23.8k
  case BuiltinType::Id: return Importer.getToContext().SingletonId;
1041
1
#include "clang/AST/BuiltinTypes.def"
1042
1043
  // FIXME: for Char16, Char32, and NullPtr, make sure that the "to"
1044
  // context supports C++.
1045
1046
  // FIXME: for ObjCId, ObjCClass, and ObjCSel, make sure that the "to"
1047
  // context supports ObjC.
1048
1049
0
  case BuiltinType::Char_U:
1050
    // The context we're importing from has an unsigned 'char'. If we're
1051
    // importing into a context with a signed 'char', translate to
1052
    // 'unsigned char' instead.
1053
0
    if (Importer.getToContext().getLangOpts().CharIsSigned)
1054
0
      return Importer.getToContext().UnsignedCharTy;
1055
1056
0
    return Importer.getToContext().CharTy;
1057
1058
1.88k
  case BuiltinType::Char_S:
1059
    // The context we're importing from has an unsigned 'char'. If we're
1060
    // importing into a context with a signed 'char', translate to
1061
    // 'unsigned char' instead.
1062
1.88k
    if (!Importer.getToContext().getLangOpts().CharIsSigned)
1063
0
      return Importer.getToContext().SignedCharTy;
1064
1065
1.88k
    return Importer.getToContext().CharTy;
1066
1067
123
  case BuiltinType::WChar_S:
1068
123
  case BuiltinType::WChar_U:
1069
    // FIXME: If not in C++, shall we translate to the C equivalent of
1070
    // wchar_t?
1071
123
    return Importer.getToContext().WCharTy;
1072
0
  }
1073
1074
0
  llvm_unreachable("Invalid BuiltinType Kind!");
1075
0
}
1076
1077
35
ExpectedType ASTNodeImporter::VisitDecayedType(const DecayedType *T) {
1078
35
  ExpectedType ToOriginalTypeOrErr = import(T->getOriginalType());
1079
35
  if (!ToOriginalTypeOrErr)
1080
29
    return ToOriginalTypeOrErr.takeError();
1081
1082
6
  return Importer.getToContext().getDecayedType(*ToOriginalTypeOrErr);
1083
6
}
1084
1085
26
ExpectedType ASTNodeImporter::VisitComplexType(const ComplexType *T) {
1086
26
  ExpectedType ToElementTypeOrErr = import(T->getElementType());
1087
26
  if (!ToElementTypeOrErr)
1088
0
    return ToElementTypeOrErr.takeError();
1089
1090
26
  return Importer.getToContext().getComplexType(*ToElementTypeOrErr);
1091
26
}
1092
1093
81.3k
ExpectedType ASTNodeImporter::VisitPointerType(const PointerType *T) {
1094
81.3k
  ExpectedType ToPointeeTypeOrErr = import(T->getPointeeType());
1095
81.3k
  if (!ToPointeeTypeOrErr)
1096
29
    return ToPointeeTypeOrErr.takeError();
1097
1098
81.2k
  return Importer.getToContext().getPointerType(*ToPointeeTypeOrErr);
1099
81.2k
}
1100
1101
37
ExpectedType ASTNodeImporter::VisitBlockPointerType(const BlockPointerType *T) {
1102
  // FIXME: Check for blocks support in "to" context.
1103
37
  ExpectedType ToPointeeTypeOrErr = import(T->getPointeeType());
1104
37
  if (!ToPointeeTypeOrErr)
1105
0
    return ToPointeeTypeOrErr.takeError();
1106
1107
37
  return Importer.getToContext().getBlockPointerType(*ToPointeeTypeOrErr);
1108
37
}
1109
1110
ExpectedType
1111
145k
ASTNodeImporter::VisitLValueReferenceType(const LValueReferenceType *T) {
1112
  // FIXME: Check for C++ support in "to" context.
1113
145k
  ExpectedType ToPointeeTypeOrErr = import(T->getPointeeTypeAsWritten());
1114
145k
  if (!ToPointeeTypeOrErr)
1115
0
    return ToPointeeTypeOrErr.takeError();
1116
1117
145k
  return Importer.getToContext().getLValueReferenceType(*ToPointeeTypeOrErr);
1118
145k
}
1119
1120
ExpectedType
1121
40.6k
ASTNodeImporter::VisitRValueReferenceType(const RValueReferenceType *T) {
1122
  // FIXME: Check for C++0x support in "to" context.
1123
40.6k
  ExpectedType ToPointeeTypeOrErr = import(T->getPointeeTypeAsWritten());
1124
40.6k
  if (!ToPointeeTypeOrErr)
1125
0
    return ToPointeeTypeOrErr.takeError();
1126
1127
40.6k
  return Importer.getToContext().getRValueReferenceType(*ToPointeeTypeOrErr);
1128
40.6k
}
1129
1130
ExpectedType
1131
4
ASTNodeImporter::VisitMemberPointerType(const MemberPointerType *T) {
1132
  // FIXME: Check for C++ support in "to" context.
1133
4
  ExpectedType ToPointeeTypeOrErr = import(T->getPointeeType());
1134
4
  if (!ToPointeeTypeOrErr)
1135
0
    return ToPointeeTypeOrErr.takeError();
1136
1137
4
  ExpectedType ClassTypeOrErr = import(QualType(T->getClass(), 0));
1138
4
  if (!ClassTypeOrErr)
1139
0
    return ClassTypeOrErr.takeError();
1140
1141
4
  return Importer.getToContext().getMemberPointerType(
1142
4
      *ToPointeeTypeOrErr, (*ClassTypeOrErr).getTypePtr());
1143
4
}
1144
1145
ExpectedType
1146
6.73k
ASTNodeImporter::VisitConstantArrayType(const ConstantArrayType *T) {
1147
6.73k
  Error Err = Error::success();
1148
6.73k
  auto ToElementType = importChecked(Err, T->getElementType());
1149
6.73k
  auto ToSizeExpr = importChecked(Err, T->getSizeExpr());
1150
6.73k
  if (Err)
1151
0
    return std::move(Err);
1152
1153
6.73k
  return Importer.getToContext().getConstantArrayType(
1154
6.73k
      ToElementType, T->getSize(), ToSizeExpr, T->getSizeModifier(),
1155
6.73k
      T->getIndexTypeCVRQualifiers());
1156
6.73k
}
1157
1158
ExpectedType
1159
434
ASTNodeImporter::VisitIncompleteArrayType(const IncompleteArrayType *T) {
1160
434
  ExpectedType ToElementTypeOrErr = import(T->getElementType());
1161
434
  if (!ToElementTypeOrErr)
1162
29
    return ToElementTypeOrErr.takeError();
1163
1164
405
  return Importer.getToContext().getIncompleteArrayType(*ToElementTypeOrErr,
1165
405
                                                        T->getSizeModifier(),
1166
405
                                                T->getIndexTypeCVRQualifiers());
1167
405
}
1168
1169
ExpectedType
1170
432
ASTNodeImporter::VisitVariableArrayType(const VariableArrayType *T) {
1171
432
  Error Err = Error::success();
1172
432
  QualType ToElementType = importChecked(Err, T->getElementType());
1173
432
  Expr *ToSizeExpr = importChecked(Err, T->getSizeExpr());
1174
432
  SourceRange ToBracketsRange = importChecked(Err, T->getBracketsRange());
1175
432
  if (Err)
1176
0
    return std::move(Err);
1177
432
  return Importer.getToContext().getVariableArrayType(
1178
432
      ToElementType, ToSizeExpr, T->getSizeModifier(),
1179
432
      T->getIndexTypeCVRQualifiers(), ToBracketsRange);
1180
432
}
1181
1182
ExpectedType ASTNodeImporter::VisitDependentSizedArrayType(
1183
723
    const DependentSizedArrayType *T) {
1184
723
  Error Err = Error::success();
1185
723
  QualType ToElementType = importChecked(Err, T->getElementType());
1186
723
  Expr *ToSizeExpr = importChecked(Err, T->getSizeExpr());
1187
723
  SourceRange ToBracketsRange = importChecked(Err, T->getBracketsRange());
1188
723
  if (Err)
1189
0
    return std::move(Err);
1190
  // SizeExpr may be null if size is not specified directly.
1191
  // For example, 'int a[]'.
1192
1193
723
  return Importer.getToContext().getDependentSizedArrayType(
1194
723
      ToElementType, ToSizeExpr, T->getSizeModifier(),
1195
723
      T->getIndexTypeCVRQualifiers(), ToBracketsRange);
1196
723
}
1197
1198
1
ExpectedType ASTNodeImporter::VisitVectorType(const VectorType *T) {
1199
1
  ExpectedType ToElementTypeOrErr = import(T->getElementType());
1200
1
  if (!ToElementTypeOrErr)
1201
0
    return ToElementTypeOrErr.takeError();
1202
1203
1
  return Importer.getToContext().getVectorType(*ToElementTypeOrErr,
1204
1
                                               T->getNumElements(),
1205
1
                                               T->getVectorKind());
1206
1
}
1207
1208
13
ExpectedType ASTNodeImporter::VisitExtVectorType(const ExtVectorType *T) {
1209
13
  ExpectedType ToElementTypeOrErr = import(T->getElementType());
1210
13
  if (!ToElementTypeOrErr)
1211
0
    return ToElementTypeOrErr.takeError();
1212
1213
13
  return Importer.getToContext().getExtVectorType(*ToElementTypeOrErr,
1214
13
                                                  T->getNumElements());
1215
13
}
1216
1217
ExpectedType
1218
83
ASTNodeImporter::VisitFunctionNoProtoType(const FunctionNoProtoType *T) {
1219
  // FIXME: What happens if we're importing a function without a prototype
1220
  // into C++? Should we make it variadic?
1221
83
  ExpectedType ToReturnTypeOrErr = import(T->getReturnType());
1222
83
  if (!ToReturnTypeOrErr)
1223
0
    return ToReturnTypeOrErr.takeError();
1224
1225
83
  return Importer.getToContext().getFunctionNoProtoType(*ToReturnTypeOrErr,
1226
83
                                                        T->getExtInfo());
1227
83
}
1228
1229
ExpectedType
1230
373k
ASTNodeImporter::VisitFunctionProtoType(const FunctionProtoType *T) {
1231
373k
  ExpectedType ToReturnTypeOrErr = import(T->getReturnType());
1232
373k
  if (!ToReturnTypeOrErr)
1233
0
    return ToReturnTypeOrErr.takeError();
1234
1235
  // Import argument types
1236
373k
  SmallVector<QualType, 4> ArgTypes;
1237
585k
  for (const auto &A : T->param_types()) {
1238
585k
    ExpectedType TyOrErr = import(A);
1239
585k
    if (!TyOrErr)
1240
13
      return TyOrErr.takeError();
1241
585k
    ArgTypes.push_back(*TyOrErr);
1242
585k
  }
1243
1244
  // Import exception types
1245
373k
  SmallVector<QualType, 4> ExceptionTypes;
1246
0
  for (const auto &E : T->exceptions()) {
1247
0
    ExpectedType TyOrErr = import(E);
1248
0
    if (!TyOrErr)
1249
0
      return TyOrErr.takeError();
1250
0
    ExceptionTypes.push_back(*TyOrErr);
1251
0
  }
1252
1253
373k
  FunctionProtoType::ExtProtoInfo FromEPI = T->getExtProtoInfo();
1254
373k
  Error Err = Error::success();
1255
373k
  FunctionProtoType::ExtProtoInfo ToEPI;
1256
373k
  ToEPI.ExtInfo = FromEPI.ExtInfo;
1257
373k
  ToEPI.Variadic = FromEPI.Variadic;
1258
373k
  ToEPI.HasTrailingReturn = FromEPI.HasTrailingReturn;
1259
373k
  ToEPI.TypeQuals = FromEPI.TypeQuals;
1260
373k
  ToEPI.RefQualifier = FromEPI.RefQualifier;
1261
373k
  ToEPI.ExceptionSpec.Type = FromEPI.ExceptionSpec.Type;
1262
373k
  ToEPI.ExceptionSpec.NoexceptExpr =
1263
373k
      importChecked(Err, FromEPI.ExceptionSpec.NoexceptExpr);
1264
373k
  ToEPI.ExceptionSpec.SourceDecl =
1265
373k
      importChecked(Err, FromEPI.ExceptionSpec.SourceDecl);
1266
373k
  ToEPI.ExceptionSpec.SourceTemplate =
1267
373k
      importChecked(Err, FromEPI.ExceptionSpec.SourceTemplate);
1268
373k
  ToEPI.ExceptionSpec.Exceptions = ExceptionTypes;
1269
1270
373k
  if (Err)
1271
0
    return std::move(Err);
1272
1273
373k
  return Importer.getToContext().getFunctionType(
1274
373k
      *ToReturnTypeOrErr, ArgTypes, ToEPI);
1275
373k
}
1276
1277
ExpectedType ASTNodeImporter::VisitUnresolvedUsingType(
1278
232
    const UnresolvedUsingType *T) {
1279
232
  Error Err = Error::success();
1280
232
  auto ToD = importChecked(Err, T->getDecl());
1281
232
  auto ToPrevD = importChecked(Err, T->getDecl()->getPreviousDecl());
1282
232
  if (Err)
1283
0
    return std::move(Err);
1284
1285
232
  return Importer.getToContext().getTypeDeclType(
1286
232
      ToD, cast_or_null<TypeDecl>(ToPrevD));
1287
232
}
1288
1289
1.21k
ExpectedType ASTNodeImporter::VisitParenType(const ParenType *T) {
1290
1.21k
  ExpectedType ToInnerTypeOrErr = import(T->getInnerType());
1291
1.21k
  if (!ToInnerTypeOrErr)
1292
0
    return ToInnerTypeOrErr.takeError();
1293
1294
1.21k
  return Importer.getToContext().getParenType(*ToInnerTypeOrErr);
1295
1.21k
}
1296
1297
110k
ExpectedType ASTNodeImporter::VisitTypedefType(const TypedefType *T) {
1298
110k
  Expected<TypedefNameDecl *> ToDeclOrErr = import(T->getDecl());
1299
110k
  if (!ToDeclOrErr)
1300
0
    return ToDeclOrErr.takeError();
1301
1302
110k
  return Importer.getToContext().getTypeDeclType(*ToDeclOrErr);
1303
110k
}
1304
1305
3
ExpectedType ASTNodeImporter::VisitTypeOfExprType(const TypeOfExprType *T) {
1306
3
  ExpectedExpr ToExprOrErr = import(T->getUnderlyingExpr());
1307
3
  if (!ToExprOrErr)
1308
0
    return ToExprOrErr.takeError();
1309
1310
3
  return Importer.getToContext().getTypeOfExprType(*ToExprOrErr);
1311
3
}
1312
1313
0
ExpectedType ASTNodeImporter::VisitTypeOfType(const TypeOfType *T) {
1314
0
  ExpectedType ToUnderlyingTypeOrErr = import(T->getUnderlyingType());
1315
0
  if (!ToUnderlyingTypeOrErr)
1316
0
    return ToUnderlyingTypeOrErr.takeError();
1317
1318
0
  return Importer.getToContext().getTypeOfType(*ToUnderlyingTypeOrErr);
1319
0
}
1320
1321
4.99k
ExpectedType ASTNodeImporter::VisitDecltypeType(const DecltypeType *T) {
1322
  // FIXME: Make sure that the "to" context supports C++0x!
1323
4.99k
  ExpectedExpr ToExprOrErr = import(T->getUnderlyingExpr());
1324
4.99k
  if (!ToExprOrErr)
1325
0
    return ToExprOrErr.takeError();
1326
1327
4.99k
  ExpectedType ToUnderlyingTypeOrErr = import(T->getUnderlyingType());
1328
4.99k
  if (!ToUnderlyingTypeOrErr)
1329
0
    return ToUnderlyingTypeOrErr.takeError();
1330
1331
4.99k
  return Importer.getToContext().getDecltypeType(
1332
4.99k
      *ToExprOrErr, *ToUnderlyingTypeOrErr);
1333
4.99k
}
1334
1335
ExpectedType
1336
75
ASTNodeImporter::VisitUnaryTransformType(const UnaryTransformType *T) {
1337
75
  ExpectedType ToBaseTypeOrErr = import(T->getBaseType());
1338
75
  if (!ToBaseTypeOrErr)
1339
0
    return ToBaseTypeOrErr.takeError();
1340
1341
75
  ExpectedType ToUnderlyingTypeOrErr = import(T->getUnderlyingType());
1342
75
  if (!ToUnderlyingTypeOrErr)
1343
0
    return ToUnderlyingTypeOrErr.takeError();
1344
1345
75
  return Importer.getToContext().getUnaryTransformType(
1346
75
      *ToBaseTypeOrErr, *ToUnderlyingTypeOrErr, T->getUTTKind());
1347
75
}
1348
1349
460
ExpectedType ASTNodeImporter::VisitAutoType(const AutoType *T) {
1350
  // FIXME: Make sure that the "to" context supports C++11!
1351
460
  ExpectedType ToDeducedTypeOrErr = import(T->getDeducedType());
1352
460
  if (!ToDeducedTypeOrErr)
1353
0
    return ToDeducedTypeOrErr.takeError();
1354
1355
460
  ExpectedDecl ToTypeConstraintConcept = import(T->getTypeConstraintConcept());
1356
460
  if (!ToTypeConstraintConcept)
1357
0
    return ToTypeConstraintConcept.takeError();
1358
1359
460
  SmallVector<TemplateArgument, 2> ToTemplateArgs;
1360
460
  ArrayRef<TemplateArgument> FromTemplateArgs = T->getTypeConstraintArguments();
1361
460
  if (Error Err = ImportTemplateArguments(FromTemplateArgs.data(),
1362
0
                                          FromTemplateArgs.size(),
1363
0
                                          ToTemplateArgs))
1364
0
    return std::move(Err);
1365
1366
460
  return Importer.getToContext().getAutoType(
1367
460
      *ToDeducedTypeOrErr, T->getKeyword(), /*IsDependent*/false,
1368
460
      /*IsPack=*/false, cast_or_null<ConceptDecl>(*ToTypeConstraintConcept),
1369
460
      ToTemplateArgs);
1370
460
}
1371
1372
ExpectedType ASTNodeImporter::VisitInjectedClassNameType(
1373
5.87k
    const InjectedClassNameType *T) {
1374
5.87k
  Expected<CXXRecordDecl *> ToDeclOrErr = import(T->getDecl());
1375
5.87k
  if (!ToDeclOrErr)
1376
0
    return ToDeclOrErr.takeError();
1377
1378
5.87k
  ExpectedType ToInjTypeOrErr = import(T->getInjectedSpecializationType());
1379
5.87k
  if (!ToInjTypeOrErr)
1380
0
    return ToInjTypeOrErr.takeError();
1381
1382
  // FIXME: ASTContext::getInjectedClassNameType is not suitable for AST reading
1383
  // See comments in InjectedClassNameType definition for details
1384
  // return Importer.getToContext().getInjectedClassNameType(D, InjType);
1385
5.87k
  enum {
1386
5.87k
    TypeAlignmentInBits = 4,
1387
5.87k
    TypeAlignment = 1 << TypeAlignmentInBits
1388
5.87k
  };
1389
1390
5.87k
  return QualType(new (Importer.getToContext(), TypeAlignment)
1391
5.87k
                  InjectedClassNameType(*ToDeclOrErr, *ToInjTypeOrErr), 0);
1392
5.87k
}
1393
1394
70.6k
ExpectedType ASTNodeImporter::VisitRecordType(const RecordType *T) {
1395
70.6k
  Expected<RecordDecl *> ToDeclOrErr = import(T->getDecl());
1396
70.6k
  if (!ToDeclOrErr)
1397
19
    return ToDeclOrErr.takeError();
1398
1399
70.6k
  return Importer.getToContext().getTagDeclType(*ToDeclOrErr);
1400
70.6k
}
1401
1402
2.72k
ExpectedType ASTNodeImporter::VisitEnumType(const EnumType *T) {
1403
2.72k
  Expected<EnumDecl *> ToDeclOrErr = import(T->getDecl());
1404
2.72k
  if (!ToDeclOrErr)
1405
0
    return ToDeclOrErr.takeError();
1406
1407
2.72k
  return Importer.getToContext().getTagDeclType(*ToDeclOrErr);
1408
2.72k
}
1409
1410
1.43k
ExpectedType ASTNodeImporter::VisitAttributedType(const AttributedType *T) {
1411
1.43k
  ExpectedType ToModifiedTypeOrErr = import(T->getModifiedType());
1412
1.43k
  if (!ToModifiedTypeOrErr)
1413
116
    return ToModifiedTypeOrErr.takeError();
1414
1.31k
  ExpectedType ToEquivalentTypeOrErr = import(T->getEquivalentType());
1415
1.31k
  if (!ToEquivalentTypeOrErr)
1416
0
    return ToEquivalentTypeOrErr.takeError();
1417
1418
1.31k
  return Importer.getToContext().getAttributedType(T->getAttrKind(),
1419
1.31k
      *ToModifiedTypeOrErr, *ToEquivalentTypeOrErr);
1420
1.31k
}
1421
1422
ExpectedType ASTNodeImporter::VisitTemplateTypeParmType(
1423
282k
    const TemplateTypeParmType *T) {
1424
282k
  Expected<TemplateTypeParmDecl *> ToDeclOrErr = import(T->getDecl());
1425
282k
  if (!ToDeclOrErr)
1426
0
    return ToDeclOrErr.takeError();
1427
1428
282k
  return Importer.getToContext().getTemplateTypeParmType(
1429
282k
      T->getDepth(), T->getIndex(), T->isParameterPack(), *ToDeclOrErr);
1430
282k
}
1431
1432
ExpectedType ASTNodeImporter::VisitSubstTemplateTypeParmType(
1433
78.2k
    const SubstTemplateTypeParmType *T) {
1434
78.2k
  ExpectedType ReplacedOrErr = import(QualType(T->getReplacedParameter(), 0));
1435
78.2k
  if (!ReplacedOrErr)
1436
0
    return ReplacedOrErr.takeError();
1437
78.2k
  const TemplateTypeParmType *Replaced =
1438
78.2k
      cast<TemplateTypeParmType>((*ReplacedOrErr).getTypePtr());
1439
1440
78.2k
  ExpectedType ToReplacementTypeOrErr = import(T->getReplacementType());
1441
78.2k
  if (!ToReplacementTypeOrErr)
1442
0
    return ToReplacementTypeOrErr.takeError();
1443
1444
78.2k
  return Importer.getToContext().getSubstTemplateTypeParmType(
1445
78.2k
        Replaced, (*ToReplacementTypeOrErr).getCanonicalType());
1446
78.2k
}
1447
1448
ExpectedType ASTNodeImporter::VisitTemplateSpecializationType(
1449
538k
                                       const TemplateSpecializationType *T) {
1450
538k
  auto ToTemplateOrErr = import(T->getTemplateName());
1451
538k
  if (!ToTemplateOrErr)
1452
0
    return ToTemplateOrErr.takeError();
1453
1454
538k
  SmallVector<TemplateArgument, 2> ToTemplateArgs;
1455
538k
  if (Error Err = ImportTemplateArguments(
1456
0
      T->getArgs(), T->getNumArgs(), ToTemplateArgs))
1457
0
    return std::move(Err);
1458
1459
538k
  QualType ToCanonType;
1460
538k
  if (!QualType(T, 0).isCanonical()) {
1461
448k
    QualType FromCanonType
1462
448k
      = Importer.getFromContext().getCanonicalType(QualType(T, 0));
1463
448k
    if (ExpectedType TyOrErr = import(FromCanonType))
1464
448k
      ToCanonType = *TyOrErr;
1465
0
    else
1466
0
      return TyOrErr.takeError();
1467
538k
  }
1468
538k
  return Importer.getToContext().getTemplateSpecializationType(*ToTemplateOrErr,
1469
538k
                                                               ToTemplateArgs,
1470
538k
                                                               ToCanonType);
1471
538k
}
1472
1473
57.2k
ExpectedType ASTNodeImporter::VisitElaboratedType(const ElaboratedType *T) {
1474
  // Note: the qualifier in an ElaboratedType is optional.
1475
57.2k
  auto ToQualifierOrErr = import(T->getQualifier());
1476
57.2k
  if (!ToQualifierOrErr)
1477
0
    return ToQualifierOrErr.takeError();
1478
1479
57.2k
  ExpectedType ToNamedTypeOrErr = import(T->getNamedType());
1480
57.2k
  if (!ToNamedTypeOrErr)
1481
9
    return ToNamedTypeOrErr.takeError();
1482
1483
57.2k
  Expected<TagDecl *> ToOwnedTagDeclOrErr = import(T->getOwnedTagDecl());
1484
57.2k
  if (!ToOwnedTagDeclOrErr)
1485
0
    return ToOwnedTagDeclOrErr.takeError();
1486
1487
57.2k
  return Importer.getToContext().getElaboratedType(T->getKeyword(),
1488
57.2k
                                                   *ToQualifierOrErr,
1489
57.2k
                                                   *ToNamedTypeOrErr,
1490
57.2k
                                                   *ToOwnedTagDeclOrErr);
1491
57.2k
}
1492
1493
ExpectedType
1494
17.0k
ASTNodeImporter::VisitPackExpansionType(const PackExpansionType *T) {
1495
17.0k
  ExpectedType ToPatternOrErr = import(T->getPattern());
1496
17.0k
  if (!ToPatternOrErr)
1497
0
    return ToPatternOrErr.takeError();
1498
1499
17.0k
  return Importer.getToContext().getPackExpansionType(*ToPatternOrErr,
1500
17.0k
                                                      T->getNumExpansions(),
1501
17.0k
                                                      /*ExpactPack=*/false);
1502
17.0k
}
1503
1504
ExpectedType ASTNodeImporter::VisitDependentTemplateSpecializationType(
1505
6.98k
    const DependentTemplateSpecializationType *T) {
1506
6.98k
  auto ToQualifierOrErr = import(T->getQualifier());
1507
6.98k
  if (!ToQualifierOrErr)
1508
0
    return ToQualifierOrErr.takeError();
1509
1510
6.98k
  IdentifierInfo *ToName = Importer.Import(T->getIdentifier());
1511
1512
6.98k
  SmallVector<TemplateArgument, 2> ToPack;
1513
6.98k
  ToPack.reserve(T->getNumArgs());
1514
6.98k
  if (Error Err = ImportTemplateArguments(
1515
0
      T->getArgs(), T->getNumArgs(), ToPack))
1516
0
    return std::move(Err);
1517
1518
6.98k
  return Importer.getToContext().getDependentTemplateSpecializationType(
1519
6.98k
      T->getKeyword(), *ToQualifierOrErr, ToName, ToPack);
1520
6.98k
}
1521
1522
ExpectedType
1523
98.7k
ASTNodeImporter::VisitDependentNameType(const DependentNameType *T) {
1524
98.7k
  auto ToQualifierOrErr = import(T->getQualifier());
1525
98.7k
  if (!ToQualifierOrErr)
1526
0
    return ToQualifierOrErr.takeError();
1527
1528
98.7k
  IdentifierInfo *Name = Importer.Import(T->getIdentifier());
1529
1530
98.7k
  QualType Canon;
1531
98.7k
  if (T != T->getCanonicalTypeInternal().getTypePtr()) {
1532
65.2k
    if (ExpectedType TyOrErr = import(T->getCanonicalTypeInternal()))
1533
65.2k
      Canon = (*TyOrErr).getCanonicalType();
1534
0
    else
1535
0
      return TyOrErr.takeError();
1536
98.7k
  }
1537
1538
98.7k
  return Importer.getToContext().getDependentNameType(T->getKeyword(),
1539
98.7k
                                                      *ToQualifierOrErr,
1540
98.7k
                                                      Name, Canon);
1541
98.7k
}
1542
1543
ExpectedType
1544
2.66k
ASTNodeImporter::VisitObjCInterfaceType(const ObjCInterfaceType *T) {
1545
2.66k
  Expected<ObjCInterfaceDecl *> ToDeclOrErr = import(T->getDecl());
1546
2.66k
  if (!ToDeclOrErr)
1547
0
    return ToDeclOrErr.takeError();
1548
1549
2.66k
  return Importer.getToContext().getObjCInterfaceType(*ToDeclOrErr);
1550
2.66k
}
1551
1552
381
ExpectedType ASTNodeImporter::VisitObjCObjectType(const ObjCObjectType *T) {
1553
381
  ExpectedType ToBaseTypeOrErr = import(T->getBaseType());
1554
381
  if (!ToBaseTypeOrErr)
1555
0
    return ToBaseTypeOrErr.takeError();
1556
1557
381
  SmallVector<QualType, 4> TypeArgs;
1558
72
  for (auto TypeArg : T->getTypeArgsAsWritten()) {
1559
72
    if (ExpectedType TyOrErr = import(TypeArg))
1560
60
      TypeArgs.push_back(*TyOrErr);
1561
12
    else
1562
12
      return TyOrErr.takeError();
1563
72
  }
1564
1565
369
  SmallVector<ObjCProtocolDecl *, 4> Protocols;
1566
2
  for (auto *P : T->quals()) {
1567
2
    if (Expected<ObjCProtocolDecl *> ProtocolOrErr = import(P))
1568
2
      Protocols.push_back(*ProtocolOrErr);
1569
0
    else
1570
0
      return ProtocolOrErr.takeError();
1571
1572
2
  }
1573
1574
369
  return Importer.getToContext().getObjCObjectType(*ToBaseTypeOrErr, TypeArgs,
1575
369
                                                   Protocols,
1576
369
                                                   T->isKindOfTypeAsWritten());
1577
369
}
1578
1579
ExpectedType
1580
1.63k
ASTNodeImporter::VisitObjCObjectPointerType(const ObjCObjectPointerType *T) {
1581
1.63k
  ExpectedType ToPointeeTypeOrErr = import(T->getPointeeType());
1582
1.63k
  if (!ToPointeeTypeOrErr)
1583
12
    return ToPointeeTypeOrErr.takeError();
1584
1585
1.62k
  return Importer.getToContext().getObjCObjectPointerType(*ToPointeeTypeOrErr);
1586
1.62k
}
1587
1588
//----------------------------------------------------------------------------
1589
// Import Declarations
1590
//----------------------------------------------------------------------------
1591
Error ASTNodeImporter::ImportDeclParts(
1592
    NamedDecl *D, DeclContext *&DC, DeclContext *&LexicalDC,
1593
1.30M
    DeclarationName &Name, NamedDecl *&ToD, SourceLocation &Loc) {
1594
  // Check if RecordDecl is in FunctionDecl parameters to avoid infinite loop.
1595
  // example: int struct_in_proto(struct data_t{int a;int b;} *d);
1596
  // FIXME: We could support these constructs by importing a different type of
1597
  // this parameter and by importing the original type of the parameter only
1598
  // after the FunctionDecl is created. See
1599
  // VisitFunctionDecl::UsedDifferentProtoType.
1600
1.30M
  DeclContext *OrigDC = D->getDeclContext();
1601
1.30M
  FunctionDecl *FunDecl;
1602
1.30M
  if (isa<RecordDecl>(D) && 
(FunDecl = dyn_cast<FunctionDecl>(OrigDC))118k
&&
1603
350
      FunDecl->hasBody()) {
1604
109
    auto getLeafPointeeType = [](const Type *T) {
1605
201
      while (T->isPointerType() || 
T->isArrayType()109
) {
1606
92
        T = T->getPointeeOrArrayElementType();
1607
92
      }
1608
109
      return T;
1609
109
    };
1610
109
    for (const ParmVarDecl *P : FunDecl->parameters()) {
1611
109
      const Type *LeafT =
1612
109
          getLeafPointeeType(P->getType().getCanonicalType().getTypePtr());
1613
109
      auto *RT = dyn_cast<RecordType>(LeafT);
1614
109
      if (RT && 
RT->getDecl() == D30
) {
1615
9
        Importer.FromDiag(D->getLocation(), diag::err_unsupported_ast_node)
1616
9
            << D->getDeclKindName();
1617
9
        return make_error<ImportError>(ImportError::UnsupportedConstruct);
1618
9
      }
1619
109
    }
1620
201
  }
1621
1622
  // Import the context of this declaration.
1623
1.30M
  if (Error Err = ImportDeclContext(D, DC, LexicalDC))
1624
22
    return Err;
1625
1626
  // Import the name of this declaration.
1627
1.30M
  if (Error Err = importInto(Name, D->getDeclName()))
1628
0
    return Err;
1629
1630
  // Import the location of this declaration.
1631
1.30M
  if (Error Err = importInto(Loc, D->getLocation()))
1632
0
    return Err;
1633
1634
1.30M
  ToD = cast_or_null<NamedDecl>(Importer.GetAlreadyImportedOrNull(D));
1635
1.30M
  if (ToD)
1636
10.9k
    if (Error Err = ASTNodeImporter(*this).ImportDefinitionIfNeeded(D, ToD))
1637
0
      return Err;
1638
1639
1.30M
  return Error::success();
1640
1.30M
}
1641
1642
36.2k
Error ASTNodeImporter::ImportDefinitionIfNeeded(Decl *FromD, Decl *ToD) {
1643
36.2k
  if (!FromD)
1644
6.33k
    return Error::success();
1645
1646
29.9k
  if (!ToD)
1647
19.0k
    if (Error Err = importInto(ToD, FromD))
1648
0
      return Err;
1649
1650
29.9k
  if (RecordDecl *FromRecord = dyn_cast<RecordDecl>(FromD)) {
1651
19.1k
    if (RecordDecl *ToRecord = cast<RecordDecl>(ToD)) {
1652
19.1k
      if (FromRecord->getDefinition() && 
FromRecord->isCompleteDefinition()19.0k
&&
1653
19.0k
          !ToRecord->getDefinition()) {
1654
87
        if (Error Err = ImportDefinition(FromRecord, ToRecord))
1655
0
          return Err;
1656
19.1k
      }
1657
19.1k
    }
1658
19.1k
    return Error::success();
1659
19.1k
  }
1660
1661
10.8k
  if (EnumDecl *FromEnum = dyn_cast<EnumDecl>(FromD)) {
1662
56
    if (EnumDecl *ToEnum = cast<EnumDecl>(ToD)) {
1663
56
      if (FromEnum->getDefinition() && 
!ToEnum->getDefinition()24
) {
1664
0
        if (Error Err = ImportDefinition(FromEnum, ToEnum))
1665
0
          return Err;
1666
56
      }
1667
56
    }
1668
56
    return Error::success();
1669
56
  }
1670
1671
10.7k
  return Error::success();
1672
10.7k
}
1673
1674
Error
1675
ASTNodeImporter::ImportDeclarationNameLoc(
1676
1.15M
    const DeclarationNameInfo &From, DeclarationNameInfo& To) {
1677
  // NOTE: To.Name and To.Loc are already imported.
1678
  // We only have to import To.LocInfo.
1679
1.15M
  switch (To.getName().getNameKind()) {
1680
803k
  case DeclarationName::Identifier:
1681
803k
  case DeclarationName::ObjCZeroArgSelector:
1682
803k
  case DeclarationName::ObjCOneArgSelector:
1683
803k
  case DeclarationName::ObjCMultiArgSelector:
1684
803k
  case DeclarationName::CXXUsingDirective:
1685
803k
  case DeclarationName::CXXDeductionGuideName:
1686
803k
    return Error::success();
1687
1688
241k
  case DeclarationName::CXXOperatorName: {
1689
241k
    if (auto ToRangeOrErr = import(From.getCXXOperatorNameRange()))
1690
241k
      To.setCXXOperatorNameRange(*ToRangeOrErr);
1691
0
    else
1692
0
      return ToRangeOrErr.takeError();
1693
241k
    return Error::success();
1694
241k
  }
1695
0
  case DeclarationName::CXXLiteralOperatorName: {
1696
0
    if (ExpectedSLoc LocOrErr = import(From.getCXXLiteralOperatorNameLoc()))
1697
0
      To.setCXXLiteralOperatorNameLoc(*LocOrErr);
1698
0
    else
1699
0
      return LocOrErr.takeError();
1700
0
    return Error::success();
1701
0
  }
1702
110k
  case DeclarationName::CXXConstructorName:
1703
110k
  case DeclarationName::CXXDestructorName:
1704
110k
  case DeclarationName::CXXConversionFunctionName: {
1705
110k
    if (auto ToTInfoOrErr = import(From.getNamedTypeInfo()))
1706
110k
      To.setNamedTypeInfo(*ToTInfoOrErr);
1707
0
    else
1708
0
      return ToTInfoOrErr.takeError();
1709
110k
    return Error::success();
1710
110k
  }
1711
0
  }
1712
0
  llvm_unreachable("Unknown name kind.");
1713
0
}
1714
1715
Error
1716
94.7k
ASTNodeImporter::ImportDeclContext(DeclContext *FromDC, bool ForceImport) {
1717
94.7k
  if (Importer.isMinimalImport() && 
!ForceImport93.1k
) {
1718
17.4k
    auto ToDCOrErr = Importer.ImportContext(FromDC);
1719
17.4k
    return ToDCOrErr.takeError();
1720
17.4k
  }
1721
1722
  // We use strict error handling in case of records and enums, but not
1723
  // with e.g. namespaces.
1724
  //
1725
  // FIXME Clients of the ASTImporter should be able to choose an
1726
  // appropriate error handling strategy for their needs.  For instance,
1727
  // they may not want to mark an entire namespace as erroneous merely
1728
  // because there is an ODR error with two typedefs.  As another example,
1729
  // the client may allow EnumConstantDecls with same names but with
1730
  // different values in two distinct translation units.
1731
77.3k
  bool AccumulateChildErrors = isa<TagDecl>(FromDC);
1732
1733
77.3k
  Error ChildErrors = Error::success();
1734
699k
  for (auto *From : FromDC->decls()) {
1735
699k
    ExpectedDecl ImportedOrErr = import(From);
1736
1737
    // If we are in the process of ImportDefinition(...) for a RecordDecl we
1738
    // want to make sure that we are also completing each FieldDecl. There
1739
    // are currently cases where this does not happen and this is correctness
1740
    // fix since operations such as code generation will expect this to be so.
1741
699k
    if (ImportedOrErr) {
1742
699k
      FieldDecl *FieldFrom = dyn_cast_or_null<FieldDecl>(From);
1743
699k
      Decl *ImportedDecl = *ImportedOrErr;
1744
699k
      FieldDecl *FieldTo = dyn_cast_or_null<FieldDecl>(ImportedDecl);
1745
699k
      if (FieldFrom && 
FieldTo36.4k
) {
1746
36.4k
        RecordDecl *FromRecordDecl = nullptr;
1747
36.4k
        RecordDecl *ToRecordDecl = nullptr;
1748
        // If we have a field that is an ArrayType we need to check if the array
1749
        // element is a RecordDecl and if so we need to import the defintion.
1750
36.4k
        if (FieldFrom->getType()->isArrayType()) {
1751
          // getBaseElementTypeUnsafe(...) handles multi-dimensonal arrays for us.
1752
1.75k
          FromRecordDecl = FieldFrom->getType()->getBaseElementTypeUnsafe()->getAsRecordDecl();
1753
1.75k
          ToRecordDecl = FieldTo->getType()->getBaseElementTypeUnsafe()->getAsRecordDecl();
1754
1.75k
        }
1755
1756
36.4k
        if (!FromRecordDecl || 
!ToRecordDecl9
) {
1757
36.4k
          const RecordType *RecordFrom =
1758
36.4k
              FieldFrom->getType()->getAs<RecordType>();
1759
36.4k
          const RecordType *RecordTo = FieldTo->getType()->getAs<RecordType>();
1760
1761
36.4k
          if (RecordFrom && 
RecordTo