Coverage Report

Created: 2020-02-25 14:32

/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
92
    // 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
65.9k
  getCanonicalForwardRedeclChain(Redeclarable<T>* D) {
113
65.9k
    SmallVector<Decl *, 2> Redecls;
114
67.5k
    for (auto *R : D->getFirstDecl()->redecls()) {
115
67.5k
      if (R != D->getFirstDecl())
116
1.62k
        Redecls.push_back(R);
117
67.5k
    }
118
65.9k
    Redecls.push_back(D->getFirstDecl());
119
65.9k
    std::reverse(Redecls.begin(), Redecls.end());
120
65.9k
    return Redecls;
121
65.9k
  }
llvm::SmallVector<clang::Decl*, 2u> clang::getCanonicalForwardRedeclChain<clang::FunctionDecl>(clang::Redeclarable<clang::FunctionDecl>*)
Line
Count
Source
112
60.3k
  getCanonicalForwardRedeclChain(Redeclarable<T>* D) {
113
60.3k
    SmallVector<Decl *, 2> Redecls;
114
61.2k
    for (auto *R : D->getFirstDecl()->redecls()) {
115
61.2k
      if (R != D->getFirstDecl())
116
995
        Redecls.push_back(R);
117
61.2k
    }
118
60.3k
    Redecls.push_back(D->getFirstDecl());
119
60.3k
    std::reverse(Redecls.begin(), Redecls.end());
120
60.3k
    return Redecls;
121
60.3k
  }
llvm::SmallVector<clang::Decl*, 2u> clang::getCanonicalForwardRedeclChain<clang::VarDecl>(clang::Redeclarable<clang::VarDecl>*)
Line
Count
Source
112
1.38k
  getCanonicalForwardRedeclChain(Redeclarable<T>* D) {
113
1.38k
    SmallVector<Decl *, 2> Redecls;
114
1.56k
    for (auto *R : D->getFirstDecl()->redecls()) {
115
1.56k
      if (R != D->getFirstDecl())
116
182
        Redecls.push_back(R);
117
1.56k
    }
118
1.38k
    Redecls.push_back(D->getFirstDecl());
119
1.38k
    std::reverse(Redecls.begin(), Redecls.end());
120
1.38k
    return Redecls;
121
1.38k
  }
llvm::SmallVector<clang::Decl*, 2u> clang::getCanonicalForwardRedeclChain<clang::TagDecl>(clang::Redeclarable<clang::TagDecl>*)
Line
Count
Source
112
4.22k
  getCanonicalForwardRedeclChain(Redeclarable<T>* D) {
113
4.22k
    SmallVector<Decl *, 2> Redecls;
114
4.66k
    for (auto *R : D->getFirstDecl()->redecls()) {
115
4.66k
      if (R != D->getFirstDecl())
116
444
        Redecls.push_back(R);
117
4.66k
    }
118
4.22k
    Redecls.push_back(D->getFirstDecl());
119
4.22k
    std::reverse(Redecls.begin(), Redecls.end());
120
4.22k
    return Redecls;
121
4.22k
  }
122
123
65.9k
  SmallVector<Decl*, 2> getCanonicalForwardRedeclChain(Decl* D) {
124
65.9k
    if (auto *FD = dyn_cast<FunctionDecl>(D))
125
60.3k
      return getCanonicalForwardRedeclChain<FunctionDecl>(FD);
126
5.61k
    if (auto *VD = dyn_cast<VarDecl>(D))
127
1.38k
      return getCanonicalForwardRedeclChain<VarDecl>(VD);
128
4.22k
    if (auto *TD = dyn_cast<TagDecl>(D))
129
4.22k
      return getCanonicalForwardRedeclChain<TagDecl>(TD);
130
0
    llvm_unreachable("Bad declaration kind");
131
0
  }
132
133
409k
  void updateFlags(const Decl *From, Decl *To) {
134
409k
    // Check if some flags or attrs are new in 'From' and copy into 'To'.
135
409k
    // FIXME: Other flags or attrs?
136
409k
    if (From->isUsed(false) && 
!To->isUsed(false)1.93k
)
137
73
      To->setIsUsed();
138
409k
  }
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
260k
    LLVM_NODISCARD Error importInto(ImportT &To, const ImportT &From) {
148
260k
      return Importer.importInto(To, From);
149
260k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::SourceLocation>(clang::SourceLocation&, clang::SourceLocation const&)
Line
Count
Source
147
130k
    LLVM_NODISCARD Error importInto(ImportT &To, const ImportT &From) {
148
130k
      return Importer.importInto(To, From);
149
130k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::DeclarationName>(clang::DeclarationName&, clang::DeclarationName const&)
Line
Count
Source
147
130k
    LLVM_NODISCARD Error importInto(ImportT &To, const ImportT &From) {
148
130k
      return Importer.importInto(To, From);
149
130k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::QualType>(clang::QualType&, clang::QualType const&)
Line
Count
Source
147
24
    LLVM_NODISCARD Error importInto(ImportT &To, const ImportT &From) {
148
24
      return Importer.importInto(To, From);
149
24
    }
150
151
    // Use this to import pointers of specific type.
152
    template <typename ImportT>
153
24.4k
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
24.4k
      auto ToOrErr = Importer.Import(From);
155
24.4k
      if (ToOrErr)
156
24.4k
        To = cast_or_null<ImportT>(*ToOrErr);
157
24.4k
      return ToOrErr.takeError();
158
24.4k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::FunctionTemplateDecl>(clang::FunctionTemplateDecl*&, clang::FunctionTemplateDecl*)
Line
Count
Source
153
500
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
500
      auto ToOrErr = Importer.Import(From);
155
500
      if (ToOrErr)
156
500
        To = cast_or_null<ImportT>(*ToOrErr);
157
500
      return ToOrErr.takeError();
158
500
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::Decl>(clang::Decl*&, clang::Decl*)
Line
Count
Source
153
1.97k
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
1.97k
      auto ToOrErr = Importer.Import(From);
155
1.97k
      if (ToOrErr)
156
1.97k
        To = cast_or_null<ImportT>(*ToOrErr);
157
1.97k
      return ToOrErr.takeError();
158
1.97k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::ClassTemplateDecl>(clang::ClassTemplateDecl*&, clang::ClassTemplateDecl*)
Line
Count
Source
153
10.8k
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
10.8k
      auto ToOrErr = Importer.Import(From);
155
10.8k
      if (ToOrErr)
156
10.8k
        To = cast_or_null<ImportT>(*ToOrErr);
157
10.8k
      return ToOrErr.takeError();
158
10.8k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::NamedDecl>(clang::NamedDecl*&, clang::NamedDecl*)
Line
Count
Source
153
78
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
78
      auto ToOrErr = Importer.Import(From);
155
78
      if (ToOrErr)
156
78
        To = cast_or_null<ImportT>(*ToOrErr);
157
78
      return ToOrErr.takeError();
158
78
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::ObjCInterfaceDecl>(clang::ObjCInterfaceDecl*&, clang::ObjCInterfaceDecl*)
Line
Count
Source
153
1.54k
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
1.54k
      auto ToOrErr = Importer.Import(From);
155
1.54k
      if (ToOrErr)
156
1.54k
        To = cast_or_null<ImportT>(*ToOrErr);
157
1.54k
      return ToOrErr.takeError();
158
1.54k
    }
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
8.47k
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
8.47k
      auto ToOrErr = Importer.Import(From);
155
8.47k
      if (ToOrErr)
156
8.47k
        To = cast_or_null<ImportT>(*ToOrErr);
157
8.47k
      return ToOrErr.takeError();
158
8.47k
    }
llvm::Error clang::ASTNodeImporter::importInto<clang::VarDecl>(clang::VarDecl*&, clang::VarDecl*)
Line
Count
Source
153
154
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
154
      auto ToOrErr = Importer.Import(From);
155
154
      if (ToOrErr)
156
154
        To = cast_or_null<ImportT>(*ToOrErr);
157
154
      return ToOrErr.takeError();
158
154
    }
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
891
    LLVM_NODISCARD Error importInto(ImportT *&To, ImportT *From) {
154
891
      auto ToOrErr = Importer.Import(From);
155
891
      if (ToOrErr)
156
891
        To = cast_or_null<ImportT>(*ToOrErr);
157
891
      return ToOrErr.takeError();
158
891
    }
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
587k
    Expected<T *> import(T *From) {
164
587k
      auto ToOrErr = Importer.Import(From);
165
587k
      if (!ToOrErr)
166
145
        return ToOrErr.takeError();
167
587k
      return cast_or_null<T>(*ToOrErr);
168
587k
    }
llvm::Expected<clang::Expr*> clang::ASTNodeImporter::import<clang::Expr>(clang::Expr*)
Line
Count
Source
163
137k
    Expected<T *> import(T *From) {
164
137k
      auto ToOrErr = Importer.Import(From);
165
137k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
137k
      return cast_or_null<T>(*ToOrErr);
168
137k
    }
llvm::Expected<clang::ValueDecl*> clang::ASTNodeImporter::import<clang::ValueDecl>(clang::ValueDecl*)
Line
Count
Source
163
899
    Expected<T *> import(T *From) {
164
899
      auto ToOrErr = Importer.Import(From);
165
899
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
899
      return cast_or_null<T>(*ToOrErr);
168
899
    }
llvm::Expected<clang::TypeSourceInfo*> clang::ASTNodeImporter::import<clang::TypeSourceInfo>(clang::TypeSourceInfo*)
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::Decl*> clang::ASTNodeImporter::import<clang::Decl>(clang::Decl*)
Line
Count
Source
163
51.1k
    Expected<T *> import(T *From) {
164
51.1k
      auto ToOrErr = Importer.Import(From);
165
51.1k
      if (!ToOrErr)
166
61
        return ToOrErr.takeError();
167
51.1k
      return cast_or_null<T>(*ToOrErr);
168
51.1k
    }
llvm::Expected<clang::VarDecl*> clang::ASTNodeImporter::import<clang::VarDecl>(clang::VarDecl*)
Line
Count
Source
163
412
    Expected<T *> import(T *From) {
164
412
      auto ToOrErr = Importer.Import(From);
165
412
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
412
      return cast_or_null<T>(*ToOrErr);
168
412
    }
llvm::Expected<clang::UnresolvedUsingTypenameDecl*> clang::ASTNodeImporter::import<clang::UnresolvedUsingTypenameDecl>(clang::UnresolvedUsingTypenameDecl*)
Line
Count
Source
163
1
    Expected<T *> import(T *From) {
164
1
      auto ToOrErr = Importer.Import(From);
165
1
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
1
      return cast_or_null<T>(*ToOrErr);
168
1
    }
llvm::Expected<clang::TypedefNameDecl*> clang::ASTNodeImporter::import<clang::TypedefNameDecl>(clang::TypedefNameDecl*)
Line
Count
Source
163
17.0k
    Expected<T *> import(T *From) {
164
17.0k
      auto ToOrErr = Importer.Import(From);
165
17.0k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
17.0k
      return cast_or_null<T>(*ToOrErr);
168
17.0k
    }
llvm::Expected<clang::ConceptDecl*> clang::ASTNodeImporter::import<clang::ConceptDecl>(clang::ConceptDecl*)
Line
Count
Source
163
198
    Expected<T *> import(T *From) {
164
198
      auto ToOrErr = Importer.Import(From);
165
198
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
198
      return cast_or_null<T>(*ToOrErr);
168
198
    }
llvm::Expected<clang::CXXRecordDecl*> clang::ASTNodeImporter::import<clang::CXXRecordDecl>(clang::CXXRecordDecl*)
Line
Count
Source
163
87
    Expected<T *> import(T *From) {
164
87
      auto ToOrErr = Importer.Import(From);
165
87
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
87
      return cast_or_null<T>(*ToOrErr);
168
87
    }
llvm::Expected<clang::RecordDecl*> clang::ASTNodeImporter::import<clang::RecordDecl>(clang::RecordDecl*)
Line
Count
Source
163
14.4k
    Expected<T *> import(T *From) {
164
14.4k
      auto ToOrErr = Importer.Import(From);
165
14.4k
      if (!ToOrErr)
166
19
        return ToOrErr.takeError();
167
14.4k
      return cast_or_null<T>(*ToOrErr);
168
14.4k
    }
llvm::Expected<clang::EnumDecl*> clang::ASTNodeImporter::import<clang::EnumDecl>(clang::EnumDecl*)
Line
Count
Source
163
241
    Expected<T *> import(T *From) {
164
241
      auto ToOrErr = Importer.Import(From);
165
241
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
241
      return cast_or_null<T>(*ToOrErr);
168
241
    }
llvm::Expected<clang::TemplateTypeParmDecl*> clang::ASTNodeImporter::import<clang::TemplateTypeParmDecl>(clang::TemplateTypeParmDecl*)
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::NestedNameSpecifier*> clang::ASTNodeImporter::import<clang::NestedNameSpecifier>(clang::NestedNameSpecifier*)
Line
Count
Source
163
337
    Expected<T *> import(T *From) {
164
337
      auto ToOrErr = Importer.Import(From);
165
337
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
337
      return cast_or_null<T>(*ToOrErr);
168
337
    }
llvm::Expected<clang::TagDecl*> clang::ASTNodeImporter::import<clang::TagDecl>(clang::TagDecl*)
Line
Count
Source
163
316
    Expected<T *> import(T *From) {
164
316
      auto ToOrErr = Importer.Import(From);
165
316
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
316
      return cast_or_null<T>(*ToOrErr);
168
316
    }
llvm::Expected<clang::ObjCInterfaceDecl*> clang::ASTNodeImporter::import<clang::ObjCInterfaceDecl>(clang::ObjCInterfaceDecl*)
Line
Count
Source
163
2.17k
    Expected<T *> import(T *From) {
164
2.17k
      auto ToOrErr = Importer.Import(From);
165
2.17k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
2.17k
      return cast_or_null<T>(*ToOrErr);
168
2.17k
    }
llvm::Expected<clang::ObjCProtocolDecl*> clang::ASTNodeImporter::import<clang::ObjCProtocolDecl>(clang::ObjCProtocolDecl*)
Line
Count
Source
163
481
    Expected<T *> import(T *From) {
164
481
      auto ToOrErr = Importer.Import(From);
165
481
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
481
      return cast_or_null<T>(*ToOrErr);
168
481
    }
llvm::Expected<clang::CXXMethodDecl*> clang::ASTNodeImporter::import<clang::CXXMethodDecl>(clang::CXXMethodDecl*)
Line
Count
Source
163
3.16k
    Expected<T *> import(T *From) {
164
3.16k
      auto ToOrErr = Importer.Import(From);
165
3.16k
      if (!ToOrErr)
166
4
        return ToOrErr.takeError();
167
3.15k
      return cast_or_null<T>(*ToOrErr);
168
3.15k
    }
llvm::Expected<clang::Attr*> clang::ASTNodeImporter::import<clang::Attr>(clang::Attr*)
Line
Count
Source
163
46.8k
    Expected<T *> import(T *From) {
164
46.8k
      auto ToOrErr = Importer.Import(From);
165
46.8k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
46.8k
      return cast_or_null<T>(*ToOrErr);
168
46.8k
    }
llvm::Expected<clang::NamespaceDecl*> clang::ASTNodeImporter::import<clang::NamespaceDecl>(clang::NamespaceDecl*)
Line
Count
Source
163
20
    Expected<T *> import(T *From) {
164
20
      auto ToOrErr = Importer.Import(From);
165
20
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
20
      return cast_or_null<T>(*ToOrErr);
168
20
    }
llvm::Expected<clang::TypeAliasDecl*> clang::ASTNodeImporter::import<clang::TypeAliasDecl>(clang::TypeAliasDecl*)
Line
Count
Source
163
20
    Expected<T *> import(T *From) {
164
20
      auto ToOrErr = Importer.Import(From);
165
20
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
20
      return cast_or_null<T>(*ToOrErr);
168
20
    }
llvm::Expected<clang::LabelStmt*> clang::ASTNodeImporter::import<clang::LabelStmt>(clang::LabelStmt*)
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::FunctionDecl*> clang::ASTNodeImporter::import<clang::FunctionDecl>(clang::FunctionDecl*)
Line
Count
Source
163
70.2k
    Expected<T *> import(T *From) {
164
70.2k
      auto ToOrErr = Importer.Import(From);
165
70.2k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
70.2k
      return cast_or_null<T>(*ToOrErr);
168
70.2k
    }
llvm::Expected<clang::FunctionTemplateDecl*> clang::ASTNodeImporter::import<clang::FunctionTemplateDecl>(clang::FunctionTemplateDecl*)
Line
Count
Source
163
448
    Expected<T *> import(T *From) {
164
448
      auto ToOrErr = Importer.Import(From);
165
448
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
448
      return cast_or_null<T>(*ToOrErr);
168
448
    }
llvm::Expected<clang::Stmt*> clang::ASTNodeImporter::import<clang::Stmt>(clang::Stmt*)
Line
Count
Source
163
2.52k
    Expected<T *> import(T *From) {
164
2.52k
      auto ToOrErr = Importer.Import(From);
165
2.52k
      if (!ToOrErr)
166
56
        return ToOrErr.takeError();
167
2.46k
      return cast_or_null<T>(*ToOrErr);
168
2.46k
    }
llvm::Expected<clang::ParmVarDecl*> clang::ASTNodeImporter::import<clang::ParmVarDecl>(clang::ParmVarDecl*)
Line
Count
Source
163
54.2k
    Expected<T *> import(T *From) {
164
54.2k
      auto ToOrErr = Importer.Import(From);
165
54.2k
      if (!ToOrErr)
166
5
        return ToOrErr.takeError();
167
54.2k
      return cast_or_null<T>(*ToOrErr);
168
54.2k
    }
llvm::Expected<clang::CXXCtorInitializer*> clang::ASTNodeImporter::import<clang::CXXCtorInitializer>(clang::CXXCtorInitializer*)
Line
Count
Source
163
114
    Expected<T *> import(T *From) {
164
114
      auto ToOrErr = Importer.Import(From);
165
114
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
114
      return cast_or_null<T>(*ToOrErr);
168
114
    }
llvm::Expected<clang::NamedDecl*> clang::ASTNodeImporter::import<clang::NamedDecl>(clang::NamedDecl*)
Line
Count
Source
163
16.5k
    Expected<T *> import(T *From) {
164
16.5k
      auto ToOrErr = Importer.Import(From);
165
16.5k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
16.5k
      return cast_or_null<T>(*ToOrErr);
168
16.5k
    }
llvm::Expected<clang::VarTemplateDecl*> clang::ASTNodeImporter::import<clang::VarTemplateDecl>(clang::VarTemplateDecl*)
Line
Count
Source
163
87
    Expected<T *> import(T *From) {
164
87
      auto ToOrErr = Importer.Import(From);
165
87
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
87
      return cast_or_null<T>(*ToOrErr);
168
87
    }
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
15
    Expected<T *> import(T *From) {
164
15
      auto ToOrErr = Importer.Import(From);
165
15
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
15
      return cast_or_null<T>(*ToOrErr);
168
15
    }
llvm::Expected<clang::UsingDecl*> clang::ASTNodeImporter::import<clang::UsingDecl>(clang::UsingDecl*)
Line
Count
Source
163
15
    Expected<T *> import(T *From) {
164
15
      auto ToOrErr = Importer.Import(From);
165
15
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
15
      return cast_or_null<T>(*ToOrErr);
168
15
    }
llvm::Expected<clang::ObjCCategoryDecl*> clang::ASTNodeImporter::import<clang::ObjCCategoryDecl>(clang::ObjCCategoryDecl*)
Line
Count
Source
163
1.48k
    Expected<T *> import(T *From) {
164
1.48k
      auto ToOrErr = Importer.Import(From);
165
1.48k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
1.48k
      return cast_or_null<T>(*ToOrErr);
168
1.48k
    }
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
199
    Expected<T *> import(T *From) {
164
199
      auto ToOrErr = Importer.Import(From);
165
199
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
199
      return cast_or_null<T>(*ToOrErr);
168
199
    }
llvm::Expected<clang::ObjCMethodDecl*> clang::ASTNodeImporter::import<clang::ObjCMethodDecl>(clang::ObjCMethodDecl*)
Line
Count
Source
163
1.23k
    Expected<T *> import(T *From) {
164
1.23k
      auto ToOrErr = Importer.Import(From);
165
1.23k
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
1.23k
      return cast_or_null<T>(*ToOrErr);
168
1.23k
    }
llvm::Expected<clang::ObjCIvarDecl*> clang::ASTNodeImporter::import<clang::ObjCIvarDecl>(clang::ObjCIvarDecl*)
Line
Count
Source
163
616
    Expected<T *> import(T *From) {
164
616
      auto ToOrErr = Importer.Import(From);
165
616
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
616
      return cast_or_null<T>(*ToOrErr);
168
616
    }
llvm::Expected<clang::FieldDecl*> clang::ASTNodeImporter::import<clang::FieldDecl>(clang::FieldDecl*)
Line
Count
Source
163
59
    Expected<T *> import(T *From) {
164
59
      auto ToOrErr = Importer.Import(From);
165
59
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
59
      return cast_or_null<T>(*ToOrErr);
168
59
    }
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
28
    Expected<T *> import(T *From) {
164
28
      auto ToOrErr = Importer.Import(From);
165
28
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
28
      return cast_or_null<T>(*ToOrErr);
168
28
    }
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
20
    Expected<T *> import(T *From) {
164
20
      auto ToOrErr = Importer.Import(From);
165
20
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
20
      return cast_or_null<T>(*ToOrErr);
168
20
    }
llvm::Expected<clang::SwitchCase*> clang::ASTNodeImporter::import<clang::SwitchCase>(clang::SwitchCase*)
Line
Count
Source
163
24
    Expected<T *> import(T *From) {
164
24
      auto ToOrErr = Importer.Import(From);
165
24
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
24
      return cast_or_null<T>(*ToOrErr);
168
24
    }
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
32
    Expected<T *> import(T *From) {
164
32
      auto ToOrErr = Importer.Import(From);
165
32
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
32
      return cast_or_null<T>(*ToOrErr);
168
32
    }
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
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::CXXBaseSpecifier*> clang::ASTNodeImporter::import<clang::CXXBaseSpecifier>(clang::CXXBaseSpecifier*)
Line
Count
Source
163
8
    Expected<T *> import(T *From) {
164
8
      auto ToOrErr = Importer.Import(From);
165
8
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
8
      return cast_or_null<T>(*ToOrErr);
168
8
    }
llvm::Expected<clang::CXXDestructorDecl*> clang::ASTNodeImporter::import<clang::CXXDestructorDecl>(clang::CXXDestructorDecl*)
Line
Count
Source
163
4
    Expected<T *> import(T *From) {
164
4
      auto ToOrErr = Importer.Import(From);
165
4
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
4
      return cast_or_null<T>(*ToOrErr);
168
4
    }
llvm::Expected<clang::CXXConstructorDecl*> clang::ASTNodeImporter::import<clang::CXXConstructorDecl>(clang::CXXConstructorDecl*)
Line
Count
Source
163
289
    Expected<T *> import(T *From) {
164
289
      auto ToOrErr = Importer.Import(From);
165
289
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
289
      return cast_or_null<T>(*ToOrErr);
168
289
    }
llvm::Expected<clang::LifetimeExtendedTemporaryDecl*> clang::ASTNodeImporter::import<clang::LifetimeExtendedTemporaryDecl>(clang::LifetimeExtendedTemporaryDecl*)
Line
Count
Source
163
83
    Expected<T *> import(T *From) {
164
83
      auto ToOrErr = Importer.Import(From);
165
83
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
83
      return cast_or_null<T>(*ToOrErr);
168
83
    }
Unexecuted instantiation: llvm::Expected<clang::BlockDecl*> clang::ASTNodeImporter::import<clang::BlockDecl>(clang::BlockDecl*)
llvm::Expected<clang::InitListExpr*> clang::ASTNodeImporter::import<clang::InitListExpr>(clang::InitListExpr*)
Line
Count
Source
163
62
    Expected<T *> import(T *From) {
164
62
      auto ToOrErr = Importer.Import(From);
165
62
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
62
      return cast_or_null<T>(*ToOrErr);
168
62
    }
llvm::Expected<clang::NonTypeTemplateParmDecl*> clang::ASTNodeImporter::import<clang::NonTypeTemplateParmDecl>(clang::NonTypeTemplateParmDecl*)
Line
Count
Source
163
5
    Expected<T *> import(T *From) {
164
5
      auto ToOrErr = Importer.Import(From);
165
5
      if (!ToOrErr)
166
0
        return ToOrErr.takeError();
167
5
      return cast_or_null<T>(*ToOrErr);
168
5
    }
169
170
    template <typename T>
171
48.5k
    Expected<T *> import(const T *From) {
172
48.5k
      return import(const_cast<T *>(From));
173
48.5k
    }
llvm::Expected<clang::Attr*> clang::ASTNodeImporter::import<clang::Attr>(clang::Attr const*)
Line
Count
Source
171
46.8k
    Expected<T *> import(const T *From) {
172
46.8k
      return import(const_cast<T *>(From));
173
46.8k
    }
llvm::Expected<clang::Expr*> clang::ASTNodeImporter::import<clang::Expr>(clang::Expr const*)
Line
Count
Source
171
1.29k
    Expected<T *> import(const T *From) {
172
1.29k
      return import(const_cast<T *>(From));
173
1.29k
    }
llvm::Expected<clang::VarDecl*> clang::ASTNodeImporter::import<clang::VarDecl>(clang::VarDecl const*)
Line
Count
Source
171
328
    Expected<T *> import(const T *From) {
172
328
      return import(const_cast<T *>(From));
173
328
    }
llvm::Expected<clang::CXXDestructorDecl*> clang::ASTNodeImporter::import<clang::CXXDestructorDecl>(clang::CXXDestructorDecl const*)
Line
Count
Source
171
4
    Expected<T *> import(const T *From) {
172
4
      return import(const_cast<T *>(From));
173
4
    }
llvm::Expected<clang::CXXMethodDecl*> clang::ASTNodeImporter::import<clang::CXXMethodDecl>(clang::CXXMethodDecl const*)
Line
Count
Source
171
149
    Expected<T *> import(const T *From) {
172
149
      return import(const_cast<T *>(From));
173
149
    }
174
175
    // Call the import function of ASTImporter for type `T`.
176
    template <typename T>
177
790k
    Expected<T> import(const T &From) {
178
790k
      return Importer.Import(From);
179
790k
    }
llvm::Expected<clang::SourceLocation> clang::ASTNodeImporter::import<clang::SourceLocation>(clang::SourceLocation const&)
Line
Count
Source
177
357k
    Expected<T> import(const T &From) {
178
357k
      return Importer.Import(From);
179
357k
    }
llvm::Expected<clang::QualType> clang::ASTNodeImporter::import<clang::QualType>(clang::QualType const&)
Line
Count
Source
177
264k
    Expected<T> import(const T &From) {
178
264k
      return Importer.Import(From);
179
264k
    }
llvm::Expected<clang::TemplateName> clang::ASTNodeImporter::import<clang::TemplateName>(clang::TemplateName const&)
Line
Count
Source
177
382
    Expected<T> import(const T &From) {
178
382
      return Importer.Import(From);
179
382
    }
llvm::Expected<clang::NestedNameSpecifierLoc> clang::ASTNodeImporter::import<clang::NestedNameSpecifierLoc>(clang::NestedNameSpecifierLoc const&)
Line
Count
Source
177
79.6k
    Expected<T> import(const T &From) {
178
79.6k
      return Importer.Import(From);
179
79.6k
    }
llvm::Expected<clang::SourceRange> clang::ASTNodeImporter::import<clang::SourceRange>(clang::SourceRange const&)
Line
Count
Source
177
32.0k
    Expected<T> import(const T &From) {
178
32.0k
      return Importer.Import(From);
179
32.0k
    }
llvm::Expected<clang::Selector> clang::ASTNodeImporter::import<clang::Selector>(clang::Selector const&)
Line
Count
Source
177
1.23k
    Expected<T> import(const T &From) {
178
1.23k
      return Importer.Import(From);
179
1.23k
    }
llvm::Expected<clang::DeclarationName> clang::ASTNodeImporter::import<clang::DeclarationName>(clang::DeclarationName const&)
Line
Count
Source
177
55.4k
    Expected<T> import(const T &From) {
178
55.4k
      return Importer.Import(From);
179
55.4k
    }
180
181
    // Import an Optional<T> by importing the contained T, if any.
182
    template<typename T>
183
3
    Expected<Optional<T>> import(Optional<T> From) {
184
3
      if (!From)
185
2
        return Optional<T>();
186
1
      return import(*From);
187
1
    }
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
895k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
895k
      // Don't attempt to import nodes if we hit an error earlier.
195
895k
      if (Err)
196
96
        return T{};
197
895k
      Expected<T> MaybeVal = import(From);
198
895k
      if (!MaybeVal) {
199
34
        Err = MaybeVal.takeError();
200
34
        return T{};
201
34
      }
202
895k
      return *MaybeVal;
203
895k
    }
clang::QualType clang::ASTNodeImporter::importChecked<clang::QualType>(llvm::Error&, clang::QualType const&)
Line
Count
Source
193
152k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
152k
      // Don't attempt to import nodes if we hit an error earlier.
195
152k
      if (Err)
196
0
        return T{};
197
152k
      Expected<T> MaybeVal = import(From);
198
152k
      if (!MaybeVal) {
199
34
        Err = MaybeVal.takeError();
200
34
        return T{};
201
34
      }
202
152k
      return *MaybeVal;
203
152k
    }
clang::Expr const* clang::ASTNodeImporter::importChecked<clang::Expr const*>(llvm::Error&, clang::Expr const* const&)
Line
Count
Source
193
1.28k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
1.28k
      // Don't attempt to import nodes if we hit an error earlier.
195
1.28k
      if (Err)
196
0
        return T{};
197
1.28k
      Expected<T> MaybeVal = import(From);
198
1.28k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
1.28k
      return *MaybeVal;
203
1.28k
    }
clang::Expr* clang::ASTNodeImporter::importChecked<clang::Expr*>(llvm::Error&, clang::Expr* const&)
Line
Count
Source
193
124k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
124k
      // Don't attempt to import nodes if we hit an error earlier.
195
124k
      if (Err)
196
13
        return T{};
197
124k
      Expected<T> MaybeVal = import(From);
198
124k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
124k
      return *MaybeVal;
203
124k
    }
clang::SourceRange clang::ASTNodeImporter::importChecked<clang::SourceRange>(llvm::Error&, clang::SourceRange const&)
Line
Count
Source
193
672
    template <typename T> T importChecked(Error &Err, const T &From) {
194
672
      // Don't attempt to import nodes if we hit an error earlier.
195
672
      if (Err)
196
0
        return T{};
197
672
      Expected<T> MaybeVal = import(From);
198
672
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
672
      return *MaybeVal;
203
672
    }
clang::FunctionDecl* clang::ASTNodeImporter::importChecked<clang::FunctionDecl*>(llvm::Error&, clang::FunctionDecl* const&)
Line
Count
Source
193
70.2k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
70.2k
      // Don't attempt to import nodes if we hit an error earlier.
195
70.2k
      if (Err)
196
0
        return T{};
197
70.2k
      Expected<T> MaybeVal = import(From);
198
70.2k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
70.2k
      return *MaybeVal;
203
70.2k
    }
clang::UnresolvedUsingTypenameDecl* clang::ASTNodeImporter::importChecked<clang::UnresolvedUsingTypenameDecl*>(llvm::Error&, clang::UnresolvedUsingTypenameDecl* const&)
Line
Count
Source
193
1
    template <typename T> T importChecked(Error &Err, const T &From) {
194
1
      // Don't attempt to import nodes if we hit an error earlier.
195
1
      if (Err)
196
0
        return T{};
197
1
      Expected<T> MaybeVal = import(From);
198
1
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
1
      return *MaybeVal;
203
1
    }
clang::Decl* clang::ASTNodeImporter::importChecked<clang::Decl*>(llvm::Error&, clang::Decl* const&)
Line
Count
Source
193
1
    template <typename T> T importChecked(Error &Err, const T &From) {
194
1
      // Don't attempt to import nodes if we hit an error earlier.
195
1
      if (Err)
196
0
        return T{};
197
1
      Expected<T> MaybeVal = import(From);
198
1
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
1
      return *MaybeVal;
203
1
    }
clang::SourceLocation clang::ASTNodeImporter::importChecked<clang::SourceLocation>(llvm::Error&, clang::SourceLocation const&)
Line
Count
Source
193
275k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
275k
      // Don't attempt to import nodes if we hit an error earlier.
195
275k
      if (Err)
196
36
        return T{};
197
275k
      Expected<T> MaybeVal = import(From);
198
275k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
275k
      return *MaybeVal;
203
275k
    }
clang::StringLiteral* clang::ASTNodeImporter::importChecked<clang::StringLiteral*>(llvm::Error&, clang::StringLiteral* const&)
Line
Count
Source
193
16
    template <typename T> T importChecked(Error &Err, const T &From) {
194
16
      // Don't attempt to import nodes if we hit an error earlier.
195
16
      if (Err)
196
0
        return T{};
197
16
      Expected<T> MaybeVal = import(From);
198
16
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
16
      return *MaybeVal;
203
16
    }
clang::NestedNameSpecifierLoc clang::ASTNodeImporter::importChecked<clang::NestedNameSpecifierLoc>(llvm::Error&, clang::NestedNameSpecifierLoc const&)
Line
Count
Source
193
59.4k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
59.4k
      // Don't attempt to import nodes if we hit an error earlier.
195
59.4k
      if (Err)
196
13
        return T{};
197
59.4k
      Expected<T> MaybeVal = import(From);
198
59.4k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
59.4k
      return *MaybeVal;
203
59.4k
    }
clang::NamespaceDecl* clang::ASTNodeImporter::importChecked<clang::NamespaceDecl*>(llvm::Error&, clang::NamespaceDecl* const&)
Line
Count
Source
193
20
    template <typename T> T importChecked(Error &Err, const T &From) {
194
20
      // Don't attempt to import nodes if we hit an error earlier.
195
20
      if (Err)
196
0
        return T{};
197
20
      Expected<T> MaybeVal = import(From);
198
20
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
20
      return *MaybeVal;
203
20
    }
clang::TypeSourceInfo* clang::ASTNodeImporter::importChecked<clang::TypeSourceInfo*>(llvm::Error&, clang::TypeSourceInfo* const&)
Line
Count
Source
193
149k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
149k
      // Don't attempt to import nodes if we hit an error earlier.
195
149k
      if (Err)
196
34
        return T{};
197
149k
      Expected<T> MaybeVal = import(From);
198
149k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
149k
      return *MaybeVal;
203
149k
    }
clang::TemplateParameterList* clang::ASTNodeImporter::importChecked<clang::TemplateParameterList*>(llvm::Error&, clang::TemplateParameterList* const&)
Line
Count
Source
193
20
    template <typename T> T importChecked(Error &Err, const T &From) {
194
20
      // Don't attempt to import nodes if we hit an error earlier.
195
20
      if (Err)
196
0
        return T{};
197
20
      Expected<T> MaybeVal = import(From);
198
20
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
20
      return *MaybeVal;
203
20
    }
clang::TypeAliasDecl* clang::ASTNodeImporter::importChecked<clang::TypeAliasDecl*>(llvm::Error&, clang::TypeAliasDecl* const&)
Line
Count
Source
193
20
    template <typename T> T importChecked(Error &Err, const T &From) {
194
20
      // Don't attempt to import nodes if we hit an error earlier.
195
20
      if (Err)
196
0
        return T{};
197
20
      Expected<T> MaybeVal = import(From);
198
20
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
20
      return *MaybeVal;
203
20
    }
clang::DeclarationName clang::ASTNodeImporter::importChecked<clang::DeclarationName>(llvm::Error&, clang::DeclarationName const&)
Line
Count
Source
193
55.4k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
55.4k
      // Don't attempt to import nodes if we hit an error earlier.
195
55.4k
      if (Err)
196
0
        return T{};
197
55.4k
      Expected<T> MaybeVal = import(From);
198
55.4k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
55.4k
      return *MaybeVal;
203
55.4k
    }
clang::Selector clang::ASTNodeImporter::importChecked<clang::Selector>(llvm::Error&, clang::Selector const&)
Line
Count
Source
193
1.23k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
1.23k
      // Don't attempt to import nodes if we hit an error earlier.
195
1.23k
      if (Err)
196
0
        return T{};
197
1.23k
      Expected<T> MaybeVal = import(From);
198
1.23k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
1.23k
      return *MaybeVal;
203
1.23k
    }
clang::ObjCMethodDecl* clang::ASTNodeImporter::importChecked<clang::ObjCMethodDecl*>(llvm::Error&, clang::ObjCMethodDecl* const&)
Line
Count
Source
193
1.23k
    template <typename T> T importChecked(Error &Err, const T &From) {
194
1.23k
      // Don't attempt to import nodes if we hit an error earlier.
195
1.23k
      if (Err)
196
0
        return T{};
197
1.23k
      Expected<T> MaybeVal = import(From);
198
1.23k
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
1.23k
      return *MaybeVal;
203
1.23k
    }
clang::ObjCIvarDecl* clang::ASTNodeImporter::importChecked<clang::ObjCIvarDecl*>(llvm::Error&, clang::ObjCIvarDecl* const&)
Line
Count
Source
193
616
    template <typename T> T importChecked(Error &Err, const T &From) {
194
616
      // Don't attempt to import nodes if we hit an error earlier.
195
616
      if (Err)
196
0
        return T{};
197
616
      Expected<T> MaybeVal = import(From);
198
616
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
616
      return *MaybeVal;
203
616
    }
clang::NamedDecl* clang::ASTNodeImporter::importChecked<clang::NamedDecl*>(llvm::Error&, clang::NamedDecl* const&)
Line
Count
Source
193
184
    template <typename T> T importChecked(Error &Err, const T &From) {
194
184
      // Don't attempt to import nodes if we hit an error earlier.
195
184
      if (Err)
196
0
        return T{};
197
184
      Expected<T> MaybeVal = import(From);
198
184
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
184
      return *MaybeVal;
203
184
    }
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
373
    template <typename T> T importChecked(Error &Err, const T &From) {
194
373
      // Don't attempt to import nodes if we hit an error earlier.
195
373
      if (Err)
196
0
        return T{};
197
373
      Expected<T> MaybeVal = import(From);
198
373
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
373
      return *MaybeVal;
203
373
    }
clang::Stmt* clang::ASTNodeImporter::importChecked<clang::Stmt*>(llvm::Error&, clang::Stmt* const&)
Line
Count
Source
193
187
    template <typename T> T importChecked(Error &Err, const T &From) {
194
187
      // Don't attempt to import nodes if we hit an error earlier.
195
187
      if (Err)
196
0
        return T{};
197
187
      Expected<T> MaybeVal = import(From);
198
187
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
187
      return *MaybeVal;
203
187
    }
clang::LabelDecl* clang::ASTNodeImporter::importChecked<clang::LabelDecl*>(llvm::Error&, clang::LabelDecl* const&)
Line
Count
Source
193
20
    template <typename T> T importChecked(Error &Err, const T &From) {
194
20
      // Don't attempt to import nodes if we hit an error earlier.
195
20
      if (Err)
196
0
        return T{};
197
20
      Expected<T> MaybeVal = import(From);
198
20
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
20
      return *MaybeVal;
203
20
    }
clang::VarDecl* clang::ASTNodeImporter::importChecked<clang::VarDecl*>(llvm::Error&, clang::VarDecl* const&)
Line
Count
Source
193
67
    template <typename T> T importChecked(Error &Err, const T &From) {
194
67
      // Don't attempt to import nodes if we hit an error earlier.
195
67
      if (Err)
196
0
        return T{};
197
67
      Expected<T> MaybeVal = import(From);
198
67
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
67
      return *MaybeVal;
203
67
    }
clang::VarDecl const* clang::ASTNodeImporter::importChecked<clang::VarDecl const*>(llvm::Error&, clang::VarDecl const* const&)
Line
Count
Source
193
328
    template <typename T> T importChecked(Error &Err, const T &From) {
194
328
      // Don't attempt to import nodes if we hit an error earlier.
195
328
      if (Err)
196
0
        return T{};
197
328
      Expected<T> MaybeVal = import(From);
198
328
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
328
      return *MaybeVal;
203
328
    }
clang::DeclStmt* clang::ASTNodeImporter::importChecked<clang::DeclStmt*>(llvm::Error&, clang::DeclStmt* const&)
Line
Count
Source
193
32
    template <typename T> T importChecked(Error &Err, const T &From) {
194
32
      // Don't attempt to import nodes if we hit an error earlier.
195
32
      if (Err)
196
0
        return T{};
197
32
      Expected<T> MaybeVal = import(From);
198
32
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
32
      return *MaybeVal;
203
32
    }
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
6
      // 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
4
      // 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
899
    template <typename T> T importChecked(Error &Err, const T &From) {
194
899
      // Don't attempt to import nodes if we hit an error earlier.
195
899
      if (Err)
196
0
        return T{};
197
899
      Expected<T> MaybeVal = import(From);
198
899
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
899
      return *MaybeVal;
203
899
    }
clang::OpaqueValueExpr* clang::ASTNodeImporter::importChecked<clang::OpaqueValueExpr*>(llvm::Error&, clang::OpaqueValueExpr* const&)
Line
Count
Source
193
10
    template <typename T> T importChecked(Error &Err, const T &From) {
194
10
      // Don't attempt to import nodes if we hit an error earlier.
195
10
      if (Err)
196
0
        return T{};
197
10
      Expected<T> MaybeVal = import(From);
198
10
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
10
      return *MaybeVal;
203
10
    }
clang::CXXConstructorDecl* clang::ASTNodeImporter::importChecked<clang::CXXConstructorDecl*>(llvm::Error&, clang::CXXConstructorDecl* const&)
Line
Count
Source
193
289
    template <typename T> T importChecked(Error &Err, const T &From) {
194
289
      // Don't attempt to import nodes if we hit an error earlier.
195
289
      if (Err)
196
0
        return T{};
197
289
      Expected<T> MaybeVal = import(From);
198
289
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
289
      return *MaybeVal;
203
289
    }
clang::LifetimeExtendedTemporaryDecl* clang::ASTNodeImporter::importChecked<clang::LifetimeExtendedTemporaryDecl*>(llvm::Error&, clang::LifetimeExtendedTemporaryDecl* const&)
Line
Count
Source
193
83
    template <typename T> T importChecked(Error &Err, const T &From) {
194
83
      // Don't attempt to import nodes if we hit an error earlier.
195
83
      if (Err)
196
0
        return T{};
197
83
      Expected<T> MaybeVal = import(From);
198
83
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
83
      return *MaybeVal;
203
83
    }
llvm::Optional<clang::Expr*> clang::ASTNodeImporter::importChecked<llvm::Optional<clang::Expr*> >(llvm::Error&, llvm::Optional<clang::Expr*> const&)
Line
Count
Source
193
3
    template <typename T> T importChecked(Error &Err, const T &From) {
194
3
      // Don't attempt to import nodes if we hit an error earlier.
195
3
      if (Err)
196
0
        return T{};
197
3
      Expected<T> MaybeVal = import(From);
198
3
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
3
      return *MaybeVal;
203
3
    }
clang::NonTypeTemplateParmDecl* clang::ASTNodeImporter::importChecked<clang::NonTypeTemplateParmDecl*>(llvm::Error&, clang::NonTypeTemplateParmDecl* const&)
Line
Count
Source
193
5
    template <typename T> T importChecked(Error &Err, const T &From) {
194
5
      // Don't attempt to import nodes if we hit an error earlier.
195
5
      if (Err)
196
0
        return T{};
197
5
      Expected<T> MaybeVal = import(From);
198
5
      if (!MaybeVal) {
199
0
        Err = MaybeVal.takeError();
200
0
        return T{};
201
0
      }
202
5
      return *MaybeVal;
203
5
    }
204
205
    // Wrapper for an overload set.
206
    template <typename ToDeclT> struct CallOverloadedCreateFun {
207
187k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
187k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
187k
      }
Unexecuted instantiation: decltype(auto) clang::ASTNodeImporter::CallOverloadedCreateFun<clang::EmptyDecl>::operator()<clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&>(clang::ASTContext&&&, clang::DeclContext*&&&, clang::SourceLocation&&&)
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
97
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
97
        return ToDeclT::Create(std::forward<Args>(args)...);
209
97
      }
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
12
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
12
        return ToDeclT::Create(std::forward<Args>(args)...);
209
12
      }
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
963
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
963
        return ToDeclT::Create(std::forward<Args>(args)...);
209
963
      }
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
120
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
120
        return ToDeclT::Create(std::forward<Args>(args)...);
209
120
      }
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
15.9k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
15.9k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
15.9k
      }
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
20
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
20
        return ToDeclT::Create(std::forward<Args>(args)...);
209
20
      }
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
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::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
274
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
274
        return ToDeclT::Create(std::forward<Args>(args)...);
209
274
      }
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
941
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
941
        return ToDeclT::Create(std::forward<Args>(args)...);
209
941
      }
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
12.7k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
12.7k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
12.7k
      }
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
126
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
126
        return ToDeclT::Create(std::forward<Args>(args)...);
209
126
      }
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
178
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
178
        return ToDeclT::Create(std::forward<Args>(args)...);
209
178
      }
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
7.98k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
7.98k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
7.98k
      }
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
1.54k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
1.54k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
1.54k
      }
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
428
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
428
        return ToDeclT::Create(std::forward<Args>(args)...);
209
428
      }
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
44.8k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
44.8k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
44.8k
      }
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
2.18k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
2.18k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
2.18k
      }
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
14.4k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
14.4k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
14.4k
      }
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
421
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
421
        return ToDeclT::Create(std::forward<Args>(args)...);
209
421
      }
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
95
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
95
        return ToDeclT::Create(std::forward<Args>(args)...);
209
95
      }
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.15k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
1.15k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
1.15k
      }
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
1.25k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
1.25k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
1.25k
      }
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
54.1k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
54.1k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
54.1k
      }
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
3.36k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
3.36k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
3.36k
      }
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
199
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
199
        return ToDeclT::Create(std::forward<Args>(args)...);
209
199
      }
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
1.50k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
1.50k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
1.50k
      }
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
309
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
309
        return ToDeclT::Create(std::forward<Args>(args)...);
209
309
      }
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
279
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
279
        return ToDeclT::Create(std::forward<Args>(args)...);
209
279
      }
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
11
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
11
        return ToDeclT::Create(std::forward<Args>(args)...);
209
11
      }
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
15
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
15
        return ToDeclT::Create(std::forward<Args>(args)...);
209
15
      }
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
17
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
17
        return ToDeclT::Create(std::forward<Args>(args)...);
209
17
      }
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
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::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
1.86k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
1.86k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
1.86k
      }
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
616
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
616
        return ToDeclT::Create(std::forward<Args>(args)...);
209
616
      }
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
6.82k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
6.82k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
6.82k
      }
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
1.03k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
1.03k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
1.03k
      }
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
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::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
4.24k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
4.24k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
4.24k
      }
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
16
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
16
        return ToDeclT::Create(std::forward<Args>(args)...);
209
16
      }
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
6.22k
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
6.22k
        return ToDeclT::Create(std::forward<Args>(args)...);
209
6.22k
      }
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
87
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
87
        return ToDeclT::Create(std::forward<Args>(args)...);
209
87
      }
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
491
      template <typename... Args> decltype(auto) operator()(Args &&... args) {
208
491
        return ToDeclT::Create(std::forward<Args>(args)...);
209
491
      }
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
121k
                                                Args &&... args) {
221
121k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
121k
      // to call the one which would be chosen by the arguments, thus we use a
223
121k
      // wrapper for the overload set.
224
121k
      CallOverloadedCreateFun<ToDeclT> OC;
225
121k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
121k
                                            std::forward<Args>(args)...);
227
121k
    }
Unexecuted instantiation: bool clang::ASTNodeImporter::GetImportedOrCreateDecl<clang::EmptyDecl, clang::EmptyDecl, clang::ASTContext&, clang::DeclContext*&, clang::SourceLocation&>(clang::EmptyDecl*&, clang::EmptyDecl*, clang::ASTContext&&&, clang::DeclContext*&&&, clang::SourceLocation&&&)
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
97
                                                Args &&... args) {
221
97
      // There may be several overloads of ToDeclT::Create. We must make sure
222
97
      // to call the one which would be chosen by the arguments, thus we use a
223
97
      // wrapper for the overload set.
224
97
      CallOverloadedCreateFun<ToDeclT> OC;
225
97
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
97
                                            std::forward<Args>(args)...);
227
97
    }
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
12
                                                Args &&... args) {
221
12
      // There may be several overloads of ToDeclT::Create. We must make sure
222
12
      // to call the one which would be chosen by the arguments, thus we use a
223
12
      // wrapper for the overload set.
224
12
      CallOverloadedCreateFun<ToDeclT> OC;
225
12
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
12
                                            std::forward<Args>(args)...);
227
12
    }
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
963
                                                Args &&... args) {
221
963
      // There may be several overloads of ToDeclT::Create. We must make sure
222
963
      // to call the one which would be chosen by the arguments, thus we use a
223
963
      // wrapper for the overload set.
224
963
      CallOverloadedCreateFun<ToDeclT> OC;
225
963
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
963
                                            std::forward<Args>(args)...);
227
963
    }
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
3
      // There may be several overloads of ToDeclT::Create. We must make sure
222
3
      // to call the one which would be chosen by the arguments, thus we use a
223
3
      // 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
20
                                                Args &&... args) {
221
20
      // There may be several overloads of ToDeclT::Create. We must make sure
222
20
      // to call the one which would be chosen by the arguments, thus we use a
223
20
      // wrapper for the overload set.
224
20
      CallOverloadedCreateFun<ToDeclT> OC;
225
20
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
20
                                            std::forward<Args>(args)...);
227
20
    }
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
6
                                                Args &&... args) {
221
6
      // There may be several overloads of ToDeclT::Create. We must make sure
222
6
      // to call the one which would be chosen by the arguments, thus we use a
223
6
      // 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::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
274
                                                Args &&... args) {
221
274
      // There may be several overloads of ToDeclT::Create. We must make sure
222
274
      // to call the one which would be chosen by the arguments, thus we use a
223
274
      // wrapper for the overload set.
224
274
      CallOverloadedCreateFun<ToDeclT> OC;
225
274
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
274
                                            std::forward<Args>(args)...);
227
274
    }
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
941
                                                Args &&... args) {
221
941
      // There may be several overloads of ToDeclT::Create. We must make sure
222
941
      // to call the one which would be chosen by the arguments, thus we use a
223
941
      // wrapper for the overload set.
224
941
      CallOverloadedCreateFun<ToDeclT> OC;
225
941
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
941
                                            std::forward<Args>(args)...);
227
941
    }
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
13.0k
                                                Args &&... args) {
221
13.0k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
13.0k
      // to call the one which would be chosen by the arguments, thus we use a
223
13.0k
      // wrapper for the overload set.
224
13.0k
      CallOverloadedCreateFun<ToDeclT> OC;
225
13.0k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
13.0k
                                            std::forward<Args>(args)...);
227
13.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
137
                                                Args &&... args) {
221
137
      // There may be several overloads of ToDeclT::Create. We must make sure
222
137
      // to call the one which would be chosen by the arguments, thus we use a
223
137
      // wrapper for the overload set.
224
137
      CallOverloadedCreateFun<ToDeclT> OC;
225
137
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
137
                                            std::forward<Args>(args)...);
227
137
    }
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
178
                                                Args &&... args) {
221
178
      // There may be several overloads of ToDeclT::Create. We must make sure
222
178
      // to call the one which would be chosen by the arguments, thus we use a
223
178
      // wrapper for the overload set.
224
178
      CallOverloadedCreateFun<ToDeclT> OC;
225
178
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
178
                                            std::forward<Args>(args)...);
227
178
    }
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
2.20k
                                                Args &&... args) {
221
2.20k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
2.20k
      // to call the one which would be chosen by the arguments, thus we use a
223
2.20k
      // wrapper for the overload set.
224
2.20k
      CallOverloadedCreateFun<ToDeclT> OC;
225
2.20k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
2.20k
                                            std::forward<Args>(args)...);
227
2.20k
    }
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
14.4k
                                                Args &&... args) {
221
14.4k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
14.4k
      // to call the one which would be chosen by the arguments, thus we use a
223
14.4k
      // wrapper for the overload set.
224
14.4k
      CallOverloadedCreateFun<ToDeclT> OC;
225
14.4k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
14.4k
                                            std::forward<Args>(args)...);
227
14.4k
    }
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
421
                                                Args &&... args) {
221
421
      // There may be several overloads of ToDeclT::Create. We must make sure
222
421
      // to call the one which would be chosen by the arguments, thus we use a
223
421
      // wrapper for the overload set.
224
421
      CallOverloadedCreateFun<ToDeclT> OC;
225
421
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
421
                                            std::forward<Args>(args)...);
227
421
    }
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
95
                                                Args &&... args) {
221
95
      // There may be several overloads of ToDeclT::Create. We must make sure
222
95
      // to call the one which would be chosen by the arguments, thus we use a
223
95
      // wrapper for the overload set.
224
95
      CallOverloadedCreateFun<ToDeclT> OC;
225
95
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
95
                                            std::forward<Args>(args)...);
227
95
    }
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.15k
                                                Args &&... args) {
221
1.15k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
1.15k
      // to call the one which would be chosen by the arguments, thus we use a
223
1.15k
      // wrapper for the overload set.
224
1.15k
      CallOverloadedCreateFun<ToDeclT> OC;
225
1.15k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
1.15k
                                            std::forward<Args>(args)...);
227
1.15k
    }
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
1.25k
                                                Args &&... args) {
221
1.25k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
1.25k
      // to call the one which would be chosen by the arguments, thus we use a
223
1.25k
      // wrapper for the overload set.
224
1.25k
      CallOverloadedCreateFun<ToDeclT> OC;
225
1.25k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
1.25k
                                            std::forward<Args>(args)...);
227
1.25k
    }
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
54.1k
                                                Args &&... args) {
221
54.1k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
54.1k
      // to call the one which would be chosen by the arguments, thus we use a
223
54.1k
      // wrapper for the overload set.
224
54.1k
      CallOverloadedCreateFun<ToDeclT> OC;
225
54.1k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
54.1k
                                            std::forward<Args>(args)...);
227
54.1k
    }
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
3.36k
                                                Args &&... args) {
221
3.36k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
3.36k
      // to call the one which would be chosen by the arguments, thus we use a
223
3.36k
      // wrapper for the overload set.
224
3.36k
      CallOverloadedCreateFun<ToDeclT> OC;
225
3.36k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
3.36k
                                            std::forward<Args>(args)...);
227
3.36k
    }
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
199
                                                Args &&... args) {
221
199
      // There may be several overloads of ToDeclT::Create. We must make sure
222
199
      // to call the one which would be chosen by the arguments, thus we use a
223
199
      // wrapper for the overload set.
224
199
      CallOverloadedCreateFun<ToDeclT> OC;
225
199
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
199
                                            std::forward<Args>(args)...);
227
199
    }
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
1.50k
                                                Args &&... args) {
221
1.50k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
1.50k
      // to call the one which would be chosen by the arguments, thus we use a
223
1.50k
      // wrapper for the overload set.
224
1.50k
      CallOverloadedCreateFun<ToDeclT> OC;
225
1.50k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
1.50k
                                            std::forward<Args>(args)...);
227
1.50k
    }
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
309
                                                Args &&... args) {
221
309
      // There may be several overloads of ToDeclT::Create. We must make sure
222
309
      // to call the one which would be chosen by the arguments, thus we use a
223
309
      // wrapper for the overload set.
224
309
      CallOverloadedCreateFun<ToDeclT> OC;
225
309
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
309
                                            std::forward<Args>(args)...);
227
309
    }
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
279
                                                Args &&... args) {
221
279
      // There may be several overloads of ToDeclT::Create. We must make sure
222
279
      // to call the one which would be chosen by the arguments, thus we use a
223
279
      // wrapper for the overload set.
224
279
      CallOverloadedCreateFun<ToDeclT> OC;
225
279
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
279
                                            std::forward<Args>(args)...);
227
279
    }
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
11
                                                Args &&... args) {
221
11
      // There may be several overloads of ToDeclT::Create. We must make sure
222
11
      // to call the one which would be chosen by the arguments, thus we use a
223
11
      // wrapper for the overload set.
224
11
      CallOverloadedCreateFun<ToDeclT> OC;
225
11
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
11
                                            std::forward<Args>(args)...);
227
11
    }
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
15
                                                Args &&... args) {
221
15
      // There may be several overloads of ToDeclT::Create. We must make sure
222
15
      // to call the one which would be chosen by the arguments, thus we use a
223
15
      // wrapper for the overload set.
224
15
      CallOverloadedCreateFun<ToDeclT> OC;
225
15
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
15
                                            std::forward<Args>(args)...);
227
15
    }
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
17
                                                Args &&... args) {
221
17
      // There may be several overloads of ToDeclT::Create. We must make sure
222
17
      // to call the one which would be chosen by the arguments, thus we use a
223
17
      // wrapper for the overload set.
224
17
      CallOverloadedCreateFun<ToDeclT> OC;
225
17
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
17
                                            std::forward<Args>(args)...);
227
17
    }
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
1
      // There may be several overloads of ToDeclT::Create. We must make sure
222
1
      // to call the one which would be chosen by the arguments, thus we use a
223
1
      // 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
1
                                                Args &&... args) {
221
1
      // There may be several overloads of ToDeclT::Create. We must make sure
222
1
      // to call the one which would be chosen by the arguments, thus we use a
223
1
      // 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::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
1.86k
                                                Args &&... args) {
221
1.86k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
1.86k
      // to call the one which would be chosen by the arguments, thus we use a
223
1.86k
      // wrapper for the overload set.
224
1.86k
      CallOverloadedCreateFun<ToDeclT> OC;
225
1.86k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
1.86k
                                            std::forward<Args>(args)...);
227
1.86k
    }
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
4
      // There may be several overloads of ToDeclT::Create. We must make sure
222
4
      // to call the one which would be chosen by the arguments, thus we use a
223
4
      // 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
10
      // There may be several overloads of ToDeclT::Create. We must make sure
222
10
      // to call the one which would be chosen by the arguments, thus we use a
223
10
      // 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
616
                                                Args &&... args) {
221
616
      // There may be several overloads of ToDeclT::Create. We must make sure
222
616
      // to call the one which would be chosen by the arguments, thus we use a
223
616
      // wrapper for the overload set.
224
616
      CallOverloadedCreateFun<ToDeclT> OC;
225
616
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
616
                                            std::forward<Args>(args)...);
227
616
    }
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
4
      // There may be several overloads of ToDeclT::Create. We must make sure
222
4
      // to call the one which would be chosen by the arguments, thus we use a
223
4
      // 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
6.82k
                                                Args &&... args) {
221
6.82k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
6.82k
      // to call the one which would be chosen by the arguments, thus we use a
223
6.82k
      // wrapper for the overload set.
224
6.82k
      CallOverloadedCreateFun<ToDeclT> OC;
225
6.82k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
6.82k
                                            std::forward<Args>(args)...);
227
6.82k
    }
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
1.03k
                                                Args &&... args) {
221
1.03k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
1.03k
      // to call the one which would be chosen by the arguments, thus we use a
223
1.03k
      // wrapper for the overload set.
224
1.03k
      CallOverloadedCreateFun<ToDeclT> OC;
225
1.03k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
1.03k
                                            std::forward<Args>(args)...);
227
1.03k
    }
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
3
                                                Args &&... args) {
221
3
      // There may be several overloads of ToDeclT::Create. We must make sure
222
3
      // to call the one which would be chosen by the arguments, thus we use a
223
3
      // 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::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
8.47k
                                                Args &&... args) {
221
8.47k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
8.47k
      // to call the one which would be chosen by the arguments, thus we use a
223
8.47k
      // wrapper for the overload set.
224
8.47k
      CallOverloadedCreateFun<ToDeclT> OC;
225
8.47k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
8.47k
                                            std::forward<Args>(args)...);
227
8.47k
    }
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
6.22k
                                                Args &&... args) {
221
6.22k
      // There may be several overloads of ToDeclT::Create. We must make sure
222
6.22k
      // to call the one which would be chosen by the arguments, thus we use a
223
6.22k
      // wrapper for the overload set.
224
6.22k
      CallOverloadedCreateFun<ToDeclT> OC;
225
6.22k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
6.22k
                                            std::forward<Args>(args)...);
227
6.22k
    }
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
154
                                                Args &&... args) {
221
154
      // There may be several overloads of ToDeclT::Create. We must make sure
222
154
      // to call the one which would be chosen by the arguments, thus we use a
223
154
      // wrapper for the overload set.
224
154
      CallOverloadedCreateFun<ToDeclT> OC;
225
154
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
154
                                            std::forward<Args>(args)...);
227
154
    }
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
2
      // There may be several overloads of ToDeclT::Create. We must make sure
222
2
      // to call the one which would be chosen by the arguments, thus we use a
223
2
      // 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
6
      // There may be several overloads of ToDeclT::Create. We must make sure
222
6
      // to call the one which would be chosen by the arguments, thus we use a
223
6
      // 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
891
                                                Args &&... args) {
221
891
      // There may be several overloads of ToDeclT::Create. We must make sure
222
891
      // to call the one which would be chosen by the arguments, thus we use a
223
891
      // wrapper for the overload set.
224
891
      CallOverloadedCreateFun<ToDeclT> OC;
225
891
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
226
891
                                            std::forward<Args>(args)...);
227
891
    }
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
2
      // There may be several overloads of ToDeclT::Create. We must make sure
222
2
      // to call the one which would be chosen by the arguments, thus we use a
223
2
      // 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
70.8k
                                                Args &&... args) {
237
70.8k
      CallOverloadedCreateFun<NewDeclT> OC;
238
70.8k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
70.8k
                                            std::forward<Args>(args)...);
240
70.8k
    }
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
120
                                                Args &&... args) {
237
120
      CallOverloadedCreateFun<NewDeclT> OC;
238
120
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
120
                                            std::forward<Args>(args)...);
240
120
    }
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
15.9k
                                                Args &&... args) {
237
15.9k
      CallOverloadedCreateFun<NewDeclT> OC;
238
15.9k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
15.9k
                                            std::forward<Args>(args)...);
240
15.9k
    }
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
7.98k
                                                Args &&... args) {
237
7.98k
      CallOverloadedCreateFun<NewDeclT> OC;
238
7.98k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
7.98k
                                            std::forward<Args>(args)...);
240
7.98k
    }
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
1.54k
                                                Args &&... args) {
237
1.54k
      CallOverloadedCreateFun<NewDeclT> OC;
238
1.54k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
1.54k
                                            std::forward<Args>(args)...);
240
1.54k
    }
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
428
                                                Args &&... args) {
237
428
      CallOverloadedCreateFun<NewDeclT> OC;
238
428
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
428
                                            std::forward<Args>(args)...);
240
428
    }
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
44.8k
                                                Args &&... args) {
237
44.8k
      CallOverloadedCreateFun<NewDeclT> OC;
238
44.8k
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
44.8k
                                            std::forward<Args>(args)...);
240
44.8k
    }
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
16
                                                Args &&... args) {
237
16
      CallOverloadedCreateFun<NewDeclT> OC;
238
16
      return GetImportedOrCreateSpecialDecl(ToD, OC, FromD,
239
16
                                            std::forward<Args>(args)...);
240
16
    }
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
192k
                                   FromDeclT *FromD, Args &&... args) {
248
192k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
4
        ToD = nullptr;
250
4
        return true; // Already imported but with error.
251
4
      }
252
192k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
192k
      if (ToD)
254
5.03k
        return true; // Already imported.
255
187k
      ToD = CreateFun(std::forward<Args>(args)...);
256
187k
      // Keep track of imported Decls.
257
187k
      Importer.RegisterImportedDecl(FromD, ToD);
258
187k
      InitializeImportedDecl(FromD, ToD);
259
187k
      return false; // A new Decl is created.
260
187k
    }
Unexecuted instantiation: 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&&&)
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
97
                                   FromDeclT *FromD, Args &&... args) {
248
97
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
97
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
97
      if (ToD)
254
0
        return true; // Already imported.
255
97
      ToD = CreateFun(std::forward<Args>(args)...);
256
97
      // Keep track of imported Decls.
257
97
      Importer.RegisterImportedDecl(FromD, ToD);
258
97
      InitializeImportedDecl(FromD, ToD);
259
97
      return false; // A new Decl is created.
260
97
    }
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
12
                                   FromDeclT *FromD, Args &&... args) {
248
12
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
12
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
12
      if (ToD)
254
0
        return true; // Already imported.
255
12
      ToD = CreateFun(std::forward<Args>(args)...);
256
12
      // Keep track of imported Decls.
257
12
      Importer.RegisterImportedDecl(FromD, ToD);
258
12
      InitializeImportedDecl(FromD, ToD);
259
12
      return false; // A new Decl is created.
260
12
    }
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
963
                                   FromDeclT *FromD, Args &&... args) {
248
963
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
963
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
963
      if (ToD)
254
0
        return true; // Already imported.
255
963
      ToD = CreateFun(std::forward<Args>(args)...);
256
963
      // Keep track of imported Decls.
257
963
      Importer.RegisterImportedDecl(FromD, ToD);
258
963
      InitializeImportedDecl(FromD, ToD);
259
963
      return false; // A new Decl is created.
260
963
    }
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
3
      // 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
120
                                   FromDeclT *FromD, Args &&... args) {
248
120
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
120
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
120
      if (ToD)
254
0
        return true; // Already imported.
255
120
      ToD = CreateFun(std::forward<Args>(args)...);
256
120
      // Keep track of imported Decls.
257
120
      Importer.RegisterImportedDecl(FromD, ToD);
258
120
      InitializeImportedDecl(FromD, ToD);
259
120
      return false; // A new Decl is created.
260
120
    }
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
15.9k
                                   FromDeclT *FromD, Args &&... args) {
248
15.9k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
15.9k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
15.9k
      if (ToD)
254
50
        return true; // Already imported.
255
15.9k
      ToD = CreateFun(std::forward<Args>(args)...);
256
15.9k
      // Keep track of imported Decls.
257
15.9k
      Importer.RegisterImportedDecl(FromD, ToD);
258
15.9k
      InitializeImportedDecl(FromD, ToD);
259
15.9k
      return false; // A new Decl is created.
260
15.9k
    }
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
20
                                   FromDeclT *FromD, Args &&... args) {
248
20
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
20
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
20
      if (ToD)
254
0
        return true; // Already imported.
255
20
      ToD = CreateFun(std::forward<Args>(args)...);
256
20
      // Keep track of imported Decls.
257
20
      Importer.RegisterImportedDecl(FromD, ToD);
258
20
      InitializeImportedDecl(FromD, ToD);
259
20
      return false; // A new Decl is created.
260
20
    }
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
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
6
      // 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::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
274
                                   FromDeclT *FromD, Args &&... args) {
248
274
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
274
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
274
      if (ToD)
254
0
        return true; // Already imported.
255
274
      ToD = CreateFun(std::forward<Args>(args)...);
256
274
      // Keep track of imported Decls.
257
274
      Importer.RegisterImportedDecl(FromD, ToD);
258
274
      InitializeImportedDecl(FromD, ToD);
259
274
      return false; // A new Decl is created.
260
274
    }
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
77
      // 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
941
                                   FromDeclT *FromD, Args &&... args) {
248
941
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
941
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
941
      if (ToD)
254
0
        return true; // Already imported.
255
941
      ToD = CreateFun(std::forward<Args>(args)...);
256
941
      // Keep track of imported Decls.
257
941
      Importer.RegisterImportedDecl(FromD, ToD);
258
941
      InitializeImportedDecl(FromD, ToD);
259
941
      return false; // A new Decl is created.
260
941
    }
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
13.0k
                                   FromDeclT *FromD, Args &&... args) {
248
13.0k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
4
        ToD = nullptr;
250
4
        return true; // Already imported but with error.
251
4
      }
252
13.0k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
13.0k
      if (ToD)
254
263
        return true; // Already imported.
255
12.7k
      ToD = CreateFun(std::forward<Args>(args)...);
256
12.7k
      // Keep track of imported Decls.
257
12.7k
      Importer.RegisterImportedDecl(FromD, ToD);
258
12.7k
      InitializeImportedDecl(FromD, ToD);
259
12.7k
      return false; // A new Decl is created.
260
12.7k
    }
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
137
                                   FromDeclT *FromD, Args &&... args) {
248
137
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
137
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
137
      if (ToD)
254
11
        return true; // Already imported.
255
126
      ToD = CreateFun(std::forward<Args>(args)...);
256
126
      // Keep track of imported Decls.
257
126
      Importer.RegisterImportedDecl(FromD, ToD);
258
126
      InitializeImportedDecl(FromD, ToD);
259
126
      return false; // A new Decl is created.
260
126
    }
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
178
                                   FromDeclT *FromD, Args &&... args) {
248
178
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
178
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
178
      if (ToD)
254
0
        return true; // Already imported.
255
178
      ToD = CreateFun(std::forward<Args>(args)...);
256
178
      // Keep track of imported Decls.
257
178
      Importer.RegisterImportedDecl(FromD, ToD);
258
178
      InitializeImportedDecl(FromD, ToD);
259
178
      return false; // A new Decl is created.
260
178
    }
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
7.98k
                                   FromDeclT *FromD, Args &&... args) {
248
7.98k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
7.98k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
7.98k
      if (ToD)
254
0
        return true; // Already imported.
255
7.98k
      ToD = CreateFun(std::forward<Args>(args)...);
256
7.98k
      // Keep track of imported Decls.
257
7.98k
      Importer.RegisterImportedDecl(FromD, ToD);
258
7.98k
      InitializeImportedDecl(FromD, ToD);
259
7.98k
      return false; // A new Decl is created.
260
7.98k
    }
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
1.54k
                                   FromDeclT *FromD, Args &&... args) {
248
1.54k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
1.54k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
1.54k
      if (ToD)
254
0
        return true; // Already imported.
255
1.54k
      ToD = CreateFun(std::forward<Args>(args)...);
256
1.54k
      // Keep track of imported Decls.
257
1.54k
      Importer.RegisterImportedDecl(FromD, ToD);
258
1.54k
      InitializeImportedDecl(FromD, ToD);
259
1.54k
      return false; // A new Decl is created.
260
1.54k
    }
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
428
                                   FromDeclT *FromD, Args &&... args) {
248
428
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
428
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
428
      if (ToD)
254
0
        return true; // Already imported.
255
428
      ToD = CreateFun(std::forward<Args>(args)...);
256
428
      // Keep track of imported Decls.
257
428
      Importer.RegisterImportedDecl(FromD, ToD);
258
428
      InitializeImportedDecl(FromD, ToD);
259
428
      return false; // A new Decl is created.
260
428
    }
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
44.8k
                                   FromDeclT *FromD, Args &&... args) {
248
44.8k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
44.8k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
44.8k
      if (ToD)
254
0
        return true; // Already imported.
255
44.8k
      ToD = CreateFun(std::forward<Args>(args)...);
256
44.8k
      // Keep track of imported Decls.
257
44.8k
      Importer.RegisterImportedDecl(FromD, ToD);
258
44.8k
      InitializeImportedDecl(FromD, ToD);
259
44.8k
      return false; // A new Decl is created.
260
44.8k
    }
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
2.20k
                                   FromDeclT *FromD, Args &&... args) {
248
2.20k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
2.20k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
2.20k
      if (ToD)
254
14
        return true; // Already imported.
255
2.18k
      ToD = CreateFun(std::forward<Args>(args)...);
256
2.18k
      // Keep track of imported Decls.
257
2.18k
      Importer.RegisterImportedDecl(FromD, ToD);
258
2.18k
      InitializeImportedDecl(FromD, ToD);
259
2.18k
      return false; // A new Decl is created.
260
2.18k
    }
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
14.4k
                                   FromDeclT *FromD, Args &&... args) {
248
14.4k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
14.4k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
14.4k
      if (ToD)
254
0
        return true; // Already imported.
255
14.4k
      ToD = CreateFun(std::forward<Args>(args)...);
256
14.4k
      // Keep track of imported Decls.
257
14.4k
      Importer.RegisterImportedDecl(FromD, ToD);
258
14.4k
      InitializeImportedDecl(FromD, ToD);
259
14.4k
      return false; // A new Decl is created.
260
14.4k
    }
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
421
                                   FromDeclT *FromD, Args &&... args) {
248
421
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
421
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
421
      if (ToD)
254
0
        return true; // Already imported.
255
421
      ToD = CreateFun(std::forward<Args>(args)...);
256
421
      // Keep track of imported Decls.
257
421
      Importer.RegisterImportedDecl(FromD, ToD);
258
421
      InitializeImportedDecl(FromD, ToD);
259
421
      return false; // A new Decl is created.
260
421
    }
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
95
                                   FromDeclT *FromD, Args &&... args) {
248
95
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
95
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
95
      if (ToD)
254
0
        return true; // Already imported.
255
95
      ToD = CreateFun(std::forward<Args>(args)...);
256
95
      // Keep track of imported Decls.
257
95
      Importer.RegisterImportedDecl(FromD, ToD);
258
95
      InitializeImportedDecl(FromD, ToD);
259
95
      return false; // A new Decl is created.
260
95
    }
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.15k
                                   FromDeclT *FromD, Args &&... args) {
248
1.15k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
1.15k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
1.15k
      if (ToD)
254
0
        return true; // Already imported.
255
1.15k
      ToD = CreateFun(std::forward<Args>(args)...);
256
1.15k
      // Keep track of imported Decls.
257
1.15k
      Importer.RegisterImportedDecl(FromD, ToD);
258
1.15k
      InitializeImportedDecl(FromD, ToD);
259
1.15k
      return false; // A new Decl is created.
260
1.15k
    }
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
1.25k
                                   FromDeclT *FromD, Args &&... args) {
248
1.25k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
1.25k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
1.25k
      if (ToD)
254
0
        return true; // Already imported.
255
1.25k
      ToD = CreateFun(std::forward<Args>(args)...);
256
1.25k
      // Keep track of imported Decls.
257
1.25k
      Importer.RegisterImportedDecl(FromD, ToD);
258
1.25k
      InitializeImportedDecl(FromD, ToD);
259
1.25k
      return false; // A new Decl is created.
260
1.25k
    }
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
54.1k
                                   FromDeclT *FromD, Args &&... args) {
248
54.1k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
54.1k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
54.1k
      if (ToD)
254
0
        return true; // Already imported.
255
54.1k
      ToD = CreateFun(std::forward<Args>(args)...);
256
54.1k
      // Keep track of imported Decls.
257
54.1k
      Importer.RegisterImportedDecl(FromD, ToD);
258
54.1k
      InitializeImportedDecl(FromD, ToD);
259
54.1k
      return false; // A new Decl is created.
260
54.1k
    }
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
3.36k
                                   FromDeclT *FromD, Args &&... args) {
248
3.36k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
3.36k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
3.36k
      if (ToD)
254
0
        return true; // Already imported.
255
3.36k
      ToD = CreateFun(std::forward<Args>(args)...);
256
3.36k
      // Keep track of imported Decls.
257
3.36k
      Importer.RegisterImportedDecl(FromD, ToD);
258
3.36k
      InitializeImportedDecl(FromD, ToD);
259
3.36k
      return false; // A new Decl is created.
260
3.36k
    }
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
199
                                   FromDeclT *FromD, Args &&... args) {
248
199
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
199
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
199
      if (ToD)
254
0
        return true; // Already imported.
255
199
      ToD = CreateFun(std::forward<Args>(args)...);
256
199
      // Keep track of imported Decls.
257
199
      Importer.RegisterImportedDecl(FromD, ToD);
258
199
      InitializeImportedDecl(FromD, ToD);
259
199
      return false; // A new Decl is created.
260
199
    }
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
1.50k
                                   FromDeclT *FromD, Args &&... args) {
248
1.50k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
1.50k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
1.50k
      if (ToD)
254
0
        return true; // Already imported.
255
1.50k
      ToD = CreateFun(std::forward<Args>(args)...);
256
1.50k
      // Keep track of imported Decls.
257
1.50k
      Importer.RegisterImportedDecl(FromD, ToD);
258
1.50k
      InitializeImportedDecl(FromD, ToD);
259
1.50k
      return false; // A new Decl is created.
260
1.50k
    }
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
309
                                   FromDeclT *FromD, Args &&... args) {
248
309
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
309
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
309
      if (ToD)
254
0
        return true; // Already imported.
255
309
      ToD = CreateFun(std::forward<Args>(args)...);
256
309
      // Keep track of imported Decls.
257
309
      Importer.RegisterImportedDecl(FromD, ToD);
258
309
      InitializeImportedDecl(FromD, ToD);
259
309
      return false; // A new Decl is created.
260
309
    }
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
279
                                   FromDeclT *FromD, Args &&... args) {
248
279
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
279
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
279
      if (ToD)
254
0
        return true; // Already imported.
255
279
      ToD = CreateFun(std::forward<Args>(args)...);
256
279
      // Keep track of imported Decls.
257
279
      Importer.RegisterImportedDecl(FromD, ToD);
258
279
      InitializeImportedDecl(FromD, ToD);
259
279
      return false; // A new Decl is created.
260
279
    }
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
11
                                   FromDeclT *FromD, Args &&... args) {
248
11
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
11
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
11
      if (ToD)
254
0
        return true; // Already imported.
255
11
      ToD = CreateFun(std::forward<Args>(args)...);
256
11
      // Keep track of imported Decls.
257
11
      Importer.RegisterImportedDecl(FromD, ToD);
258
11
      InitializeImportedDecl(FromD, ToD);
259
11
      return false; // A new Decl is created.
260
11
    }
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
15
                                   FromDeclT *FromD, Args &&... args) {
248
15
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
15
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
15
      if (ToD)
254
0
        return true; // Already imported.
255
15
      ToD = CreateFun(std::forward<Args>(args)...);
256
15
      // Keep track of imported Decls.
257
15
      Importer.RegisterImportedDecl(FromD, ToD);
258
15
      InitializeImportedDecl(FromD, ToD);
259
15
      return false; // A new Decl is created.
260
15
    }
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
17
                                   FromDeclT *FromD, Args &&... args) {
248
17
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
17
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
17
      if (ToD)
254
0
        return true; // Already imported.
255
17
      ToD = CreateFun(std::forward<Args>(args)...);
256
17
      // Keep track of imported Decls.
257
17
      Importer.RegisterImportedDecl(FromD, ToD);
258
17
      InitializeImportedDecl(FromD, ToD);
259
17
      return false; // A new Decl is created.
260
17
    }
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
1
      // 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
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
1
      // 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::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
1.86k
                                   FromDeclT *FromD, Args &&... args) {
248
1.86k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
1.86k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
1.86k
      if (ToD)
254
0
        return true; // Already imported.
255
1.86k
      ToD = CreateFun(std::forward<Args>(args)...);
256
1.86k
      // Keep track of imported Decls.
257
1.86k
      Importer.RegisterImportedDecl(FromD, ToD);
258
1.86k
      InitializeImportedDecl(FromD, ToD);
259
1.86k
      return false; // A new Decl is created.
260
1.86k
    }
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
4
      // 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
10
      // 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
616
                                   FromDeclT *FromD, Args &&... args) {
248
616
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
616
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
616
      if (ToD)
254
0
        return true; // Already imported.
255
616
      ToD = CreateFun(std::forward<Args>(args)...);
256
616
      // Keep track of imported Decls.
257
616
      Importer.RegisterImportedDecl(FromD, ToD);
258
616
      InitializeImportedDecl(FromD, ToD);
259
616
      return false; // A new Decl is created.
260
616
    }
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
4
      // 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
6.82k
                                   FromDeclT *FromD, Args &&... args) {
248
6.82k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
6.82k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
6.82k
      if (ToD)
254
0
        return true; // Already imported.
255
6.82k
      ToD = CreateFun(std::forward<Args>(args)...);
256
6.82k
      // Keep track of imported Decls.
257
6.82k
      Importer.RegisterImportedDecl(FromD, ToD);
258
6.82k
      InitializeImportedDecl(FromD, ToD);
259
6.82k
      return false; // A new Decl is created.
260
6.82k
    }
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
1.03k
                                   FromDeclT *FromD, Args &&... args) {
248
1.03k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
1.03k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
1.03k
      if (ToD)
254
0
        return true; // Already imported.
255
1.03k
      ToD = CreateFun(std::forward<Args>(args)...);
256
1.03k
      // Keep track of imported Decls.
257
1.03k
      Importer.RegisterImportedDecl(FromD, ToD);
258
1.03k
      InitializeImportedDecl(FromD, ToD);
259
1.03k
      return false; // A new Decl is created.
260
1.03k
    }
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
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
3
      // 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::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
8.47k
                                   FromDeclT *FromD, Args &&... args) {
248
8.47k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
8.47k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
8.47k
      if (ToD)
254
4.23k
        return true; // Already imported.
255
4.24k
      ToD = CreateFun(std::forward<Args>(args)...);
256
4.24k
      // Keep track of imported Decls.
257
4.24k
      Importer.RegisterImportedDecl(FromD, ToD);
258
4.24k
      InitializeImportedDecl(FromD, ToD);
259
4.24k
      return false; // A new Decl is created.
260
4.24k
    }
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
16
                                   FromDeclT *FromD, Args &&... args) {
248
16
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
16
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
16
      if (ToD)
254
0
        return true; // Already imported.
255
16
      ToD = CreateFun(std::forward<Args>(args)...);
256
16
      // Keep track of imported Decls.
257
16
      Importer.RegisterImportedDecl(FromD, ToD);
258
16
      InitializeImportedDecl(FromD, ToD);
259
16
      return false; // A new Decl is created.
260
16
    }
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
6.22k
                                   FromDeclT *FromD, Args &&... args) {
248
6.22k
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
6.22k
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
6.22k
      if (ToD)
254
0
        return true; // Already imported.
255
6.22k
      ToD = CreateFun(std::forward<Args>(args)...);
256
6.22k
      // Keep track of imported Decls.
257
6.22k
      Importer.RegisterImportedDecl(FromD, ToD);
258
6.22k
      InitializeImportedDecl(FromD, ToD);
259
6.22k
      return false; // A new Decl is created.
260
6.22k
    }
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
154
                                   FromDeclT *FromD, Args &&... args) {
248
154
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
154
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
154
      if (ToD)
254
67
        return true; // Already imported.
255
87
      ToD = CreateFun(std::forward<Args>(args)...);
256
87
      // Keep track of imported Decls.
257
87
      Importer.RegisterImportedDecl(FromD, ToD);
258
87
      InitializeImportedDecl(FromD, ToD);
259
87
      return false; // A new Decl is created.
260
87
    }
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
2
      // 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
6
      // 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
891
                                   FromDeclT *FromD, Args &&... args) {
248
891
      if (Importer.getImportDeclErrorIfAny(FromD)) {
249
0
        ToD = nullptr;
250
0
        return true; // Already imported but with error.
251
0
      }
252
891
      ToD = cast_or_null<ToDeclT>(Importer.GetAlreadyImportedOrNull(FromD));
253
891
      if (ToD)
254
400
        return true; // Already imported.
255
491
      ToD = CreateFun(std::forward<Args>(args)...);
256
491
      // Keep track of imported Decls.
257
491
      Importer.RegisterImportedDecl(FromD, ToD);
258
491
      InitializeImportedDecl(FromD, ToD);
259
491
      return false; // A new Decl is created.
260
491
    }
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
2
      // 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
187k
    void InitializeImportedDecl(Decl *FromD, Decl *ToD) {
263
187k
      ToD->IdentifierNamespace = FromD->IdentifierNamespace;
264
187k
      if (FromD->hasAttrs())
265
46.8k
        
for (const Attr *FromAttr : FromD->getAttrs())45.6k
{
266
46.8k
          // FIXME: Return of the error here is not possible until store of
267
46.8k
          // import errors is implemented.
268
46.8k
          auto ToAttrOrErr = import(FromAttr);
269
46.8k
          if (ToAttrOrErr)
270
46.8k
            ToD->addAttr(*ToAttrOrErr);
271
0
          else
272
0
            llvm::consumeError(ToAttrOrErr.takeError());
273
46.8k
        }
274
187k
      if (FromD->isUsed())
275
816
        ToD->setIsUsed();
276
187k
      if (FromD->isImplicit())
277
6.99k
        ToD->setImplicit();
278
187k
    }
279
280
    // Check if we have found an existing definition.  Returns with that
281
    // definition if yes, otherwise returns null.
282
3.51k
    Decl *FindAndMapDefinition(FunctionDecl *D, FunctionDecl *FoundFunction) {
283
3.51k
      const FunctionDecl *Definition = nullptr;
284
3.51k
      if (D->doesThisDeclarationHaveABody() &&
285
3.51k
          
FoundFunction->hasBody(Definition)388
)
286
149
        return Importer.MapImported(D, const_cast<FunctionDecl *>(Definition));
287
3.37k
      return nullptr;
288
3.37k
    }
289
290
76.3k
    void addDeclToContexts(Decl *FromD, Decl *ToD) {
291
76.3k
      if (Importer.isMinimalImport()) {
292
70.7k
        // In minimal import case the decl must be added even if it is not
293
70.7k
        // contained in original context, for LLDB compatibility.
294
70.7k
        // FIXME: Check if a better solution is possible.
295
70.7k
        if (!FromD->getDescribedTemplate() &&
296
70.7k
            
FromD->getFriendObjectKind() == Decl::FOK_None66.8k
)
297
66.8k
          ToD->getLexicalDeclContext()->addDeclInternal(ToD);
298
70.7k
        return;
299
70.7k
      }
300
5.66k
301
5.66k
      DeclContext *FromDC = FromD->getDeclContext();
302
5.66k
      DeclContext *FromLexicalDC = FromD->getLexicalDeclContext();
303
5.66k
      DeclContext *ToDC = ToD->getDeclContext();
304
5.66k
      DeclContext *ToLexicalDC = ToD->getLexicalDeclContext();
305
5.66k
306
5.66k
      bool Visible = false;
307
5.66k
      if (FromDC->containsDeclAndLoad(FromD)) {
308
4.35k
        ToDC->addDeclInternal(ToD);
309
4.35k
        Visible = true;
310
4.35k
      }
311
5.66k
      if (ToDC != ToLexicalDC && 
FromLexicalDC->containsDeclAndLoad(FromD)210
) {
312
93
        ToLexicalDC->addDeclInternal(ToD);
313
93
        Visible = true;
314
93
      }
315
5.66k
316
5.66k
      // If the Decl was added to any context, it was made already visible.
317
5.66k
      // Otherwise it is still possible that it should be visible.
318
5.66k
      if (!Visible) {
319
1.21k
        if (auto *FromNamed = dyn_cast<NamedDecl>(FromD)) {
320
1.21k
          auto *ToNamed = cast<NamedDecl>(ToD);
321
1.21k
          DeclContextLookupResult FromLookup =
322
1.21k
              FromDC->lookup(FromNamed->getDeclName());
323
1.21k
          for (NamedDecl *ND : FromLookup)
324
1.18k
            if (ND == FromNamed) {
325
29
              ToDC->makeDeclVisibleInContext(ToNamed);
326
29
              break;
327
29
            }
328
1.21k
        }
329
1.21k
      }
330
5.66k
    }
331
332
  public:
333
326k
    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
401
    using Designator = DesignatedInitExpr::Designator;
402
403
    /// What we should import from the definition.
404
    enum ImportDefinitionKind {
405
      /// Import the default subset of the definition, which might be
406
      /// nothing (if minimal import is set) or might be everything (if minimal
407
      /// import is not set).
408
      IDK_Default,
409
      /// Import everything.
410
      IDK_Everything,
411
      /// Import only the bare bones needed to establish a valid
412
      /// DeclContext.
413
      IDK_Basic
414
    };
415
416
13.4k
    bool shouldForceImportDeclContext(ImportDefinitionKind IDK) {
417
13.4k
      return IDK == IDK_Everything ||
418
13.4k
             
(13.0k
IDK == IDK_Default13.0k
&&
!Importer.isMinimalImport()12.5k
);
419
13.4k
    }
420
421
    Error ImportInitializer(VarDecl *From, VarDecl *To);
422
    Error ImportDefinition(
423
        RecordDecl *From, RecordDecl *To,
424
        ImportDefinitionKind Kind = IDK_Default);
425
    Error ImportDefinition(
426
        EnumDecl *From, EnumDecl *To,
427
        ImportDefinitionKind Kind = IDK_Default);
428
    Error ImportDefinition(
429
        ObjCInterfaceDecl *From, ObjCInterfaceDecl *To,
430
        ImportDefinitionKind Kind = IDK_Default);
431
    Error ImportDefinition(
432
        ObjCProtocolDecl *From, ObjCProtocolDecl *To,
433
        ImportDefinitionKind Kind = IDK_Default);
434
    Error ImportTemplateArguments(
435
        const TemplateArgument *FromArgs, unsigned NumFromArgs,
436
        SmallVectorImpl<TemplateArgument> &ToArgs);
437
    Expected<TemplateArgument>
438
    ImportTemplateArgument(const TemplateArgument &From);
439
440
    template <typename InContainerTy>
441
    Error ImportTemplateArgumentListInfo(
442
        const InContainerTy &Container, TemplateArgumentListInfo &ToTAInfo);
443
444
    template<typename InContainerTy>
445
    Error ImportTemplateArgumentListInfo(
446
      SourceLocation FromLAngleLoc, SourceLocation FromRAngleLoc,
447
      const InContainerTy &Container, TemplateArgumentListInfo &Result);
448
449
    using TemplateArgsTy = SmallVector<TemplateArgument, 8>;
450
    using FunctionTemplateAndArgsTy =
451
        std::tuple<FunctionTemplateDecl *, TemplateArgsTy>;
452
    Expected<FunctionTemplateAndArgsTy>
453
    ImportFunctionTemplateWithTemplateArgsFromSpecialization(
454
        FunctionDecl *FromFD);
455
    Error ImportTemplateParameterLists(const DeclaratorDecl *FromD,
456
                                       DeclaratorDecl *ToD);
457
458
    Error ImportTemplateInformation(FunctionDecl *FromFD, FunctionDecl *ToFD);
459
460
    Error ImportFunctionDeclBody(FunctionDecl *FromFD, FunctionDecl *ToFD);
461
462
    Error ImportDefaultArgOfParmVarDecl(const ParmVarDecl *FromParam,
463
                                        ParmVarDecl *ToParam);
464
465
    template <typename T>
466
    bool hasSameVisibilityContextAndLinkage(T *Found, T *From);
467
468
    bool IsStructuralMatch(Decl *From, Decl *To, bool Complain);
469
    bool IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord,
470
                           bool Complain = true);
471
    bool IsStructuralMatch(VarDecl *FromVar, VarDecl *ToVar,
472
                           bool Complain = true);
473
    bool IsStructuralMatch(EnumDecl *FromEnum, EnumDecl *ToRecord);
474
    bool IsStructuralMatch(EnumConstantDecl *FromEC, EnumConstantDecl *ToEC);
475
    bool IsStructuralMatch(FunctionTemplateDecl *From,
476
                           FunctionTemplateDecl *To);
477
    bool IsStructuralMatch(FunctionDecl *From, FunctionDecl *To);
478
    bool IsStructuralMatch(ClassTemplateDecl *From, ClassTemplateDecl *To);
479
    bool IsStructuralMatch(VarTemplateDecl *From, VarTemplateDecl *To);
480
    ExpectedDecl VisitDecl(Decl *D);
481
    ExpectedDecl VisitImportDecl(ImportDecl *D);
482
    ExpectedDecl VisitEmptyDecl(EmptyDecl *D);
483
    ExpectedDecl VisitAccessSpecDecl(AccessSpecDecl *D);
484
    ExpectedDecl VisitStaticAssertDecl(StaticAssertDecl *D);
485
    ExpectedDecl VisitTranslationUnitDecl(TranslationUnitDecl *D);
486
    ExpectedDecl VisitNamespaceDecl(NamespaceDecl *D);
487
    ExpectedDecl VisitNamespaceAliasDecl(NamespaceAliasDecl *D);
488
    ExpectedDecl VisitTypedefNameDecl(TypedefNameDecl *D, bool IsAlias);
489
    ExpectedDecl VisitTypedefDecl(TypedefDecl *D);
490
    ExpectedDecl VisitTypeAliasDecl(TypeAliasDecl *D);
491
    ExpectedDecl VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D);
492
    ExpectedDecl VisitLabelDecl(LabelDecl *D);
493
    ExpectedDecl VisitEnumDecl(EnumDecl *D);
494
    ExpectedDecl VisitRecordDecl(RecordDecl *D);
495
    ExpectedDecl VisitEnumConstantDecl(EnumConstantDecl *D);
496
    ExpectedDecl VisitFunctionDecl(FunctionDecl *D);
497
    ExpectedDecl VisitCXXMethodDecl(CXXMethodDecl *D);
498
    ExpectedDecl VisitCXXConstructorDecl(CXXConstructorDecl *D);
499
    ExpectedDecl VisitCXXDestructorDecl(CXXDestructorDecl *D);
500
    ExpectedDecl VisitCXXConversionDecl(CXXConversionDecl *D);
501
    ExpectedDecl VisitFieldDecl(FieldDecl *D);
502
    ExpectedDecl VisitIndirectFieldDecl(IndirectFieldDecl *D);
503
    ExpectedDecl VisitFriendDecl(FriendDecl *D);
504
    ExpectedDecl VisitObjCIvarDecl(ObjCIvarDecl *D);
505
    ExpectedDecl VisitVarDecl(VarDecl *D);
506
    ExpectedDecl VisitImplicitParamDecl(ImplicitParamDecl *D);
507
    ExpectedDecl VisitParmVarDecl(ParmVarDecl *D);
508
    ExpectedDecl VisitObjCMethodDecl(ObjCMethodDecl *D);
509
    ExpectedDecl VisitObjCTypeParamDecl(ObjCTypeParamDecl *D);
510
    ExpectedDecl VisitObjCCategoryDecl(ObjCCategoryDecl *D);
511
    ExpectedDecl VisitObjCProtocolDecl(ObjCProtocolDecl *D);
512
    ExpectedDecl VisitLinkageSpecDecl(LinkageSpecDecl *D);
513
    ExpectedDecl VisitUsingDecl(UsingDecl *D);
514
    ExpectedDecl VisitUsingShadowDecl(UsingShadowDecl *D);
515
    ExpectedDecl VisitUsingDirectiveDecl(UsingDirectiveDecl *D);
516
    ExpectedDecl VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D);
517
    ExpectedDecl VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D);
518
    ExpectedDecl VisitBuiltinTemplateDecl(BuiltinTemplateDecl *D);
519
    ExpectedDecl
520
    VisitLifetimeExtendedTemporaryDecl(LifetimeExtendedTemporaryDecl *D);
521
522
    Expected<ObjCTypeParamList *>
523
    ImportObjCTypeParamList(ObjCTypeParamList *list);
524
525
    ExpectedDecl VisitObjCInterfaceDecl(ObjCInterfaceDecl *D);
526
    ExpectedDecl VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D);
527
    ExpectedDecl VisitObjCImplementationDecl(ObjCImplementationDecl *D);
528
    ExpectedDecl VisitObjCPropertyDecl(ObjCPropertyDecl *D);
529
    ExpectedDecl VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D);
530
    ExpectedDecl VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D);
531
    ExpectedDecl VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D);
532
    ExpectedDecl VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D);
533
    ExpectedDecl VisitClassTemplateDecl(ClassTemplateDecl *D);
534
    ExpectedDecl VisitClassTemplateSpecializationDecl(
535
                                            ClassTemplateSpecializationDecl *D);
536
    ExpectedDecl VisitVarTemplateDecl(VarTemplateDecl *D);
537
    ExpectedDecl VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D);
538
    ExpectedDecl VisitFunctionTemplateDecl(FunctionTemplateDecl *D);
539
540
    // Importing statements
541
    ExpectedStmt VisitStmt(Stmt *S);
542
    ExpectedStmt VisitGCCAsmStmt(GCCAsmStmt *S);
543
    ExpectedStmt VisitDeclStmt(DeclStmt *S);
544
    ExpectedStmt VisitNullStmt(NullStmt *S);
545
    ExpectedStmt VisitCompoundStmt(CompoundStmt *S);
546
    ExpectedStmt VisitCaseStmt(CaseStmt *S);
547
    ExpectedStmt VisitDefaultStmt(DefaultStmt *S);
548
    ExpectedStmt VisitLabelStmt(LabelStmt *S);
549
    ExpectedStmt VisitAttributedStmt(AttributedStmt *S);
550
    ExpectedStmt VisitIfStmt(IfStmt *S);
551
    ExpectedStmt VisitSwitchStmt(SwitchStmt *S);
552
    ExpectedStmt VisitWhileStmt(WhileStmt *S);
553
    ExpectedStmt VisitDoStmt(DoStmt *S);
554
    ExpectedStmt VisitForStmt(ForStmt *S);
555
    ExpectedStmt VisitGotoStmt(GotoStmt *S);
556
    ExpectedStmt VisitIndirectGotoStmt(IndirectGotoStmt *S);
557
    ExpectedStmt VisitContinueStmt(ContinueStmt *S);
558
    ExpectedStmt VisitBreakStmt(BreakStmt *S);
559
    ExpectedStmt VisitReturnStmt(ReturnStmt *S);
560
    // FIXME: MSAsmStmt
561
    // FIXME: SEHExceptStmt
562
    // FIXME: SEHFinallyStmt
563
    // FIXME: SEHTryStmt
564
    // FIXME: SEHLeaveStmt
565
    // FIXME: CapturedStmt
566
    ExpectedStmt VisitCXXCatchStmt(CXXCatchStmt *S);
567
    ExpectedStmt VisitCXXTryStmt(CXXTryStmt *S);
568
    ExpectedStmt VisitCXXForRangeStmt(CXXForRangeStmt *S);
569
    // FIXME: MSDependentExistsStmt
570
    ExpectedStmt VisitObjCForCollectionStmt(ObjCForCollectionStmt *S);
571
    ExpectedStmt VisitObjCAtCatchStmt(ObjCAtCatchStmt *S);
572
    ExpectedStmt VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S);
573
    ExpectedStmt VisitObjCAtTryStmt(ObjCAtTryStmt *S);
574
    ExpectedStmt VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S);
575
    ExpectedStmt VisitObjCAtThrowStmt(ObjCAtThrowStmt *S);
576
    ExpectedStmt VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S);
577
578
    // Importing expressions
579
    ExpectedStmt VisitExpr(Expr *E);
580
    ExpectedStmt VisitVAArgExpr(VAArgExpr *E);
581
    ExpectedStmt VisitChooseExpr(ChooseExpr *E);
582
    ExpectedStmt VisitGNUNullExpr(GNUNullExpr *E);
583
    ExpectedStmt VisitPredefinedExpr(PredefinedExpr *E);
584
    ExpectedStmt VisitDeclRefExpr(DeclRefExpr *E);
585
    ExpectedStmt VisitImplicitValueInitExpr(ImplicitValueInitExpr *E);
586
    ExpectedStmt VisitDesignatedInitExpr(DesignatedInitExpr *E);
587
    ExpectedStmt VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E);
588
    ExpectedStmt VisitIntegerLiteral(IntegerLiteral *E);
589
    ExpectedStmt VisitFloatingLiteral(FloatingLiteral *E);
590
    ExpectedStmt VisitImaginaryLiteral(ImaginaryLiteral *E);
591
    ExpectedStmt VisitCharacterLiteral(CharacterLiteral *E);
592
    ExpectedStmt VisitStringLiteral(StringLiteral *E);
593
    ExpectedStmt VisitCompoundLiteralExpr(CompoundLiteralExpr *E);
594
    ExpectedStmt VisitAtomicExpr(AtomicExpr *E);
595
    ExpectedStmt VisitAddrLabelExpr(AddrLabelExpr *E);
596
    ExpectedStmt VisitConstantExpr(ConstantExpr *E);
597
    ExpectedStmt VisitParenExpr(ParenExpr *E);
598
    ExpectedStmt VisitParenListExpr(ParenListExpr *E);
599
    ExpectedStmt VisitStmtExpr(StmtExpr *E);
600
    ExpectedStmt VisitUnaryOperator(UnaryOperator *E);
601
    ExpectedStmt VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E);
602
    ExpectedStmt VisitBinaryOperator(BinaryOperator *E);
603
    ExpectedStmt VisitConditionalOperator(ConditionalOperator *E);
604
    ExpectedStmt VisitBinaryConditionalOperator(BinaryConditionalOperator *E);
605
    ExpectedStmt VisitOpaqueValueExpr(OpaqueValueExpr *E);
606
    ExpectedStmt VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E);
607
    ExpectedStmt VisitExpressionTraitExpr(ExpressionTraitExpr *E);
608
    ExpectedStmt VisitArraySubscriptExpr(ArraySubscriptExpr *E);
609
    ExpectedStmt VisitCompoundAssignOperator(CompoundAssignOperator *E);
610
    ExpectedStmt VisitImplicitCastExpr(ImplicitCastExpr *E);
611
    ExpectedStmt VisitExplicitCastExpr(ExplicitCastExpr *E);
612
    ExpectedStmt VisitOffsetOfExpr(OffsetOfExpr *OE);
613
    ExpectedStmt VisitCXXThrowExpr(CXXThrowExpr *E);
614
    ExpectedStmt VisitCXXNoexceptExpr(CXXNoexceptExpr *E);
615
    ExpectedStmt VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E);
616
    ExpectedStmt VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E);
617
    ExpectedStmt VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E);
618
    ExpectedStmt VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E);
619
    ExpectedStmt VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E);
620
    ExpectedStmt VisitPackExpansionExpr(PackExpansionExpr *E);
621
    ExpectedStmt VisitSizeOfPackExpr(SizeOfPackExpr *E);
622
    ExpectedStmt VisitCXXNewExpr(CXXNewExpr *E);
623
    ExpectedStmt VisitCXXDeleteExpr(CXXDeleteExpr *E);
624
    ExpectedStmt VisitCXXConstructExpr(CXXConstructExpr *E);
625
    ExpectedStmt VisitCXXMemberCallExpr(CXXMemberCallExpr *E);
626
    ExpectedStmt VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E);
627
    ExpectedStmt VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E);
628
    ExpectedStmt VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E);
629
    ExpectedStmt VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E);
630
    ExpectedStmt VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E);
631
    ExpectedStmt VisitExprWithCleanups(ExprWithCleanups *E);
632
    ExpectedStmt VisitCXXThisExpr(CXXThisExpr *E);
633
    ExpectedStmt VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E);
634
    ExpectedStmt VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E);
635
    ExpectedStmt VisitMemberExpr(MemberExpr *E);
636
    ExpectedStmt VisitCallExpr(CallExpr *E);
637
    ExpectedStmt VisitLambdaExpr(LambdaExpr *LE);
638
    ExpectedStmt VisitInitListExpr(InitListExpr *E);
639
    ExpectedStmt VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E);
640
    ExpectedStmt VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E);
641
    ExpectedStmt VisitArrayInitLoopExpr(ArrayInitLoopExpr *E);
642
    ExpectedStmt VisitArrayInitIndexExpr(ArrayInitIndexExpr *E);
643
    ExpectedStmt VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E);
644
    ExpectedStmt VisitCXXNamedCastExpr(CXXNamedCastExpr *E);
645
    ExpectedStmt VisitSubstNonTypeTemplateParmExpr(SubstNonTypeTemplateParmExpr *E);
646
    ExpectedStmt VisitTypeTraitExpr(TypeTraitExpr *E);
647
    ExpectedStmt VisitCXXTypeidExpr(CXXTypeidExpr *E);
648
649
    template<typename IIter, typename OIter>
650
15.2k
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
651
15.2k
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
652
33.3k
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin18.0k
) {
653
18.0k
        Expected<ItemT> ToOrErr = import(*Ibegin);
654
18.0k
        if (!ToOrErr)
655
28
          return ToOrErr.takeError();
656
18.0k
        *Obegin = *ToOrErr;
657
18.0k
      }
658
15.2k
      
return Error::success()15.2k
;
659
15.2k
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::NamedDecl* const*, clang::NamedDecl**>(clang::NamedDecl* const*, clang::NamedDecl* const*, clang::NamedDecl**)
Line
Count
Source
650
9.67k
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
651
9.67k
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
652
25.1k
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin15.4k
) {
653
15.4k
        Expected<ItemT> ToOrErr = import(*Ibegin);
654
15.4k
        if (!ToOrErr)
655
0
          return ToOrErr.takeError();
656
15.4k
        *Obegin = *ToOrErr;
657
15.4k
      }
658
9.67k
      return Error::success();
659
9.67k
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::CXXCtorInitializer**, clang::CXXCtorInitializer**>(clang::CXXCtorInitializer**, clang::CXXCtorInitializer**, clang::CXXCtorInitializer**)
Line
Count
Source
650
90
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
651
90
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
652
204
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin114
) {
653
114
        Expected<ItemT> ToOrErr = import(*Ibegin);
654
114
        if (!ToOrErr)
655
0
          return ToOrErr.takeError();
656
114
        *Obegin = *ToOrErr;
657
114
      }
658
90
      return Error::success();
659
90
    }
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
650
467
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
651
467
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
652
712
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin245
) {
653
245
        Expected<ItemT> ToOrErr = import(*Ibegin);
654
245
        if (!ToOrErr)
655
0
          return ToOrErr.takeError();
656
245
        *Obegin = *ToOrErr;
657
245
      }
658
467
      return Error::success();
659
467
    }
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
650
3
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
651
3
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
652
3
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin0
) {
653
0
        Expected<ItemT> ToOrErr = import(*Ibegin);
654
0
        if (!ToOrErr)
655
0
          return ToOrErr.takeError();
656
0
        *Obegin = *ToOrErr;
657
0
      }
658
3
      return Error::success();
659
3
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::Stmt**, clang::Stmt**>(clang::Stmt**, clang::Stmt**, clang::Stmt**)
Line
Count
Source
650
1.30k
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
651
1.30k
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
652
2.36k
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin1.05k
) {
653
1.08k
        Expected<ItemT> ToOrErr = import(*Ibegin);
654
1.08k
        if (!ToOrErr)
655
28
          return ToOrErr.takeError();
656
1.05k
        *Obegin = *ToOrErr;
657
1.05k
      }
658
1.30k
      
return Error::success()1.27k
;
659
1.30k
    }
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
650
2
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
651
2
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
652
4
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin2
) {
653
2
        Expected<ItemT> ToOrErr = import(*Ibegin);
654
2
        if (!ToOrErr)
655
0
          return ToOrErr.takeError();
656
2
        *Obegin = *ToOrErr;
657
2
      }
658
2
      return Error::success();
659
2
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::DesignatedInitExpr::Designator*, clang::DesignatedInitExpr::Designator*>(clang::DesignatedInitExpr::Designator*, clang::DesignatedInitExpr::Designator*, clang::DesignatedInitExpr::Designator*)
Line
Count
Source
650
41
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
651
41
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
652
111
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin70
) {
653
70
        Expected<ItemT> ToOrErr = import(*Ibegin);
654
70
        if (!ToOrErr)
655
0
          return ToOrErr.takeError();
656
70
        *Obegin = *ToOrErr;
657
70
      }
658
41
      return Error::success();
659
41
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::SourceLocation const*, clang::SourceLocation*>(clang::SourceLocation const*, clang::SourceLocation const*, clang::SourceLocation*)
Line
Count
Source
650
3.40k
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
651
3.40k
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
652
4.17k
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin766
) {
653
766
        Expected<ItemT> ToOrErr = import(*Ibegin);
654
766
        if (!ToOrErr)
655
0
          return ToOrErr.takeError();
656
766
        *Obegin = *ToOrErr;
657
766
      }
658
3.40k
      return Error::success();
659
3.40k
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::Expr**, clang::Expr**>(clang::Expr**, clang::Expr**, clang::Expr**)
Line
Count
Source
650
65
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
651
65
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
652
97
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin32
) {
653
32
        Expected<ItemT> ToOrErr = import(*Ibegin);
654
32
        if (!ToOrErr)
655
0
          return ToOrErr.takeError();
656
32
        *Obegin = *ToOrErr;
657
32
      }
658
65
      return Error::success();
659
65
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::Expr* const*, clang::Expr**>(clang::Expr* const*, clang::Expr* const*, clang::Expr**)
Line
Count
Source
650
149
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
651
149
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
652
418
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin269
) {
653
269
        Expected<ItemT> ToOrErr = import(*Ibegin);
654
269
        if (!ToOrErr)
655
0
          return ToOrErr.takeError();
656
269
        *Obegin = *ToOrErr;
657
269
      }
658
149
      return Error::success();
659
149
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::BlockDecl* const*, clang::BlockDecl**>(clang::BlockDecl* const*, clang::BlockDecl* const*, clang::BlockDecl**)
Line
Count
Source
650
74
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
651
74
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
652
74
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin0
) {
653
0
        Expected<ItemT> ToOrErr = import(*Ibegin);
654
0
        if (!ToOrErr)
655
0
          return ToOrErr.takeError();
656
0
        *Obegin = *ToOrErr;
657
0
      }
658
74
      return Error::success();
659
74
    }
llvm::Error clang::ASTNodeImporter::ImportArrayChecked<clang::TypeSourceInfo* const*, clang::TypeSourceInfo**>(clang::TypeSourceInfo* const*, clang::TypeSourceInfo* const*, clang::TypeSourceInfo**)
Line
Count
Source
650
8
    Error ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin) {
651
8
      using ItemT = std::remove_reference_t<decltype(*Obegin)>;
652
20
      for (; Ibegin != Iend; 
++Ibegin, ++Obegin12
) {
653
12
        Expected<ItemT> ToOrErr = import(*Ibegin);
654
12
        if (!ToOrErr)
655
0
          return ToOrErr.takeError();
656
12
        *Obegin = *ToOrErr;
657
12
      }
658
8
      return Error::success();
659
8
    }
660
661
    // Import every item from a container structure into an output container.
662
    // If error occurs, stops at first error and returns the error.
663
    // The output container should have space for all needed elements (it is not
664
    // expanded, new items are put into from the beginning).
665
    template<typename InContainerTy, typename OutContainerTy>
666
    Error ImportContainerChecked(
667
15.2k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
15.2k
      return ImportArrayChecked(
669
15.2k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
15.2k
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<clang::TemplateParameterList, llvm::SmallVector<clang::NamedDecl*, 4u> >(clang::TemplateParameterList const&, llvm::SmallVector<clang::NamedDecl*, 4u>&)
Line
Count
Source
667
9.67k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
9.67k
      return ImportArrayChecked(
669
9.67k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
9.67k
    }
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
667
90
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
90
      return ImportArrayChecked(
669
90
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
90
    }
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
667
3.36k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
3.36k
      return ImportArrayChecked(
669
3.36k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
3.36k
    }
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
667
44
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
44
      return ImportArrayChecked(
669
44
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
44
    }
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
667
1.30k
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
1.30k
      return ImportArrayChecked(
669
1.30k
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
1.30k
    }
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
667
2
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
2
      return ImportArrayChecked(
669
2
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
2
    }
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
667
41
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
41
      return ImportArrayChecked(
669
41
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
41
    }
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
667
149
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
149
      return ImportArrayChecked(
669
149
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
149
    }
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
667
56
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
56
      return ImportArrayChecked(
669
56
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
56
    }
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
667
231
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
231
      return ImportArrayChecked(
669
231
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
231
    }
llvm::Error clang::ASTNodeImporter::ImportContainerChecked<llvm::ArrayRef<clang::BlockDecl*>, llvm::SmallVector<clang::BlockDecl*, 8u> >(llvm::ArrayRef<clang::BlockDecl*> const&, llvm::SmallVector<clang::BlockDecl*, 8u>&)
Line
Count
Source
667
74
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
74
      return ImportArrayChecked(
669
74
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
74
    }
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
667
133
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
133
      return ImportArrayChecked(
669
133
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
133
    }
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
667
47
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
47
      return ImportArrayChecked(
669
47
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
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
667
8
        const InContainerTy &InContainer, OutContainerTy &OutContainer) {
668
8
      return ImportArrayChecked(
669
8
          InContainer.begin(), InContainer.end(), OutContainer.begin());
670
8
    }
671
672
    template<typename InContainerTy, typename OIter>
673
6
    Error ImportArrayChecked(const InContainerTy &InContainer, OIter Obegin) {
674
6
      return ImportArrayChecked(InContainer.begin(), InContainer.end(), Obegin);
675
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
673
3
    Error ImportArrayChecked(const InContainerTy &InContainer, OIter Obegin) {
674
3
      return ImportArrayChecked(InContainer.begin(), InContainer.end(), Obegin);
675
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
673
3
    Error ImportArrayChecked(const InContainerTy &InContainer, OIter Obegin) {
674
3
      return ImportArrayChecked(InContainer.begin(), InContainer.end(), Obegin);
675
3
    }
676
677
    Error ImportOverriddenMethods(CXXMethodDecl *ToMethod,
678
                                  CXXMethodDecl *FromMethod);
679
680
    Expected<FunctionDecl *> FindFunctionTemplateSpecialization(
681
        FunctionDecl *FromFD);
682
683
    // Returns true if the given function has a placeholder return type and
684
    // that type is declared inside the body of the function.
685
    // E.g. auto f() { struct X{}; return X(); }
686
    bool hasAutoReturnTypeDeclaredInside(FunctionDecl *D);
687
  };
688
689
template <typename InContainerTy>
690
Error ASTNodeImporter::ImportTemplateArgumentListInfo(
691
    SourceLocation FromLAngleLoc, SourceLocation FromRAngleLoc,
692
169
    const InContainerTy &Container, TemplateArgumentListInfo &Result) {
693
169
  auto ToLAngleLocOrErr = import(FromLAngleLoc);
694
169
  if (!ToLAngleLocOrErr)
695
0
    return ToLAngleLocOrErr.takeError();
696
169
  auto ToRAngleLocOrErr = import(FromRAngleLoc);
697
169
  if (!ToRAngleLocOrErr)
698
0
    return ToRAngleLocOrErr.takeError();
699
169
700
169
  TemplateArgumentListInfo ToTAInfo(*ToLAngleLocOrErr, *ToRAngleLocOrErr);
701
169
  if (auto Err = ImportTemplateArgumentListInfo(Container, ToTAInfo))
702
0
    return Err;
703
169
  Result = ToTAInfo;
704
169
  return Error::success();
705
169
}
706
707
template <>
708
Error ASTNodeImporter::ImportTemplateArgumentListInfo<TemplateArgumentListInfo>(
709
16
    const TemplateArgumentListInfo &From, TemplateArgumentListInfo &Result) {
710
16
  return ImportTemplateArgumentListInfo(
711
16
      From.getLAngleLoc(), From.getRAngleLoc(), From.arguments(), Result);
712
16
}
713
714
template <>
715
Error ASTNodeImporter::ImportTemplateArgumentListInfo<
716
    ASTTemplateArgumentListInfo>(
717
        const ASTTemplateArgumentListInfo &From,
718
116
        TemplateArgumentListInfo &Result) {
719
116
  return ImportTemplateArgumentListInfo(
720
116
      From.LAngleLoc, From.RAngleLoc, From.arguments(), Result);
721
116
}
722
723
Expected<ASTNodeImporter::FunctionTemplateAndArgsTy>
724
ASTNodeImporter::ImportFunctionTemplateWithTemplateArgsFromSpecialization(
725
500
    FunctionDecl *FromFD) {
726
500
  assert(FromFD->getTemplatedKind() ==
727
500
      FunctionDecl::TK_FunctionTemplateSpecialization);
728
500
729
500
  FunctionTemplateAndArgsTy Result;
730
500
731
500
  auto *FTSInfo = FromFD->getTemplateSpecializationInfo();
732
500
  if (Error Err = importInto(std::get<0>(Result), FTSInfo->getTemplate()))
733
0
    return std::move(Err);
734
500
735
500
  // Import template arguments.
736
500
  auto TemplArgs = FTSInfo->TemplateArguments->asArray();
737
500
  if (Error Err = ImportTemplateArguments(TemplArgs.data(), TemplArgs.size(),
738
0
      std::get<1>(Result)))
739
0
    return std::move(Err);
740
500
741
500
  return Result;
742
500
}
743
744
template <>
745
Expected<TemplateParameterList *>
746
9.67k
ASTNodeImporter::import(TemplateParameterList *From) {
747
9.67k
  SmallVector<NamedDecl *, 4> To(From->size());
748
9.67k
  if (Error Err = ImportContainerChecked(*From, To))
749
0
    return std::move(Err);
750
9.67k
751
9.67k
  ExpectedExpr ToRequiresClause = import(From->getRequiresClause());
752
9.67k
  if (!ToRequiresClause)
753
0
    return ToRequiresClause.takeError();
754
9.67k
755
9.67k
  auto ToTemplateLocOrErr = import(From->getTemplateLoc());
756
9.67k
  if (!ToTemplateLocOrErr)
757
0
    return ToTemplateLocOrErr.takeError();
758
9.67k
  auto ToLAngleLocOrErr = import(From->getLAngleLoc());
759
9.67k
  if (!ToLAngleLocOrErr)
760
0
    return ToLAngleLocOrErr.takeError();
761
9.67k
  auto ToRAngleLocOrErr = import(From->getRAngleLoc());
762
9.67k
  if (!ToRAngleLocOrErr)
763
0
    return ToRAngleLocOrErr.takeError();
764
9.67k
765
9.67k
  return TemplateParameterList::Create(
766
9.67k
      Importer.getToContext(),
767
9.67k
      *ToTemplateLocOrErr,
768
9.67k
      *ToLAngleLocOrErr,
769
9.67k
      To,
770
9.67k
      *ToRAngleLocOrErr,
771
9.67k
      *ToRequiresClause);
772
9.67k
}
773
774
template <>
775
Expected<TemplateArgument>
776
12.8k
ASTNodeImporter::import(const TemplateArgument &From) {
777
12.8k
  switch (From.getKind()) {
778
0
  case TemplateArgument::Null:
779
0
    return TemplateArgument();
780
0
781
10.4k
  case TemplateArgument::Type: {
782
10.4k
    ExpectedType ToTypeOrErr = import(From.getAsType());
783
10.4k
    if (!ToTypeOrErr)
784
0
      return ToTypeOrErr.takeError();
785
10.4k
    return TemplateArgument(*ToTypeOrErr);
786
10.4k
  }
787
10.4k
788
10.4k
  case TemplateArgument::Integral: {
789
2.32k
    ExpectedType ToTypeOrErr = import(From.getIntegralType());
790
2.32k
    if (!ToTypeOrErr)
791
0
      return ToTypeOrErr.takeError();
792
2.32k
    return TemplateArgument(From, *ToTypeOrErr);
793
2.32k
  }
794
2.32k
795
2.32k
  case TemplateArgument::Declaration: {
796
0
    Expected<ValueDecl *> ToOrErr = import(From.getAsDecl());
797
0
    if (!ToOrErr)
798
0
      return ToOrErr.takeError();
799
0
    ExpectedType ToTypeOrErr = import(From.getParamTypeForDecl());
800
0
    if (!ToTypeOrErr)
801
0
      return ToTypeOrErr.takeError();
802
0
    return TemplateArgument(*ToOrErr, *ToTypeOrErr);
803
0
  }
804
0
805
0
  case TemplateArgument::NullPtr: {
806
0
    ExpectedType ToTypeOrErr = import(From.getNullPtrType());
807
0
    if (!ToTypeOrErr)
808
0
      return ToTypeOrErr.takeError();
809
0
    return TemplateArgument(*ToTypeOrErr, /*isNullPtr*/true);
810
0
  }
811
0
812
8
  case TemplateArgument::Template: {
813
8
    Expected<TemplateName> ToTemplateOrErr = import(From.getAsTemplate());
814
8
    if (!ToTemplateOrErr)
815
0
      return ToTemplateOrErr.takeError();
816
8
817
8
    return TemplateArgument(*ToTemplateOrErr);
818
8
  }
819
8
820
8
  case TemplateArgument::TemplateExpansion: {
821
0
    Expected<TemplateName> ToTemplateOrErr =
822
0
        import(From.getAsTemplateOrTemplatePattern());
823
0
    if (!ToTemplateOrErr)
824
0
      return ToTemplateOrErr.takeError();
825
0
826
0
    return TemplateArgument(
827
0
        *ToTemplateOrErr, From.getNumTemplateExpansions());
828
0
  }
829
0
830
72
  case TemplateArgument::Expression:
831
72
    if (ExpectedExpr ToExpr = import(From.getAsExpr()))
832
72
      return TemplateArgument(*ToExpr);
833
0
    else
834
0
      return ToExpr.takeError();
835
0
836
73
  case TemplateArgument::Pack: {
837
73
    SmallVector<TemplateArgument, 2> ToPack;
838
73
    ToPack.reserve(From.pack_size());
839
73
    if (Error Err = ImportTemplateArguments(
840
0
        From.pack_begin(), From.pack_size(), ToPack))
841
0
      return std::move(Err);
842
73
843
73
    return TemplateArgument(
844
73
        llvm::makeArrayRef(ToPack).copy(Importer.getToContext()));
845
73
  }
846
0
  }
847
0
848
0
  llvm_unreachable("Invalid template argument kind");
849
0
}
850
851
template <>
852
Expected<TemplateArgumentLoc>
853
185
ASTNodeImporter::import(const TemplateArgumentLoc &TALoc) {
854
185
  Expected<TemplateArgument> ArgOrErr = import(TALoc.getArgument());
855
185
  if (!ArgOrErr)
856
0
    return ArgOrErr.takeError();
857
185
  TemplateArgument Arg = *ArgOrErr;
858
185
859
185
  TemplateArgumentLocInfo FromInfo = TALoc.getLocInfo();
860
185
861
185
  TemplateArgumentLocInfo ToInfo;
862
185
  if (Arg.getKind() == TemplateArgument::Expression) {
863
7
    ExpectedExpr E = import(FromInfo.getAsExpr());
864
7
    if (!E)
865
0
      return E.takeError();
866
7
    ToInfo = TemplateArgumentLocInfo(*E);
867
178
  } else if (Arg.getKind() == TemplateArgument::Type) {
868
178
    if (auto TSIOrErr = import(FromInfo.getAsTypeSourceInfo()))
869
178
      ToInfo = TemplateArgumentLocInfo(*TSIOrErr);
870
0
    else
871
0
      return TSIOrErr.takeError();
872
0
  } else {
873
0
    auto ToTemplateQualifierLocOrErr =
874
0
        import(FromInfo.getTemplateQualifierLoc());
875
0
    if (!ToTemplateQualifierLocOrErr)
876
0
      return ToTemplateQualifierLocOrErr.takeError();
877
0
    auto ToTemplateNameLocOrErr = import(FromInfo.getTemplateNameLoc());
878
0
    if (!ToTemplateNameLocOrErr)
879
0
      return ToTemplateNameLocOrErr.takeError();
880
0
    auto ToTemplateEllipsisLocOrErr =
881
0
        import(FromInfo.getTemplateEllipsisLoc());
882
0
    if (!ToTemplateEllipsisLocOrErr)
883
0
      return ToTemplateEllipsisLocOrErr.takeError();
884
0
885
0
    ToInfo = TemplateArgumentLocInfo(
886
0
          *ToTemplateQualifierLocOrErr,
887
0
          *ToTemplateNameLocOrErr,
888
0
          *ToTemplateEllipsisLocOrErr);
889
0
  }
890
185
891
185
  return TemplateArgumentLoc(Arg, ToInfo);
892
185
}
893
894
template <>
895
373
Expected<DeclGroupRef> ASTNodeImporter::import(const DeclGroupRef &DG) {
896
373
  if (DG.isNull())
897
0
    return DeclGroupRef::Create(Importer.getToContext(), nullptr, 0);
898
373
  size_t NumDecls = DG.end() - DG.begin();
899
373
  SmallVector<Decl *, 1> ToDecls;
900
373
  ToDecls.reserve(NumDecls);
901
392
  for (Decl *FromD : DG) {
902
392
    if (auto ToDOrErr = import(FromD))
903
392
      ToDecls.push_back(*ToDOrErr);
904
0
    else
905
0
      return ToDOrErr.takeError();
906
392
  }
907
373
  return DeclGroupRef::Create(Importer.getToContext(),
908
373
                              ToDecls.begin(),
909
373
                              NumDecls);
910
373
}
911
912
template <>
913
Expected<ASTNodeImporter::Designator>
914
70
ASTNodeImporter::import(const Designator &D) {
915
70
  if (D.isFieldDesignator()) {
916
44
    IdentifierInfo *ToFieldName = Importer.Import(D.getFieldName());
917
44
918
44
    ExpectedSLoc ToDotLocOrErr = import(D.getDotLoc());
919
44
    if (!ToDotLocOrErr)
920
0
      return ToDotLocOrErr.takeError();
921
44
922
44
    ExpectedSLoc ToFieldLocOrErr = import(D.getFieldLoc());
923
44
    if (!ToFieldLocOrErr)
924
0
      return ToFieldLocOrErr.takeError();
925
44
926
44
    return Designator(ToFieldName, *ToDotLocOrErr, *ToFieldLocOrErr);
927
44
  }
928
26
929
26
  ExpectedSLoc ToLBracketLocOrErr = import(D.getLBracketLoc());
930
26
  if (!ToLBracketLocOrErr)
931
0
    return ToLBracketLocOrErr.takeError();
932
26
933
26
  ExpectedSLoc ToRBracketLocOrErr = import(D.getRBracketLoc());
934
26
  if (!ToRBracketLocOrErr)
935
0
    return ToRBracketLocOrErr.takeError();
936
26
937
26
  if (D.isArrayDesignator())
938
26
    return Designator(D.getFirstExprIndex(),
939
26
                      *ToLBracketLocOrErr, *ToRBracketLocOrErr);
940
0
941
0
  ExpectedSLoc ToEllipsisLocOrErr = import(D.getEllipsisLoc());
942
0
  if (!ToEllipsisLocOrErr)
943
0
    return ToEllipsisLocOrErr.takeError();
944
0
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
18
961
18
  auto LocationOrErr = import(From.getLocation());
962
18
  if (!LocationOrErr)
963
0
    return LocationOrErr.takeError();
964
18
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
18
970
18
  return LambdaCapture(
971
18
      *LocationOrErr, From.isImplicit(), From.getCaptureKind(), Var,
972
18
      EllipsisLoc);
973
18
}
974
975
template <typename T>
976
48.6k
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
48.6k
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
100
    return false;
979
48.5k
980
48.5k
  if (From->hasExternalFormalLinkage())
981
48.1k
    return Found->hasExternalFormalLinkage();
982
378
  if (Importer.GetFromTU(Found) != From->getTranslationUnitDecl())
983
133
    return false;
984
245
  if (From->isInAnonymousNamespace())
985
40
    return Found->isInAnonymousNamespace();
986
205
  else
987
205
    return !Found->isInAnonymousNamespace() &&
988
205
           !Found->hasExternalFormalLinkage();
989
245
}
bool clang::ASTNodeImporter::hasSameVisibilityContextAndLinkage<clang::EnumDecl>(clang::EnumDecl*, clang::EnumDecl*)
Line
Count
Source
976
114
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
114
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
0
    return false;
979
114
980
114
  if (From->hasExternalFormalLinkage())
981
94
    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
587
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
587
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
0
    return false;
979
587
980
587
  if (From->hasExternalFormalLinkage())
981
562
    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
46.2k
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
46.2k
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
52
    return false;
979
46.2k
980
46.2k
  if (From->hasExternalFormalLinkage())
981
46.0k
    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
282
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
282
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
16
    return false;
979
266
980
266
  if (From->hasExternalFormalLinkage())
981
242
    return Found->hasExternalFormalLinkage();
982
24
  if (Importer.GetFromTU(Found) != From->getTranslationUnitDecl())
983
16
    return false;
984
8
  if (From->isInAnonymousNamespace())
985
4
    return Found->isInAnonymousNamespace();
986
4
  else
987
4
    return !Found->isInAnonymousNamespace() &&
988
4
           !Found->hasExternalFormalLinkage();
989
8
}
bool clang::ASTNodeImporter::hasSameVisibilityContextAndLinkage<clang::ClassTemplateDecl>(clang::ClassTemplateDecl*, clang::ClassTemplateDecl*)
Line
Count
Source
976
1.06k
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
1.06k
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
0
    return false;
979
1.06k
980
1.06k
  if (From->hasExternalFormalLinkage())
981
1.04k
    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
288
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
977
288
  if (Found->getLinkageInternal() != From->getLinkageInternal())
978
32
    return false;
979
256
980
256
  if (From->hasExternalFormalLinkage())
981
212
    return Found->hasExternalFormalLinkage();
982
44
  if (Importer.GetFromTU(Found) != From->getTranslationUnitDecl())
983
32
    return false;
984
12
  if (From->isInAnonymousNamespace())
985
8
    return Found->isInAnonymousNamespace();
986
4
  else
987
4
    return !Found->isInAnonymousNamespace() &&
988
4
           !Found->hasExternalFormalLinkage();
989
12
}
990
991
template <>
992
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(TypedefNameDecl *Found,
993
1.75k
                                               TypedefNameDecl *From) {
994
1.75k
  if (Found->getLinkageInternal() != From->getLinkageInternal())
995
0
    return false;
996
1.75k
997
1.75k
  if (From->isInAnonymousNamespace() && 
Found->isInAnonymousNamespace()32
)
998
32
    return Importer.GetFromTU(Found) == From->getTranslationUnitDecl();
999
1.71k
  return From->isInAnonymousNamespace() == Found->isInAnonymousNamespace();
1000
1.71k
}
1001
1002
} // namespace clang
1003
1004
//----------------------------------------------------------------------------
1005
// Import Types
1006
//----------------------------------------------------------------------------
1007
1008
using namespace clang;
1009
1010
21
ExpectedType ASTNodeImporter::VisitType(const Type *T) {
1011
21
  Importer.FromDiag(SourceLocation(), diag::err_unsupported_ast_node)
1012
21
    << T->getTypeClassName();
1013
21
  return make_error<ImportError>(ImportError::UnsupportedConstruct);
1014
21
}
1015
1016
4
ExpectedType ASTNodeImporter::VisitAtomicType(const AtomicType *T){
1017
4
  ExpectedType UnderlyingTypeOrErr = import(T->getValueType());
1018
4
  if (!UnderlyingTypeOrErr)
1019
0
    return UnderlyingTypeOrErr.takeError();
1020
4
1021
4
  return Importer.getToContext().getAtomicType(*UnderlyingTypeOrErr);
1022
4
}
1023
1024
20.6k
ExpectedType ASTNodeImporter::VisitBuiltinType(const BuiltinType *T) {
1025
20.6k
  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
12
  case BuiltinType::Id: \
1036
12
    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
19.1k
  case BuiltinType::Id: return Importer.getToContext().SingletonId;
1041
1
#include "clang/AST/BuiltinTypes.def"
1042
0
1043
0
  // FIXME: for Char16, Char32, and NullPtr, make sure that the "to"
1044
0
  // context supports C++.
1045
0
1046
0
  // FIXME: for ObjCId, ObjCClass, and ObjCSel, make sure that the "to"
1047
0
  // context supports ObjC.
1048
0
1049
0
  case BuiltinType::Char_U:
1050
0
    // The context we're importing from has an unsigned 'char'. If we're
1051
0
    // importing into a context with a signed 'char', translate to
1052
0
    // 'unsigned char' instead.
1053
0
    if (Importer.getToContext().getLangOpts().CharIsSigned)
1054
0
      return Importer.getToContext().UnsignedCharTy;
1055
0
1056
0
    return Importer.getToContext().CharTy;
1057
0
1058
1.50k
  case BuiltinType::Char_S:
1059
1.50k
    // The context we're importing from has an unsigned 'char'. If we're
1060
1.50k
    // importing into a context with a signed 'char', translate to
1061
1.50k
    // 'unsigned char' instead.
1062
1.50k
    if (!Importer.getToContext().getLangOpts().CharIsSigned)
1063
0
      return Importer.getToContext().SignedCharTy;
1064
1.50k
1065
1.50k
    return Importer.getToContext().CharTy;
1066
1.50k
1067
1.50k
  case BuiltinType::WChar_S:
1068
27
  case BuiltinType::WChar_U:
1069
27
    // FIXME: If not in C++, shall we translate to the C equivalent of
1070
27
    // wchar_t?
1071
27
    return Importer.getToContext().WCharTy;
1072
0
  }
1073
0
1074
0
  llvm_unreachable("Invalid BuiltinType Kind!");
1075
0
}
1076
1077
9
ExpectedType ASTNodeImporter::VisitDecayedType(const DecayedType *T) {
1078
9
  ExpectedType ToOriginalTypeOrErr = import(T->getOriginalType());
1079
9
  if (!ToOriginalTypeOrErr)
1080
3
    return ToOriginalTypeOrErr.takeError();
1081
6
1082
6
  return Importer.getToContext().getDecayedType(*ToOriginalTypeOrErr);
1083
6
}
1084
1085
4
ExpectedType ASTNodeImporter::VisitComplexType(const ComplexType *T) {
1086
4
  ExpectedType ToElementTypeOrErr = import(T->getElementType());
1087
4
  if (!ToElementTypeOrErr)
1088
0
    return ToElementTypeOrErr.takeError();
1089
4
1090
4
  return Importer.getToContext().getComplexType(*ToElementTypeOrErr);
1091
4
}
1092
1093
5.60k
ExpectedType ASTNodeImporter::VisitPointerType(const PointerType *T) {
1094
5.60k
  ExpectedType ToPointeeTypeOrErr = import(T->getPointeeType());
1095
5.60k
  if (!ToPointeeTypeOrErr)
1096
29
    return ToPointeeTypeOrErr.takeError();
1097
5.58k
1098
5.58k
  return Importer.getToContext().getPointerType(*ToPointeeTypeOrErr);
1099
5.58k
}
1100
1101
26
ExpectedType ASTNodeImporter::VisitBlockPointerType(const BlockPointerType *T) {
1102
26
  // FIXME: Check for blocks support in "to" context.
1103
26
  ExpectedType ToPointeeTypeOrErr = import(T->getPointeeType());
1104
26
  if (!ToPointeeTypeOrErr)
1105
0
    return ToPointeeTypeOrErr.takeError();
1106
26
1107
26
  return Importer.getToContext().getBlockPointerType(*ToPointeeTypeOrErr);
1108
26
}
1109
1110
ExpectedType
1111
9.20k
ASTNodeImporter::VisitLValueReferenceType(const LValueReferenceType *T) {
1112
9.20k
  // FIXME: Check for C++ support in "to" context.
1113
9.20k
  ExpectedType ToPointeeTypeOrErr = import(T->getPointeeTypeAsWritten());
1114
9.20k
  if (!ToPointeeTypeOrErr)
1115
0
    return ToPointeeTypeOrErr.takeError();
1116
9.20k
1117
9.20k
  return Importer.getToContext().getLValueReferenceType(*ToPointeeTypeOrErr);
1118
9.20k
}
1119
1120
ExpectedType
1121
1.11k
ASTNodeImporter::VisitRValueReferenceType(const RValueReferenceType *T) {
1122
1.11k
  // FIXME: Check for C++0x support in "to" context.
1123
1.11k
  ExpectedType ToPointeeTypeOrErr = import(T->getPointeeTypeAsWritten());
1124
1.11k
  if (!ToPointeeTypeOrErr)
1125
0
    return ToPointeeTypeOrErr.takeError();
1126
1.11k
1127
1.11k
  return Importer.getToContext().getRValueReferenceType(*ToPointeeTypeOrErr);
1128
1.11k
}
1129
1130
ExpectedType
1131
2
ASTNodeImporter::VisitMemberPointerType(const MemberPointerType *T) {
1132
2
  // FIXME: Check for C++ support in "to" context.
1133
2
  ExpectedType ToPointeeTypeOrErr = import(T->getPointeeType());
1134
2
  if (!ToPointeeTypeOrErr)
1135
0
    return ToPointeeTypeOrErr.takeError();
1136
2
1137
2
  ExpectedType ClassTypeOrErr = import(QualType(T->getClass(), 0));
1138
2
  if (!ClassTypeOrErr)
1139
0
    return ClassTypeOrErr.takeError();
1140
2
1141
2
  return Importer.getToContext().getMemberPointerType(
1142
2
      *ToPointeeTypeOrErr, (*ClassTypeOrErr).getTypePtr());
1143
2
}
1144
1145
ExpectedType
1146
1.28k
ASTNodeImporter::VisitConstantArrayType(const ConstantArrayType *T) {
1147
1.28k
  Error Err = Error::success();
1148
1.28k
  auto ToElementType = importChecked(Err, T->getElementType());
1149
1.28k
  auto ToSizeExpr = importChecked(Err, T->getSizeExpr());
1150
1.28k
  if (Err)
1151
0
    return std::move(Err);
1152
1.28k
1153
1.28k
  return Importer.getToContext().getConstantArrayType(
1154
1.28k
      ToElementType, T->getSize(), ToSizeExpr, T->getSizeModifier(),
1155
1.28k
      T->getIndexTypeCVRQualifiers());
1156
1.28k
}
1157
1158
ExpectedType
1159
138
ASTNodeImporter::VisitIncompleteArrayType(const IncompleteArrayType *T) {
1160
138
  ExpectedType ToElementTypeOrErr = import(T->getElementType());
1161
138
  if (!ToElementTypeOrErr)
1162
3
    return ToElementTypeOrErr.takeError();
1163
135
1164
135
  return Importer.getToContext().getIncompleteArrayType(*ToElementTypeOrErr,
1165
135
                                                        T->getSizeModifier(),
1166
135
                                                T->getIndexTypeCVRQualifiers());
1167
135
}
1168
1169
ExpectedType
1170
0
ASTNodeImporter::VisitVariableArrayType(const VariableArrayType *T) {
1171
0
  Error Err = Error::success();
1172
0
  QualType ToElementType = importChecked(Err, T->getElementType());
1173
0
  Expr *ToSizeExpr = importChecked(Err, T->getSizeExpr());
1174
0
  SourceRange ToBracketsRange = importChecked(Err, T->getBracketsRange());
1175
0
  if (Err)
1176
0
    return std::move(Err);
1177
0
  return Importer.getToContext().getVariableArrayType(
1178
0
      ToElementType, ToSizeExpr, T->getSizeModifier(),
1179
0
      T->getIndexTypeCVRQualifiers(), ToBracketsRange);
1180
0
}
1181
1182
ExpectedType ASTNodeImporter::VisitDependentSizedArrayType(
1183
12
    const DependentSizedArrayType *T) {
1184
12
  Error Err = Error::success();
1185
12
  QualType ToElementType = importChecked(Err, T->getElementType());
1186
12
  Expr *ToSizeExpr = importChecked(Err, T->getSizeExpr());
1187
12
  SourceRange ToBracketsRange = importChecked(Err, T->getBracketsRange());
1188
12
  if (Err)
1189
0
    return std::move(Err);
1190
12
  // SizeExpr may be null if size is not specified directly.
1191
12
  // For example, 'int a[]'.
1192
12
1193
12
  return Importer.getToContext().getDependentSizedArrayType(
1194
12
      ToElementType, ToSizeExpr, T->getSizeModifier(),
1195
12
      T->getIndexTypeCVRQualifiers(), ToBracketsRange);
1196
12
}
1197
1198
0
ExpectedType ASTNodeImporter::VisitVectorType(const VectorType *T) {
1199
0
  ExpectedType ToElementTypeOrErr = import(T->getElementType());
1200
0
  if (!ToElementTypeOrErr)
1201
0
    return ToElementTypeOrErr.takeError();
1202
0
1203
0
  return Importer.getToContext().getVectorType(*ToElementTypeOrErr,
1204
0
                                               T->getNumElements(),
1205
0
                                               T->getVectorKind());
1206
0
}
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
13
1213
13
  return Importer.getToContext().getExtVectorType(*ToElementTypeOrErr,
1214
13
                                                  T->getNumElements());
1215
13
}
1216
1217
ExpectedType
1218
75
ASTNodeImporter::VisitFunctionNoProtoType(const FunctionNoProtoType *T) {
1219
75
  // FIXME: What happens if we're importing a function without a prototype
1220
75
  // into C++? Should we make it variadic?
1221
75
  ExpectedType ToReturnTypeOrErr = import(T->getReturnType());
1222
75
  if (!ToReturnTypeOrErr)
1223
0
    return ToReturnTypeOrErr.takeError();
1224
75
1225
75
  return Importer.getToContext().getFunctionNoProtoType(*ToReturnTypeOrErr,
1226
75
                                                        T->getExtInfo());
1227
75
}
1228
1229
ExpectedType
1230
34.3k
ASTNodeImporter::VisitFunctionProtoType(const FunctionProtoType *T) {
1231
34.3k
  ExpectedType ToReturnTypeOrErr = import(T->getReturnType());
1232
34.3k
  if (!ToReturnTypeOrErr)
1233
0
    return ToReturnTypeOrErr.takeError();
1234
34.3k
1235
34.3k
  // Import argument types
1236
34.3k
  SmallVector<QualType, 4> ArgTypes;
1237
38.7k
  for (const auto &A : T->param_types()) {
1238
38.7k
    ExpectedType TyOrErr = import(A);
1239
38.7k
    if (!TyOrErr)
1240
13
      return TyOrErr.takeError();
1241
38.7k
    ArgTypes.push_back(*TyOrErr);
1242
38.7k
  }
1243
34.3k
1244
34.3k
  // Import exception types
1245
34.3k
  SmallVector<QualType, 4> ExceptionTypes;
1246
34.3k
  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
34.3k
1253
34.3k
  FunctionProtoType::ExtProtoInfo FromEPI = T->getExtProtoInfo();
1254
34.3k
  Error Err = Error::success();
1255
34.3k
  FunctionProtoType::ExtProtoInfo ToEPI;
1256
34.3k
  ToEPI.ExtInfo = FromEPI.ExtInfo;
1257
34.3k
  ToEPI.Variadic = FromEPI.Variadic;
1258
34.3k
  ToEPI.HasTrailingReturn = FromEPI.HasTrailingReturn;
1259
34.3k
  ToEPI.TypeQuals = FromEPI.TypeQuals;
1260
34.3k
  ToEPI.RefQualifier = FromEPI.RefQualifier;
1261
34.3k
  ToEPI.ExceptionSpec.Type = FromEPI.ExceptionSpec.Type;
1262
34.3k
  ToEPI.ExceptionSpec.NoexceptExpr =
1263
34.3k
      importChecked(Err, FromEPI.ExceptionSpec.NoexceptExpr);
1264
34.3k
  ToEPI.ExceptionSpec.SourceDecl =
1265
34.3k
      importChecked(Err, FromEPI.ExceptionSpec.SourceDecl);
1266
34.3k
  ToEPI.ExceptionSpec.SourceTemplate =
1267
34.3k
      importChecked(Err, FromEPI.ExceptionSpec.SourceTemplate);
1268
34.3k
  ToEPI.ExceptionSpec.Exceptions = ExceptionTypes;
1269
34.3k
1270
34.3k
  if (Err)
1271
0
    return std::move(Err);
1272
34.3k
1273
34.3k
  return Importer.getToContext().getFunctionType(
1274
34.3k
      *ToReturnTypeOrErr, ArgTypes, ToEPI);
1275
34.3k
}
1276
1277
ExpectedType ASTNodeImporter::VisitUnresolvedUsingType(
1278
1
    const UnresolvedUsingType *T) {
1279
1
  Error Err = Error::success();
1280
1
  auto ToD = importChecked(Err, T->getDecl());
1281
1
  auto ToPrevD = importChecked(Err, T->getDecl()->getPreviousDecl());
1282
1
  if (Err)
1283
0
    return std::move(Err);
1284
1
1285
1
  return Importer.getToContext().getTypeDeclType(
1286
1
      ToD, cast_or_null<TypeDecl>(ToPrevD));
1287
1
}
1288
1289
66
ExpectedType ASTNodeImporter::VisitParenType(const ParenType *T) {
1290
66
  ExpectedType ToInnerTypeOrErr = import(T->getInnerType());
1291
66
  if (!ToInnerTypeOrErr)
1292
0
    return ToInnerTypeOrErr.takeError();
1293
66
1294
66
  return Importer.getToContext().getParenType(*ToInnerTypeOrErr);
1295
66
}
1296
1297
17.0k
ExpectedType ASTNodeImporter::VisitTypedefType(const TypedefType *T) {
1298
17.0k
  Expected<TypedefNameDecl *> ToDeclOrErr = import(T->getDecl());
1299
17.0k
  if (!ToDeclOrErr)
1300
0
    return ToDeclOrErr.takeError();
1301
17.0k
1302
17.0k
  return Importer.getToContext().getTypeDeclType(*ToDeclOrErr);
1303
17.0k
}
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
3
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
0
1318
0
  return Importer.getToContext().getTypeOfType(*ToUnderlyingTypeOrErr);
1319
0
}
1320
1321
5
ExpectedType ASTNodeImporter::VisitDecltypeType(const DecltypeType *T) {
1322
5
  // FIXME: Make sure that the "to" context supports C++0x!
1323
5
  ExpectedExpr ToExprOrErr = import(T->getUnderlyingExpr());
1324
5
  if (!ToExprOrErr)
1325
0
    return ToExprOrErr.takeError();
1326
5
1327
5
  ExpectedType ToUnderlyingTypeOrErr = import(T->getUnderlyingType());
1328
5
  if (!ToUnderlyingTypeOrErr)
1329
0
    return ToUnderlyingTypeOrErr.takeError();
1330
5
1331
5
  return Importer.getToContext().getDecltypeType(
1332
5
      *ToExprOrErr, *ToUnderlyingTypeOrErr);
1333
5
}
1334
1335
ExpectedType
1336
0
ASTNodeImporter::VisitUnaryTransformType(const UnaryTransformType *T) {
1337
0
  ExpectedType ToBaseTypeOrErr = import(T->getBaseType());
1338
0
  if (!ToBaseTypeOrErr)
1339
0
    return ToBaseTypeOrErr.takeError();
1340
0
1341
0
  ExpectedType ToUnderlyingTypeOrErr = import(T->getUnderlyingType());
1342
0
  if (!ToUnderlyingTypeOrErr)
1343
0
    return ToUnderlyingTypeOrErr.takeError();
1344
0
1345
0
  return Importer.getToContext().getUnaryTransformType(
1346
0
      *ToBaseTypeOrErr, *ToUnderlyingTypeOrErr, T->getUTTKind());
1347
0
}
1348
1349
198
ExpectedType ASTNodeImporter::VisitAutoType(const AutoType *T) {
1350
198
  // FIXME: Make sure that the "to" context supports C++11!
1351
198
  ExpectedType ToDeducedTypeOrErr = import(T->getDeducedType());
1352
198
  if (!ToDeducedTypeOrErr)
1353
0
    return ToDeducedTypeOrErr.takeError();
1354
198
1355
198
  ExpectedDecl ToTypeConstraintConcept = import(T->getTypeConstraintConcept());
1356
198
  if (!ToTypeConstraintConcept)
1357
0
    return ToTypeConstraintConcept.takeError();
1358
198
1359
198
  SmallVector<TemplateArgument, 2> ToTemplateArgs;
1360
198
  ArrayRef<TemplateArgument> FromTemplateArgs = T->getTypeConstraintArguments();
1361
198
  if (Error Err = ImportTemplateArguments(FromTemplateArgs.data(),
1362
0
                                          FromTemplateArgs.size(),
1363
0
                                          ToTemplateArgs))
1364
0
    return std::move(Err);
1365
198
1366
198
  return Importer.getToContext().getAutoType(
1367
198
      *ToDeducedTypeOrErr, T->getKeyword(), /*IsDependent*/false,
1368
198
      /*IsPack=*/false, cast_or_null<ConceptDecl>(*ToTypeConstraintConcept),
1369
198
      ToTemplateArgs);
1370
198
}
1371
1372
ExpectedType ASTNodeImporter::VisitInjectedClassNameType(
1373
30
    const InjectedClassNameType *T) {
1374
30
  Expected<CXXRecordDecl *> ToDeclOrErr = import(T->getDecl());
1375
30
  if (!ToDeclOrErr)
1376
0
    return ToDeclOrErr.takeError();
1377
30
1378
30
  ExpectedType ToInjTypeOrErr = import(T->getInjectedSpecializationType());
1379
30
  if (!ToInjTypeOrErr)
1380
0
    return ToInjTypeOrErr.takeError();
1381
30
1382
30
  // FIXME: ASTContext::getInjectedClassNameType is not suitable for AST reading
1383
30
  // See comments in InjectedClassNameType definition for details
1384
30
  // return Importer.getToContext().getInjectedClassNameType(D, InjType);
1385
30
  enum {
1386
30
    TypeAlignmentInBits = 4,
1387
30
    TypeAlignment = 1 << TypeAlignmentInBits
1388
30
  };
1389
30
1390
30
  return QualType(new (Importer.getToContext(), TypeAlignment)
1391
30
                  InjectedClassNameType(*ToDeclOrErr, *ToInjTypeOrErr), 0);
1392
30
}
1393
1394
14.4k
ExpectedType ASTNodeImporter::VisitRecordType(const RecordType *T) {
1395
14.4k
  Expected<RecordDecl *> ToDeclOrErr = import(T->getDecl());
1396
14.4k
  if (!ToDeclOrErr)
1397
19
    return ToDeclOrErr.takeError();
1398
14.4k
1399
14.4k
  return Importer.getToContext().getTagDeclType(*ToDeclOrErr);
1400
14.4k
}
1401
1402
241
ExpectedType ASTNodeImporter::VisitEnumType(const EnumType *T) {
1403
241
  Expected<EnumDecl *> ToDeclOrErr = import(T->getDecl());
1404
241
  if (!ToDeclOrErr)
1405
0
    return ToDeclOrErr.takeError();
1406
241
1407
241
  return Importer.getToContext().getTagDeclType(*ToDeclOrErr);
1408
241
}
1409
1410
228
ExpectedType ASTNodeImporter::VisitAttributedType(const AttributedType *T) {
1411
228
  ExpectedType ToModifiedTypeOrErr = import(T->getModifiedType());
1412
228
  if (!ToModifiedTypeOrErr)
1413
14
    return ToModifiedTypeOrErr.takeError();
1414
214
  ExpectedType ToEquivalentTypeOrErr = import(T->getEquivalentType());
1415
214
  if (!ToEquivalentTypeOrErr)
1416
0
    return ToEquivalentTypeOrErr.takeError();
1417
214
1418
214
  return Importer.getToContext().getAttributedType(T->getAttrKind(),
1419
214
      *ToModifiedTypeOrErr, *ToEquivalentTypeOrErr);
1420
214
}
1421
1422
ExpectedType ASTNodeImporter::VisitTemplateTypeParmType(
1423
390
    const TemplateTypeParmType *T) {
1424
390
  Expected<TemplateTypeParmDecl *> ToDeclOrErr = import(T->getDecl());
1425
390
  if (!ToDeclOrErr)
1426
0
    return ToDeclOrErr.takeError();
1427
390
1428
390
  return Importer.getToContext().getTemplateTypeParmType(
1429
390
      T->getDepth(), T->getIndex(), T->isParameterPack(), *ToDeclOrErr);
1430
390
}
1431
1432
ExpectedType ASTNodeImporter::VisitSubstTemplateTypeParmType(
1433
58
    const SubstTemplateTypeParmType *T) {
1434
58
  ExpectedType ReplacedOrErr = import(QualType(T->getReplacedParameter(), 0));
1435
58
  if (!ReplacedOrErr)
1436
0
    return ReplacedOrErr.takeError();
1437
58
  const TemplateTypeParmType *Replaced =
1438
58
      cast<TemplateTypeParmType>((*ReplacedOrErr).getTypePtr());
1439
58
1440
58
  ExpectedType ToReplacementTypeOrErr = import(T->getReplacementType());
1441
58
  if (!ToReplacementTypeOrErr)
1442
0
    return ToReplacementTypeOrErr.takeError();
1443
58
1444
58
  return Importer.getToContext().getSubstTemplateTypeParmType(
1445
58
        Replaced, (*ToReplacementTypeOrErr).getCanonicalType());
1446
58
}
1447
1448
ExpectedType ASTNodeImporter::VisitTemplateSpecializationType(
1449
374
                                       const TemplateSpecializationType *T) {
1450
374
  auto ToTemplateOrErr = import(T->getTemplateName());
1451
374
  if (!ToTemplateOrErr)
1452
0
    return ToTemplateOrErr.takeError();
1453
374
1454
374
  SmallVector<TemplateArgument, 2> ToTemplateArgs;
1455
374
  if (Error Err = ImportTemplateArguments(
1456
0
      T->getArgs(), T->getNumArgs(), ToTemplateArgs))
1457
0
    return std::move(Err);
1458
374
1459
374
  QualType ToCanonType;
1460
374
  if (!QualType(T, 0).isCanonical()) {
1461
285
    QualType FromCanonType
1462
285
      = Importer.getFromContext().getCanonicalType(QualType(T, 0));
1463
285
    if (ExpectedType TyOrErr = import(FromCanonType))
1464
285
      ToCanonType = *TyOrErr;
1465
0
    else
1466
0
      return TyOrErr.takeError();
1467
374
  }
1468
374
  return Importer.getToContext().getTemplateSpecializationType(*ToTemplateOrErr,
1469
374
                                                               ToTemplateArgs,
1470
374
                                                               ToCanonType);
1471
374
}
1472
1473
325
ExpectedType ASTNodeImporter::VisitElaboratedType(const ElaboratedType *T) {
1474
325
  // Note: the qualifier in an ElaboratedType is optional.
1475
325
  auto ToQualifierOrErr = import(T->getQualifier());
1476
325
  if (!ToQualifierOrErr)
1477
0
    return ToQualifierOrErr.takeError();
1478
325
1479
325
  ExpectedType ToNamedTypeOrErr = import(T->getNamedType());
1480
325
  if (!ToNamedTypeOrErr)
1481
9
    return ToNamedTypeOrErr.takeError();
1482
316
1483
316
  Expected<TagDecl *> ToOwnedTagDeclOrErr = import(T->getOwnedTagDecl());
1484
316
  if (!ToOwnedTagDeclOrErr)
1485
0
    return ToOwnedTagDeclOrErr.takeError();
1486
316
1487
316
  return Importer.getToContext().getElaboratedType(T->getKeyword(),
1488
316
                                                   *ToQualifierOrErr,
1489
316
                                                   *ToNamedTypeOrErr,
1490
316
                                                   *ToOwnedTagDeclOrErr);
1491
316
}
1492
1493
ExpectedType
1494
28
ASTNodeImporter::VisitPackExpansionType(const PackExpansionType *T) {
1495
28
  ExpectedType ToPatternOrErr = import(T->getPattern());
1496
28
  if (!ToPatternOrErr)
1497
0
    return ToPatternOrErr.takeError();
1498
28
1499
28
  return Importer.getToContext().getPackExpansionType(*ToPatternOrErr,
1500
28
                                                      T->getNumExpansions());
1501
28
}
1502
1503
ExpectedType ASTNodeImporter::VisitDependentTemplateSpecializationType(
1504
4
    const DependentTemplateSpecializationType *T) {
1505
4
  auto ToQualifierOrErr = import(T->getQualifier());
1506
4
  if (!ToQualifierOrErr)
1507
0
    return ToQualifierOrErr.takeError();
1508
4
1509
4
  IdentifierInfo *ToName = Importer.Import(T->getIdentifier());
1510
4
1511
4
  SmallVector<TemplateArgument, 2> ToPack;
1512
4
  ToPack.reserve(T->getNumArgs());
1513
4
  if (Error Err = ImportTemplateArguments(
1514
0
      T->getArgs(), T->getNumArgs(), ToPack))
1515
0
    return std::move(Err);
1516
4
1517
4
  return Importer.getToContext().getDependentTemplateSpecializationType(
1518
4
      T->getKeyword(), *ToQualifierOrErr, ToName, ToPack);
1519
4
}
1520
1521
ExpectedType
1522
8
ASTNodeImporter::VisitDependentNameType(const DependentNameType *T) {
1523
8
  auto ToQualifierOrErr = import(T->getQualifier());
1524
8
  if (!ToQualifierOrErr)
1525
0
    return ToQualifierOrErr.takeError();
1526
8
1527
8
  IdentifierInfo *Name = Importer.Import(T->getIdentifier());
1528
8
1529
8
  QualType Canon;
1530
8
  if (T != T->getCanonicalTypeInternal().getTypePtr()) {
1531
4
    if (ExpectedType TyOrErr = import(T->getCanonicalTypeInternal()))
1532
4
      Canon = (*TyOrErr).getCanonicalType();
1533
0
    else
1534
0
      return TyOrErr.takeError();
1535
8
  }
1536
8
1537
8
  return Importer.getToContext().getDependentNameType(T->getKeyword(),
1538
8
                                                      *ToQualifierOrErr,
1539
8
                                                      Name, Canon);
1540
8
}
1541
1542
ExpectedType
1543
1.92k
ASTNodeImporter::VisitObjCInterfaceType(const ObjCInterfaceType *T) {
1544
1.92k
  Expected<ObjCInterfaceDecl *> ToDeclOrErr = import(T->getDecl());
1545
1.92k
  if (!ToDeclOrErr)
1546
0
    return ToDeclOrErr.takeError();
1547
1.92k
1548
1.92k
  return Importer.getToContext().getObjCInterfaceType(*ToDeclOrErr);
1549
1.92k
}
1550
1551
231
ExpectedType ASTNodeImporter::VisitObjCObjectType(const ObjCObjectType *T) {
1552
231
  ExpectedType ToBaseTypeOrErr = import(T->getBaseType());
1553
231
  if (!ToBaseTypeOrErr)
1554
0
    return ToBaseTypeOrErr.takeError();
1555
231
1556
231
  SmallVector<QualType, 4> TypeArgs;
1557
231
  for (auto TypeArg : T->getTypeArgsAsWritten()) {
1558
15
    if (ExpectedType TyOrErr = import(TypeArg))
1559
15
      TypeArgs.push_back(*TyOrErr);
1560
0
    else
1561
0
      return TyOrErr.takeError();
1562
15
  }
1563
231
1564
231
  SmallVector<ObjCProtocolDecl *, 4> Protocols;
1565
231
  for (auto *P : T->quals()) {
1566
2
    if (Expected<ObjCProtocolDecl *> ProtocolOrErr = import(P))
1567
2
      Protocols.push_back(*ProtocolOrErr);
1568
0
    else
1569
0
      return ProtocolOrErr.takeError();
1570
2
1571
2
  }
1572
231
1573
231
  return Importer.getToContext().getObjCObjectType(*ToBaseTypeOrErr, TypeArgs,
1574
231
                                                   Protocols,
1575
231
                                                   T->isKindOfTypeAsWritten());
1576
231
}
1577
1578
ExpectedType
1579
924
ASTNodeImporter::VisitObjCObjectPointerType(const ObjCObjectPointerType *T) {
1580
924
  ExpectedType ToPointeeTypeOrErr = import(T->getPointeeType());
1581
924
  if (!ToPointeeTypeOrErr)
1582
0
    return ToPointeeTypeOrErr.takeError();
1583
924
1584
924
  return Importer.getToContext().getObjCObjectPointerType(*ToPointeeTypeOrErr);
1585
924
}
1586
1587
//----------------------------------------------------------------------------
1588
// Import Declarations
1589
//----------------------------------------------------------------------------
1590
Error ASTNodeImporter::ImportDeclParts(
1591
    NamedDecl *D, DeclContext *&DC, DeclContext *&LexicalDC,
1592
130k
    DeclarationName &Name, NamedDecl *&ToD, SourceLocation &Loc) {
1593
130k
  // Check if RecordDecl is in FunctionDecl parameters to avoid infinite loop.
1594
130k
  // example: int struct_in_proto(struct data_t{int a;int b;} *d);
1595
130k
  // FIXME: We could support these constructs by importing a different type of
1596
130k
  // this parameter and by importing the original type of the parameter only
1597
130k
  // after the FunctionDecl is created. See
1598
130k
  // VisitFunctionDecl::UsedDifferentProtoType.
1599
130k
  DeclContext *OrigDC = D->getDeclContext();
1600
130k
  FunctionDecl *FunDecl;
1601
130k
  if (isa<RecordDecl>(D) && 
(FunDecl = dyn_cast<FunctionDecl>(OrigDC))14.3k
&&
1602
130k
      
FunDecl->hasBody()274
) {
1603
134
    auto getLeafPointeeType = [](const Type *T) {
1604
67
      while (T->isPointerType() || 
T->isArrayType()42
) {
1605
25
        T = T->getPointeeOrArrayElementType();
1606
25
      }
1607
42
      return T;
1608
42
    };
1609
134
    for (const ParmVarDecl *P : FunDecl->parameters()) {
1610
42
      const Type *LeafT =
1611
42
          getLeafPointeeType(P->getType().getCanonicalType().getTypePtr());
1612
42
      auto *RT = dyn_cast<RecordType>(LeafT);
1613
42
      if (RT && 
RT->getDecl() == D9
) {
1614
9
        Importer.FromDiag(D->getLocation(), diag::err_unsupported_ast_node)
1615
9
            << D->getDeclKindName();
1616
9
        return make_error<ImportError>(ImportError::UnsupportedConstruct);
1617
9
      }
1618
42
    }
1619
134
  }
1620
130k
1621
130k
  // Import the context of this declaration.
1622
130k
  
if (Error 130k
Err130k
= ImportDeclContext(D, DC, LexicalDC))
1623
22
    return Err;
1624
130k
1625
130k
  // Import the name of this declaration.
1626
130k
  if (Error Err = importInto(Name, D->getDeclName()))
1627
0
    return Err;
1628
130k
1629
130k
  // Import the location of this declaration.
1630
130k
  if (Error Err = importInto(Loc, D->getLocation()))
1631
0
    return Err;
1632
130k
1633
130k
  ToD = cast_or_null<NamedDecl>(Importer.GetAlreadyImportedOrNull(D));
1634
130k
  if (ToD)
1635
746
    if (Error Err = ASTNodeImporter(*this).ImportDefinitionIfNeeded(D, ToD))
1636
0
      return Err;
1637
130k
1638
130k
  return Error::success();
1639
130k
}
1640
1641
2.71k
Error ASTNodeImporter::ImportDefinitionIfNeeded(Decl *FromD, Decl *ToD) {
1642
2.71k
  if (!FromD)
1643
1
    return Error::success();
1644
2.71k
1645
2.71k
  if (!ToD)
1646
1.97k
    if (Error Err = importInto(ToD, FromD))
1647
0
      return Err;
1648
2.71k
1649
2.71k
  if (RecordDecl *FromRecord = dyn_cast<RecordDecl>(FromD)) {
1650
2.04k
    if (RecordDecl *ToRecord = cast<RecordDecl>(ToD)) {
1651
2.04k
      if (FromRecord->getDefinition() && 
FromRecord->isCompleteDefinition()2.00k
&&
1652
2.04k
          
!ToRecord->getDefinition()2.00k
) {
1653
0
        if (Error Err = ImportDefinition(FromRecord, ToRecord))
1654
0
          return Err;
1655
2.04k
      }
1656
2.04k
    }
1657
2.04k
    return Error::success();
1658
2.04k
  }
1659
674
1660
674
  if (EnumDecl *FromEnum = dyn_cast<EnumDecl>(FromD)) {
1661
56
    if (EnumDecl *ToEnum = cast<EnumDecl>(ToD)) {
1662
56
      if (FromEnum->getDefinition() && 
!ToEnum->getDefinition()24
) {
1663
0
        if (Error Err = ImportDefinition(FromEnum, ToEnum))
1664
0
          return Err;
1665
56
      }
1666
56
    }
1667
56
    return Error::success();
1668
56
  }
1669
618
1670
618
  return Error::success();
1671
618
}
1672
1673
Error
1674
ASTNodeImporter::ImportDeclarationNameLoc(
1675
57.0k
    const DeclarationNameInfo &From, DeclarationNameInfo& To) {
1676
57.0k
  // NOTE: To.Name and To.Loc are already imported.
1677
57.0k
  // We only have to import To.LocInfo.
1678
57.0k
  switch (To.getName().getNameKind()) {
1679
37.8k
  case DeclarationName::Identifier:
1680
37.8k
  case DeclarationName::ObjCZeroArgSelector:
1681
37.8k
  case DeclarationName::ObjCOneArgSelector:
1682
37.8k
  case DeclarationName::ObjCMultiArgSelector:
1683
37.8k
  case DeclarationName::CXXUsingDirective:
1684
37.8k
  case DeclarationName::CXXDeductionGuideName:
1685
37.8k
    return Error::success();
1686
37.8k
1687
37.8k
  case DeclarationName::CXXOperatorName: {
1688
9.20k
    if (auto ToRangeOrErr = import(From.getCXXOperatorNameRange()))
1689
9.20k
      To.setCXXOperatorNameRange(*ToRangeOrErr);
1690
0
    else
1691
0
      return ToRangeOrErr.takeError();
1692
9.20k
    return Error::success();
1693
9.20k
  }
1694
9.20k
  case DeclarationName::CXXLiteralOperatorName: {
1695
0
    if (ExpectedSLoc LocOrErr = import(From.getCXXLiteralOperatorNameLoc()))
1696
0
      To.setCXXLiteralOperatorNameLoc(*LocOrErr);
1697
0
    else
1698
0
      return LocOrErr.takeError();
1699
0
    return Error::success();
1700
0
  }
1701
9.95k
  case DeclarationName::CXXConstructorName:
1702
9.95k
  case DeclarationName::CXXDestructorName:
1703
9.95k
  case DeclarationName::CXXConversionFunctionName: {
1704
9.95k
    if (auto ToTInfoOrErr = import(From.getNamedTypeInfo()))
1705
9.95k
      To.setNamedTypeInfo(*ToTInfoOrErr);
1706
0
    else
1707
0
      return ToTInfoOrErr.takeError();
1708
9.95k
    return Error::success();
1709
9.95k
  }
1710
0
  }
1711
0
  llvm_unreachable("Unknown name kind.");
1712
0
}
1713
1714
Error
1715
9.02k
ASTNodeImporter::ImportDeclContext(DeclContext *FromDC, bool ForceImport) {
1716
9.02k
  if (Importer.isMinimalImport() && 
!ForceImport7.45k
) {
1717
2.29k
    auto ToDCOrErr = Importer.ImportContext(FromDC);
1718
2.29k
    return ToDCOrErr.takeError();
1719
2.29k
  }
1720
6.73k
1721
6.73k
  // We use strict error handling in case of records and enums, but not
1722
6.73k
  // with e.g. namespaces.
1723
6.73k
  //
1724
6.73k
  // FIXME Clients of the ASTImporter should be able to choose an
1725
6.73k
  // appropriate error handling strategy for their needs.  For instance,
1726
6.73k
  // they may not want to mark an entire namespace as erroneous merely
1727
6.73k
  // because there is an ODR error with two typedefs.  As another example,
1728
6.73k
  // the client may allow EnumConstantDecls with same names but with
1729
6.73k
  // different values in two distinct translation units.
1730
6.73k
  bool AccumulateChildErrors = isa<TagDecl>(FromDC);
1731
6.73k
1732
6.73k
  Error ChildErrors = Error::success();
1733
49.6k
  for (auto *From : FromDC->decls()) {
1734
49.6k
    ExpectedDecl ImportedOrErr = import(From);
1735
49.6k
1736
49.6k
    // If we are in the process of ImportDefinition(...) for a RecordDecl we
1737
49.6k
    // want to make sure that we are also completing each FieldDecl. There
1738
49.6k
    // are currently cases where this does not happen and this is correctness
1739
49.6k
    // fix since operations such as code generation will expect this to be so.
1740
49.6k
    if (ImportedOrErr) {
1741
49.6k
      FieldDecl *FieldFrom = dyn_cast_or_null<FieldDecl>(From);
1742
49.6k
      Decl *ImportedDecl = *ImportedOrErr;
1743
49.6k
      FieldDecl *FieldTo = dyn_cast_or_null<FieldDecl>(ImportedDecl);
1744
49.6k
      if (FieldFrom && 
FieldTo9.85k
) {
1745
9.85k
        const RecordType *RecordFrom = FieldFrom->getType()->getAs<RecordType>();
1746
9.85k
        const RecordType *RecordTo = FieldTo->getType()->getAs<RecordType>();
1747
9.85k
        if (RecordFrom && 
RecordTo808
) {
1748
808
          RecordDecl *FromRecordDecl = RecordFrom->getDecl();
1749
808
          RecordDecl *ToRecordDecl = RecordTo->getDecl();
1750
808
1751
808
          if (FromRecordDecl->isCompleteDefinition() &&
1752
808
              !ToRecordDecl->isCompleteDefinition()) {
1753
9
            Error Err = ImportDefinition(FromRecordDecl, ToRecordDecl);
1754
9
1755
9
            if (Err && 
AccumulateChildErrors0
)
1756
0
              ChildErrors =  joinErrors(std::move(ChildErrors), std::move(Err));
1757
9
            else
1758
9
              consumeError(std::move(Err));
1759
9
          }
1760
808
        }
1761
9.85k
      }
1762
49.6k
    } else {
1763
49
      if (AccumulateChildErrors)
1764
28
        ChildErrors =
1765
28
            joinErrors(std::move(ChildErrors), ImportedOrErr.takeError());
1766
21
      else
1767
21
        consumeError(ImportedOrErr.takeError());
1768
49
    }
1769
49.6k
  }
1770
6.73k
1771
6.73k
  // We reorder declarations in RecordDecls because they may have another order
1772
6.73k
  // in the "to" context than they have in the "from" context. This may happen
1773
6.73k
  // e.g when we import a class like this:
1774
6.73k
  //    struct declToImport {
1775
6.73k
  //        int a = c + b;
1776
6.73k
  //        int b = 1;
1777
6.73k
  //        int c = 2;
1778
6.73k
  //    };
1779
6.73k
  // During the import of `a` we import first the dependencies in sequence,
1780
6.73k
  // thus the order would be `c`, `b`, `a`. We will get the normal order by
1781
6.73k
  // first removing the already imported members and then adding them in the
1782
6.73k
  // order as they apper in the "from" context.
1783
6.73k
  //
1784
6.73k
  // Keeping field order is vital because it determines structure layout.
1785
6.73k
  //
1786
6.73k
  // Here and below, we cannot call field_begin() method and its callers on
1787
6.73k
  // ToDC if it has an external storage. Calling field_begin() will
1788
6.73k
  // automatically load all the fields by calling
1789
6.73k
  // LoadFieldsFromExternalStorage(). LoadFieldsFromExternalStorage() would
1790
6.73k
  // call ASTImporter::Import(). This is because the ExternalASTSource
1791
6.73k
  // interface in LLDB is implemented by the means of the ASTImporter. However,
1792
6.73k
  // calling an import at this point would result in an uncontrolled import, we
1793
6.73k
  // must avoid that.
1794
6.73k
  const auto *FromRD = dyn_cast<R