summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHReaderDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-10-24 08:00:42 +0000
committerJohn McCall <rjmccall@apple.com>2009-10-24 08:00:42 +0000
commit703a3f8a7ba3df3c04ca78c1ab29889d4ea98477 (patch)
treee109b01a7659eadaa269cd4500ceff49a1176980 /clang/lib/Frontend/PCHReaderDecl.cpp
parent3db7bd27c25c567cfa606a38cedc47c981d7fc2a (diff)
downloadbcm5719-llvm-703a3f8a7ba3df3c04ca78c1ab29889d4ea98477.tar.gz
bcm5719-llvm-703a3f8a7ba3df3c04ca78c1ab29889d4ea98477.zip
Preserve type source information in TypedefDecls. Preserve it across
template instantiation. Preserve it through PCH. Show it off to the indexer. I'm healthily ignoring the vector type cases because we don't have a sensible TypeLoc implementation for them anyway. llvm-svn: 84994
Diffstat (limited to 'clang/lib/Frontend/PCHReaderDecl.cpp')
-rw-r--r--clang/lib/Frontend/PCHReaderDecl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Frontend/PCHReaderDecl.cpp b/clang/lib/Frontend/PCHReaderDecl.cpp
index 5925dc6d714..c3690fb7a16 100644
--- a/clang/lib/Frontend/PCHReaderDecl.cpp
+++ b/clang/lib/Frontend/PCHReaderDecl.cpp
@@ -106,9 +106,9 @@ void PCHDeclReader::VisitTypedefDecl(TypedefDecl *TD) {
// set the underlying type of the typedef *before* we try to read
// the type associated with the TypedefDecl.
VisitNamedDecl(TD);
- TD->setUnderlyingType(Reader.GetType(Record[Idx + 1]));
- TD->setTypeForDecl(Reader.GetType(Record[Idx]).getTypePtr());
- Idx += 2;
+ uint64_t TypeData = Record[Idx++];
+ TD->setTypeDeclaratorInfo(Reader.GetDeclaratorInfo(Record, Idx));
+ TD->setTypeForDecl(Reader.GetType(TypeData).getTypePtr());
}
void PCHDeclReader::VisitTagDecl(TagDecl *TD) {
@@ -612,7 +612,7 @@ Decl *PCHReader::ReadDeclRecord(uint64_t Offset, unsigned Index) {
D = Context->getTranslationUnitDecl();
break;
case pch::DECL_TYPEDEF:
- D = TypedefDecl::Create(*Context, 0, SourceLocation(), 0, QualType());
+ D = TypedefDecl::Create(*Context, 0, SourceLocation(), 0, 0);
break;
case pch::DECL_ENUM:
D = EnumDecl::Create(*Context, 0, SourceLocation(), 0, SourceLocation(), 0);
OpenPOWER on IntegriCloud