Skip to content

Commit 77c81e7

Browse files
Axel-Naumanndevajithvs
authored andcommitted
Buffer the pending instantiations in case or recursive parsing.
1 parent e477c55 commit 77c81e7

File tree

1 file changed

+18
-0
lines changed
  • clang/include/clang/Sema

1 file changed

+18
-0
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10274,6 +10274,24 @@ class Sema final {
1027410274
}
1027510275
};
1027610276

10277+
class SavePendingInstantiationsRAII {
10278+
public:
10279+
SavePendingInstantiationsRAII(Sema &S):
10280+
SavedPendingLocalImplicitInstantiations(S), S(S) {
10281+
SavedPendingInstantiations.swap(S.PendingInstantiations);
10282+
}
10283+
10284+
~SavePendingInstantiationsRAII() {
10285+
assert(S.PendingInstantiations.empty() &&
10286+
"there shouldn't be any pending instantiations");
10287+
SavedPendingInstantiations.swap(S.PendingInstantiations);
10288+
}
10289+
private:
10290+
LocalEagerInstantiationScope SavedPendingLocalImplicitInstantiations;
10291+
Sema &S;
10292+
std::deque<PendingImplicitInstantiation> SavedPendingInstantiations;
10293+
};
10294+
1027710295
void PerformPendingInstantiations(bool LocalOnly = false);
1027810296

1027910297
TypeSourceInfo *SubstType(TypeSourceInfo *T,

0 commit comments

Comments
 (0)