diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-02 11:55:11 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-02 11:55:11 +0000 |
commit | 9763e221e16026ddf487d2564ed349d2c874a1a1 (patch) | |
tree | 6b29b1cf5e0657b9c386b16c71be688969c3fd2b /lib/Frontend/PCHReader.cpp | |
parent | f52a5d23965abe1a11ca7f283fec1adc1a339516 (diff) |
- Allow a typedef type to be read from PCH even if its decl is currently initializing.
- Fix creation of TemplateSpecializationType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107471 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index be763d51ca..330cd9a5c6 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -2116,12 +2116,15 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) { return Context->getTypeDeclType( cast<UnresolvedUsingTypenameDecl>(GetDecl(Record[0]))); - case pch::TYPE_TYPEDEF: - if (Record.size() != 1) { + case pch::TYPE_TYPEDEF: { + if (Record.size() != 2) { Error("incorrect encoding of typedef type"); return QualType(); } - return Context->getTypeDeclType(cast<TypedefDecl>(GetDecl(Record[0]))); + TypedefDecl *Decl = cast<TypedefDecl>(GetDecl(Record[0])); + QualType Canonical = GetType(Record[1]); + return Context->getTypedefType(Decl, Canonical); + } case pch::TYPE_TYPEOF_EXPR: return Context->getTypeOfExprType(ReadExpr()); @@ -2251,8 +2254,12 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) { llvm::SmallVector<TemplateArgument, 8> Args; ReadTemplateArgumentList(Args, Record, Idx); QualType Canon = GetType(Record[Idx++]); - return Context->getTemplateSpecializationType(Name, Args.data(),Args.size(), - Canon); + if (Canon.isNull()) + return Context->getCanonicalTemplateSpecializationType(Name, Args.data(), + Args.size()); + else + return Context->getTemplateSpecializationType(Name, Args.data(), + Args.size(), Canon); } } // Suppress a GCC warning |