diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-08-03 01:00:01 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-08-03 01:00:01 +0000 |
commit | 22d36eedd43d53bfc3a55acca8b2a54578a993ed (patch) | |
tree | b9ac2e48930a0a7a668cde222aca0f5880dc9cf8 /include/clang/Serialization | |
parent | bdd41df411fb9cd693bd21520c1e37ee4f3b71bc (diff) |
[modules] Defer merging deduced return types.
We can't read a deduced return type until we are sure that the types referred
to by it are not in the middle of being loaded. So defer all reading of such
deduced return types until the end of the recursive deserialization step.
Also, when we load a function type that has a deduced return type, update all
other redeclarations of the function to have that deduced return type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338798 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Serialization')
-rw-r--r-- | include/clang/Serialization/ASTReader.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h index 0eecb6f5d6..b959f596f9 100644 --- a/include/clang/Serialization/ASTReader.h +++ b/include/clang/Serialization/ASTReader.h @@ -539,6 +539,11 @@ private: /// declaration that has an exception specification. llvm::SmallMapVector<Decl *, FunctionDecl *, 4> PendingExceptionSpecUpdates; + /// Deduced return type updates that have been loaded but not yet propagated + /// across the relevant redeclaration chain. The map key is the canonical + /// declaration and the value is the deduced return type. + llvm::SmallMapVector<FunctionDecl *, QualType, 4> PendingDeducedTypeUpdates; + /// Declarations that have been imported and have typedef names for /// linkage purposes. llvm::DenseMap<std::pair<DeclContext *, IdentifierInfo *>, NamedDecl *> @@ -1056,6 +1061,12 @@ private: /// Objective-C protocols. std::deque<InterestingDecl> PotentiallyInterestingDecls; + /// The list of deduced function types that we have not yet read, because + /// they might contain a deduced return type that refers to a local type + /// declared within the function. + SmallVector<std::pair<FunctionDecl *, serialization::TypeID>, 16> + PendingFunctionTypes; + /// The list of redeclaration chains that still need to be /// reconstructed, and the local offset to the corresponding list /// of redeclarations. |