diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-11-01 01:16:03 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-11-01 01:16:03 +0000 |
commit | 76852c218a207ef43583515cb835b6e855353a0f (patch) | |
tree | b055d2ceca0168d9a31f52bb3f34732abb6b49dc /lib/Serialization/ASTReader.cpp | |
parent | d8c4551fa22a9c346e6a9e56333915197c97e394 (diff) |
Rework the AST for the initializer of a delegating constructor, so
that it retains source location information for the type. Aside from
general goodness (being able to walk the types described in that
information), we now have a proper representation for dependent
delegating constructors. Fixes PR10457 (for real).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143410 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReader.cpp')
-rw-r--r-- | lib/Serialization/ASTReader.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 4554f05256..153b0e0dfe 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -5152,21 +5152,20 @@ ASTReader::ReadCXXCtorInitializers(Module &F, const RecordData &Record, CtorInitializers = new (Context) CXXCtorInitializer*[NumInitializers]; for (unsigned i=0; i != NumInitializers; ++i) { - TypeSourceInfo *BaseClassInfo = 0; + TypeSourceInfo *TInfo = 0; bool IsBaseVirtual = false; FieldDecl *Member = 0; IndirectFieldDecl *IndirectMember = 0; - CXXConstructorDecl *Target = 0; CtorInitializerType Type = (CtorInitializerType)Record[Idx++]; switch (Type) { - case CTOR_INITIALIZER_BASE: - BaseClassInfo = GetTypeSourceInfo(F, Record, Idx); + case CTOR_INITIALIZER_BASE: + TInfo = GetTypeSourceInfo(F, Record, Idx); IsBaseVirtual = Record[Idx++]; break; - - case CTOR_INITIALIZER_DELEGATING: - Target = ReadDeclAs<CXXConstructorDecl>(F, Record, Idx); + + case CTOR_INITIALIZER_DELEGATING: + TInfo = GetTypeSourceInfo(F, Record, Idx); break; case CTOR_INITIALIZER_MEMBER: @@ -5196,12 +5195,12 @@ ASTReader::ReadCXXCtorInitializers(Module &F, const RecordData &Record, CXXCtorInitializer *BOMInit; if (Type == CTOR_INITIALIZER_BASE) { - BOMInit = new (Context) CXXCtorInitializer(Context, BaseClassInfo, IsBaseVirtual, + BOMInit = new (Context) CXXCtorInitializer(Context, TInfo, IsBaseVirtual, LParenLoc, Init, RParenLoc, MemberOrEllipsisLoc); } else if (Type == CTOR_INITIALIZER_DELEGATING) { - BOMInit = new (Context) CXXCtorInitializer(Context, MemberOrEllipsisLoc, LParenLoc, - Target, Init, RParenLoc); + BOMInit = new (Context) CXXCtorInitializer(Context, TInfo, LParenLoc, + Init, RParenLoc); } else if (IsWritten) { if (Member) BOMInit = new (Context) CXXCtorInitializer(Context, Member, MemberOrEllipsisLoc, |