diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-10-05 15:59:54 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-10-05 15:59:54 +0000 |
commit | c3632730cc83ed7b51f0ab5c38997ae5a9439b0c (patch) | |
tree | ad75aa580134fea0b0089346c1f412f1b8aae78b /lib/Serialization/ASTReaderStmt.cpp | |
parent | 4a1bb8c4d708d5594e62c9ec7e25e273cae8a1ed (diff) |
Thread PerFileData through the ASTReader again, this time with the LLVM changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115625 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReaderStmt.cpp')
-rw-r--r-- | lib/Serialization/ASTReaderStmt.cpp | 377 |
1 files changed, 196 insertions, 181 deletions
diff --git a/lib/Serialization/ASTReaderStmt.cpp b/lib/Serialization/ASTReaderStmt.cpp index ab2bba7283..f361f0d260 100644 --- a/lib/Serialization/ASTReaderStmt.cpp +++ b/lib/Serialization/ASTReaderStmt.cpp @@ -22,14 +22,28 @@ namespace clang { class ASTStmtReader : public StmtVisitor<ASTStmtReader> { ASTReader &Reader; + ASTReader::PerFileData &F; llvm::BitstreamCursor &DeclsCursor; const ASTReader::RecordData &Record; unsigned &Idx; + SourceLocation ReadSourceLocation(const ASTReader::RecordData &R, + unsigned &I) { + return Reader.ReadSourceLocation(F, R, I); + } + SourceRange ReadSourceRange(const ASTReader::RecordData &R, unsigned &I) { + return Reader.ReadSourceRange(F, R, I); + } + TypeSourceInfo *GetTypeSourceInfo(const ASTReader::RecordData &R, + unsigned &I) { + return Reader.GetTypeSourceInfo(F, R, I); + } + public: - ASTStmtReader(ASTReader &Reader, llvm::BitstreamCursor &Cursor, + ASTStmtReader(ASTReader &Reader, ASTReader::PerFileData &F, + llvm::BitstreamCursor &Cursor, const ASTReader::RecordData &Record, unsigned &Idx) - : Reader(Reader), DeclsCursor(Cursor), Record(Record), Idx(Idx) { } + : Reader(Reader), F(F), DeclsCursor(Cursor), Record(Record), Idx(Idx) { } /// \brief The number of record fields required for the Stmt class /// itself. @@ -164,11 +178,11 @@ void ASTStmtReader:: ReadExplicitTemplateArgumentList(ExplicitTemplateArgumentList &ArgList, unsigned NumTemplateArgs) { TemplateArgumentListInfo ArgInfo; - ArgInfo.setLAngleLoc(Reader.ReadSourceLocation(Record, Idx)); - ArgInfo.setRAngleLoc(Reader.ReadSourceLocation(Record, Idx)); + ArgInfo.setLAngleLoc(ReadSourceLocation(Record, Idx)); + ArgInfo.setRAngleLoc(ReadSourceLocation(Record, Idx)); for (unsigned i = 0; i != NumTemplateArgs; ++i) ArgInfo.addArgument( - Reader.ReadTemplateArgumentLoc(DeclsCursor, Record, Idx)); + Reader.ReadTemplateArgumentLoc(F, Record, Idx)); ArgList.initializeFrom(ArgInfo); } @@ -178,7 +192,7 @@ void ASTStmtReader::VisitStmt(Stmt *S) { void ASTStmtReader::VisitNullStmt(NullStmt *S) { VisitStmt(S); - S->setSemiLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setSemiLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitCompoundStmt(CompoundStmt *S) { @@ -188,8 +202,8 @@ void ASTStmtReader::VisitCompoundStmt(CompoundStmt *S) { while (NumStmts--) Stmts.push_back(Reader.ReadSubStmt()); S->setStmts(*Reader.getContext(), Stmts.data(), Stmts.size()); - S->setLBracLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setRBracLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setLBracLoc(ReadSourceLocation(Record, Idx)); + S->setRBracLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitSwitchCase(SwitchCase *S) { @@ -202,23 +216,23 @@ void ASTStmtReader::VisitCaseStmt(CaseStmt *S) { S->setLHS(Reader.ReadSubExpr()); S->setRHS(Reader.ReadSubExpr()); S->setSubStmt(Reader.ReadSubStmt()); - S->setCaseLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setEllipsisLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setColonLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setCaseLoc(ReadSourceLocation(Record, Idx)); + S->setEllipsisLoc(ReadSourceLocation(Record, Idx)); + S->setColonLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitDefaultStmt(DefaultStmt *S) { VisitSwitchCase(S); S->setSubStmt(Reader.ReadSubStmt()); - S->setDefaultLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setColonLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setDefaultLoc(ReadSourceLocation(Record, Idx)); + S->setColonLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitLabelStmt(LabelStmt *S) { VisitStmt(S); S->setID(Reader.GetIdentifierInfo(Record, Idx)); S->setSubStmt(Reader.ReadSubStmt()); - S->setIdentLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setIdentLoc(ReadSourceLocation(Record, Idx)); S->setUsed(Record[Idx++]); S->setUnusedAttribute(Record[Idx++]); Reader.RecordLabelStmt(S, Record[Idx++]); @@ -231,8 +245,8 @@ void ASTStmtReader::VisitIfStmt(IfStmt *S) { S->setCond(Reader.ReadSubExpr()); S->setThen(Reader.ReadSubStmt()); S->setElse(Reader.ReadSubStmt()); - S->setIfLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setElseLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setIfLoc(ReadSourceLocation(Record, Idx)); + S->setElseLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitSwitchStmt(SwitchStmt *S) { @@ -241,7 +255,7 @@ void ASTStmtReader::VisitSwitchStmt(SwitchStmt *S) { cast_or_null<VarDecl>(Reader.GetDecl(Record[Idx++]))); S->setCond(Reader.ReadSubExpr()); S->setBody(Reader.ReadSubStmt()); - S->setSwitchLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setSwitchLoc(ReadSourceLocation(Record, Idx)); if (Record[Idx++]) S->setAllEnumCasesCovered(); @@ -266,16 +280,16 @@ void ASTStmtReader::VisitWhileStmt(WhileStmt *S) { cast_or_null<VarDecl>(Reader.GetDecl(Record[Idx++]))); S->setCond(Reader.ReadSubExpr()); S->setBody(Reader.ReadSubStmt()); - S->setWhileLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setWhileLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitDoStmt(DoStmt *S) { VisitStmt(S); S->setCond(Reader.ReadSubExpr()); S->setBody(Reader.ReadSubStmt()); - S->setDoLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setWhileLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setDoLoc(ReadSourceLocation(Record, Idx)); + S->setWhileLoc(ReadSourceLocation(Record, Idx)); + S->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitForStmt(ForStmt *S) { @@ -286,46 +300,46 @@ void ASTStmtReader::VisitForStmt(ForStmt *S) { cast_or_null<VarDecl>(Reader.GetDecl(Record[Idx++]))); S->setInc(Reader.ReadSubExpr()); S->setBody(Reader.ReadSubStmt()); - S->setForLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setLParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setForLoc(ReadSourceLocation(Record, Idx)); + S->setLParenLoc(ReadSourceLocation(Record, Idx)); + S->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitGotoStmt(GotoStmt *S) { VisitStmt(S); Reader.SetLabelOf(S, Record[Idx++]); - S->setGotoLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setLabelLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setGotoLoc(ReadSourceLocation(Record, Idx)); + S->setLabelLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitIndirectGotoStmt(IndirectGotoStmt *S) { VisitStmt(S); - S->setGotoLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setStarLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setGotoLoc(ReadSourceLocation(Record, Idx)); + S->setStarLoc(ReadSourceLocation(Record, Idx)); S->setTarget(Reader.ReadSubExpr()); } void ASTStmtReader::VisitContinueStmt(ContinueStmt *S) { VisitStmt(S); - S->setContinueLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setContinueLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitBreakStmt(BreakStmt *S) { VisitStmt(S); - S->setBreakLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setBreakLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitReturnStmt(ReturnStmt *S) { VisitStmt(S); S->setRetValue(Reader.ReadSubExpr()); - S->setReturnLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setReturnLoc(ReadSourceLocation(Record, Idx)); S->setNRVOCandidate(cast_or_null<VarDecl>(Reader.GetDecl(Record[Idx++]))); } void ASTStmtReader::VisitDeclStmt(DeclStmt *S) { VisitStmt(S); - S->setStartLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setEndLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setStartLoc(ReadSourceLocation(Record, Idx)); + S->setEndLoc(ReadSourceLocation(Record, Idx)); if (Idx + 1 == Record.size()) { // Single declaration @@ -346,8 +360,8 @@ void ASTStmtReader::VisitAsmStmt(AsmStmt *S) { unsigned NumOutputs = Record[Idx++]; unsigned NumInputs = Record[Idx++]; unsigned NumClobbers = Record[Idx++]; - S->setAsmLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setAsmLoc(ReadSourceLocation(Record, Idx)); + S->setRParenLoc(ReadSourceLocation(Record, Idx)); S->setVolatile(Record[Idx++]); S->setSimple(Record[Idx++]); S->setMSAsm(Record[Idx++]); @@ -385,7 +399,7 @@ void ASTStmtReader::VisitExpr(Expr *E) { void ASTStmtReader::VisitPredefinedExpr(PredefinedExpr *E) { VisitExpr(E); - E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLocation(ReadSourceLocation(Record, Idx)); E->setIdentType((PredefinedExpr::IdentType)Record[Idx++]); } @@ -400,7 +414,7 @@ void ASTStmtReader::VisitDeclRefExpr(DeclRefExpr *E) { if (HasQualifier) { E->getNameQualifier()->NNS = Reader.ReadNestedNameSpecifier(Record, Idx); - E->getNameQualifier()->Range = Reader.ReadSourceRange(Record, Idx); + E->getNameQualifier()->Range = ReadSourceRange(Record, Idx); } if (NumTemplateArgs) @@ -409,12 +423,12 @@ void ASTStmtReader::VisitDeclRefExpr(DeclRefExpr *E) { E->setDecl(cast<ValueDecl>(Reader.GetDecl(Record[Idx++]))); // FIXME: read DeclarationNameLoc. - E->setLocation(Reader.ReadSourceLocation(Record, Idx)); + E->setLocation(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitIntegerLiteral(IntegerLiteral *E) { VisitExpr(E); - E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLocation(ReadSourceLocation(Record, Idx)); E->setValue(*Reader.getContext(), Reader.ReadAPInt(Record, Idx)); } @@ -422,7 +436,7 @@ void ASTStmtReader::VisitFloatingLiteral(FloatingLiteral *E) { VisitExpr(E); E->setValue(*Reader.getContext(), Reader.ReadAPFloat(Record, Idx)); E->setExact(Record[Idx++]); - E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLocation(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitImaginaryLiteral(ImaginaryLiteral *E) { @@ -445,20 +459,20 @@ void ASTStmtReader::VisitStringLiteral(StringLiteral *E) { // Read source locations for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I) - E->setStrTokenLoc(I, SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setStrTokenLoc(I, ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitCharacterLiteral(CharacterLiteral *E) { VisitExpr(E); E->setValue(Record[Idx++]); - E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLocation(ReadSourceLocation(Record, Idx)); E->setWide(Record[Idx++]); } void ASTStmtReader::VisitParenExpr(ParenExpr *E) { VisitExpr(E); - E->setLParen(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParen(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLParen(ReadSourceLocation(Record, Idx)); + E->setRParen(ReadSourceLocation(Record, Idx)); E->setSubExpr(Reader.ReadSubExpr()); } @@ -469,15 +483,15 @@ void ASTStmtReader::VisitParenListExpr(ParenListExpr *E) { for (unsigned i = 0; i != NumExprs; ++i) E->Exprs[i] = Reader.ReadSubStmt(); E->NumExprs = NumExprs; - E->LParenLoc = Reader.ReadSourceLocation(Record, Idx); - E->RParenLoc = Reader.ReadSourceLocation(Record, Idx); + E->LParenLoc = ReadSourceLocation(Record, Idx); + E->RParenLoc = ReadSourceLocation(Record, Idx); } void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) { VisitExpr(E); E->setSubExpr(Reader.ReadSubExpr()); E->setOpcode((UnaryOperator::Opcode)Record[Idx++]); - E->setOperatorLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setOperatorLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) { @@ -487,13 +501,13 @@ void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) { ++Idx; assert(E->getNumExpressions() == Record[Idx]); ++Idx; - E->setOperatorLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setTypeSourceInfo(Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx)); + E->setOperatorLoc(ReadSourceLocation(Record, Idx)); + E->setRParenLoc(ReadSourceLocation(Record, Idx)); + E->setTypeSourceInfo(GetTypeSourceInfo(Record, Idx)); for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) { Node::Kind Kind = static_cast<Node::Kind>(Record[Idx++]); - SourceLocation Start = SourceLocation::getFromRawEncoding(Record[Idx++]); - SourceLocation End = SourceLocation::getFromRawEncoding(Record[Idx++]); + SourceLocation Start = ReadSourceLocation(Record, Idx); + SourceLocation End = ReadSourceLocation(Record, Idx); switch (Kind) { case Node::Array: E->setComponent(I, Node(Start, Record[Idx++], End)); @@ -512,7 +526,7 @@ void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) { case Node::Base: { CXXBaseSpecifier *Base = new (*Reader.getContext()) CXXBaseSpecifier(); - *Base = Reader.ReadCXXBaseSpecifier(DeclsCursor, Record, Idx); + *Base = Reader.ReadCXXBaseSpecifier(F, Record, Idx); E->setComponent(I, Node(Base)); break; } @@ -530,23 +544,23 @@ void ASTStmtReader::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) { E->setArgument(Reader.ReadSubExpr()); ++Idx; } else { - E->setArgument(Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx)); + E->setArgument(GetTypeSourceInfo(Record, Idx)); } - E->setOperatorLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setOperatorLoc(ReadSourceLocation(Record, Idx)); + E->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) { VisitExpr(E); E->setLHS(Reader.ReadSubExpr()); E->setRHS(Reader.ReadSubExpr()); - E->setRBracketLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setRBracketLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitCallExpr(CallExpr *E) { VisitExpr(E); E->setNumArgs(*Reader.getContext(), Record[Idx++]); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setRParenLoc(ReadSourceLocation(Record, Idx)); E->setCallee(Reader.ReadSubExpr()); for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I) E->setArg(I, Reader.ReadSubExpr()); @@ -561,7 +575,7 @@ void ASTStmtReader::VisitMemberExpr(MemberExpr *E) { void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) { VisitExpr(E); E->setBase(Reader.ReadSubExpr()); - E->setIsaMemberLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setIsaMemberLoc(ReadSourceLocation(Record, Idx)); E->setArrow(Record[Idx++]); } @@ -574,7 +588,7 @@ void ASTStmtReader::VisitCastExpr(CastExpr *E) { CastExpr::path_iterator BaseI = E->path_begin(); while (NumBaseSpecs--) { CXXBaseSpecifier *BaseSpec = new (*Reader.getContext()) CXXBaseSpecifier; - *BaseSpec = Reader.ReadCXXBaseSpecifier(DeclsCursor, Record, Idx); + *BaseSpec = Reader.ReadCXXBaseSpecifier(F, Record, Idx); *BaseI++ = BaseSpec; } } @@ -584,7 +598,7 @@ void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) { E->setLHS(Reader.ReadSubExpr()); E->setRHS(Reader.ReadSubExpr()); E->setOpcode((BinaryOperator::Opcode)Record[Idx++]); - E->setOperatorLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setOperatorLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) { @@ -599,8 +613,8 @@ void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) { E->setLHS(Reader.ReadSubExpr()); E->setRHS(Reader.ReadSubExpr()); E->setSAVE(Reader.ReadSubExpr()); - E->setQuestionLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setColonLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setQuestionLoc(ReadSourceLocation(Record, Idx)); + E->setColonLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) { @@ -610,19 +624,19 @@ void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) { void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) { VisitCastExpr(E); - E->setTypeInfoAsWritten(Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx)); + E->setTypeInfoAsWritten(GetTypeSourceInfo(Record, Idx)); } void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) { VisitExplicitCastExpr(E); - E->setLParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLParenLoc(ReadSourceLocation(Record, Idx)); + E->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) { VisitExpr(E); - E->setLParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setTypeSourceInfo(Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx)); + E->setLParenLoc(ReadSourceLocation(Record, Idx)); + E->setTypeSourceInfo(GetTypeSourceInfo(Record, Idx)); E->setInitializer(Reader.ReadSubExpr()); E->setFileScope(Record[Idx++]); } @@ -631,7 +645,7 @@ void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) { VisitExpr(E); E->setBase(Reader.ReadSubExpr()); E->setAccessor(Reader.GetIdentifierInfo(Record, Idx)); - E->setAccessorLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setAccessorLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitInitListExpr(InitListExpr *E) { @@ -641,8 +655,8 @@ void ASTStmtReader::VisitInitListExpr(InitListExpr *E) { for (unsigned I = 0; I != NumInits; ++I) E->updateInit(*Reader.getContext(), I, Reader.ReadSubExpr()); E->setSyntacticForm(cast_or_null<InitListExpr>(Reader.ReadSubStmt())); - E->setLBraceLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRBraceLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLBraceLoc(ReadSourceLocation(Record, Idx)); + E->setRBraceLoc(ReadSourceLocation(Record, Idx)); E->setInitializedFieldInUnion( cast_or_null<FieldDecl>(Reader.GetDecl(Record[Idx++]))); E->sawArrayRangeDesignator(Record[Idx++]); @@ -656,7 +670,7 @@ void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) { assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs"); for (unsigned I = 0; I != NumSubExprs; ++I) E->setSubExpr(I, Reader.ReadSubExpr()); - E->setEqualOrColonLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setEqualOrColonLoc(ReadSourceLocation(Record, Idx)); E->setGNUSyntax(Record[Idx++]); llvm::SmallVector<Designator, 4> Designators; @@ -665,9 +679,9 @@ void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) { case DESIG_FIELD_DECL: { FieldDecl *Field = cast<FieldDecl>(Reader.GetDecl(Record[Idx++])); SourceLocation DotLoc - = SourceLocation::getFromRawEncoding(Record[Idx++]); + = ReadSourceLocation(Record, Idx); SourceLocation FieldLoc - = SourceLocation::getFromRawEncoding(Record[Idx++]); + = ReadSourceLocation(Record, Idx); Designators.push_back(Designator(Field->getIdentifier(), DotLoc, FieldLoc)); Designators.back().setField(Field); @@ -677,9 +691,9 @@ void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) { case DESIG_FIELD_NAME: { const IdentifierInfo *Name = Reader.GetIdentifierInfo(Record, Idx); SourceLocation DotLoc - = SourceLocation::getFromRawEncoding(Record[Idx++]); + = ReadSourceLocation(Record, Idx); SourceLocation FieldLoc - = SourceLocation::getFromRawEncoding(Record[Idx++]); + = ReadSourceLocation(Record, Idx); Designators.push_back(Designator(Name, DotLoc, FieldLoc)); break; } @@ -687,9 +701,9 @@ void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) { case DESIG_ARRAY: { unsigned Index = Record[Idx++]; SourceLocation LBracketLoc - = SourceLocation::getFromRawEncoding(Record[Idx++]); + = ReadSourceLocation(Record, Idx); SourceLocation RBracketLoc - = SourceLocation::getFromRawEncoding(Record[Idx++]); + = ReadSourceLocation(Record, Idx); Designators.push_back(Designator(Index, LBracketLoc, RBracketLoc)); break; } @@ -697,11 +711,11 @@ void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) { case DESIG_ARRAY_RANGE: { unsigned Index = Record[Idx++]; SourceLocation LBracketLoc - = SourceLocation::getFromRawEncoding(Record[Idx++]); + = ReadSourceLocation(Record, Idx); SourceLocation EllipsisLoc - = SourceLocation::getFromRawEncoding(Record[Idx++]); + = ReadSourceLocation(Record, Idx); SourceLocation RBracketLoc - = SourceLocation::getFromRawEncoding(Record[Idx++]); + = ReadSourceLocation(Record, Idx); Designators.push_back(Designator(Index, LBracketLoc, EllipsisLoc, RBracketLoc)); break; @@ -719,31 +733,31 @@ void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) { void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) { VisitExpr(E); E->setSubExpr(Reader.ReadSubExpr()); - E->setWrittenTypeInfo(Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx)); - E->setBuiltinLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setWrittenTypeInfo(GetTypeSourceInfo(Record, Idx)); + E->setBuiltinLoc(ReadSourceLocation(Record, Idx)); + E->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) { VisitExpr(E); - E->setAmpAmpLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setLabelLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setAmpAmpLoc(ReadSourceLocation(Record, Idx)); + E->setLabelLoc(ReadSourceLocation(Record, Idx)); Reader.SetLabelOf(E, Record[Idx++]); } void ASTStmtReader::VisitStmtExpr(StmtExpr *E) { VisitExpr(E); - E->setLParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLParenLoc(ReadSourceLocation(Record, Idx)); + E->setRParenLoc(ReadSourceLocation(Record, Idx)); E->setSubStmt(cast_or_null<CompoundStmt>(Reader.ReadSubStmt())); } void ASTStmtReader::VisitTypesCompatibleExpr(TypesCompatibleExpr *E) { VisitExpr(E); - E->setArgTInfo1(Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx)); - E->setArgTInfo2(Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx)); - E->setBuiltinLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setArgTInfo1(GetTypeSourceInfo(Record, Idx)); + E->setArgTInfo2(GetTypeSourceInfo(Record, Idx)); + E->setBuiltinLoc(ReadSourceLocation(Record, Idx)); + E->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) { @@ -751,13 +765,13 @@ void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) { E->setCond(Reader.ReadSubExpr()); E->setLHS(Reader.ReadSubExpr()); E->setRHS(Reader.ReadSubExpr()); - E->setBuiltinLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setBuiltinLoc(ReadSourceLocation(Record, Idx)); + E->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) { VisitExpr(E); - E->setTokenLocation(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setTokenLocation(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) { @@ -767,8 +781,8 @@ void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) { while (NumExprs--) Exprs.push_back(Reader.ReadSubExpr()); E->setExprs(*Reader.getContext(), Exprs.data(), Exprs.size()); - E->setBuiltinLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setBuiltinLoc(ReadSourceLocation(Record, Idx)); + E->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitBlockExpr(BlockExpr *E) { @@ -780,7 +794,7 @@ void ASTStmtReader::VisitBlockExpr(BlockExpr *E) { void ASTStmtReader::VisitBlockDeclRefExpr(BlockDeclRefExpr *E) { VisitExpr(E); E->setDecl(cast<ValueDecl>(Reader.GetDecl(Record[Idx++]))); - E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLocation(ReadSourceLocation(Record, Idx)); E->setByRef(Record[Idx++]); E->setConstQualAdded(Record[Idx++]); E->setCopyConstructorExpr(Reader.ReadSubExpr()); @@ -792,34 +806,34 @@ void ASTStmtReader::VisitBlockDeclRefExpr(BlockDeclRefExpr *E) { void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) { VisitExpr(E); E->setString(cast<StringLiteral>(Reader.ReadSubStmt())); - E->setAtLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setAtLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) { VisitExpr(E); - E->setEncodedTypeSourceInfo(Reader.GetTypeSourceInfo(DeclsCursor,Record,Idx)); - E->setAtLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setEncodedTypeSourceInfo(GetTypeSourceInfo(Record, Idx)); + E->setAtLoc(ReadSourceLocation(Record, Idx)); + E->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) { VisitExpr(E); E->setSelector(Reader.GetSelector(Record, Idx)); - E->setAtLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setAtLoc(ReadSourceLocation(Record, Idx)); + E->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) { VisitExpr(E); E->setProtocol(cast<ObjCProtocolDecl>(Reader.GetDecl(Record[Idx++]))); - E->setAtLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setAtLoc(ReadSourceLocation(Record, Idx)); + E->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) { VisitExpr(E); E->setDecl(cast<ObjCIvarDecl>(Reader.GetDecl(Record[Idx++]))); - E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLocation(ReadSourceLocation(Record, Idx)); E->setBase(Reader.ReadSubExpr()); E->setIsArrow(Record[Idx++]); E->setIsFreeIvar(Record[Idx++]); @@ -828,7 +842,7 @@ void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) { void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) { VisitExpr(E); E->setProperty(cast<ObjCPropertyDecl>(Reader.GetDecl(Record[Idx++]))); - E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLocation(ReadSourceLocation(Record, Idx)); E->setBase(Reader.ReadSubExpr()); } @@ -842,8 +856,8 @@ void ASTStmtReader::VisitObjCImplicitSetterGetterRefExpr( E->setInterfaceDecl( cast_or_null<ObjCInterfaceDecl>(Reader.GetDecl(Record[Idx++]))); E->setBase(Reader.ReadSubExpr()); - E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setClassLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLocation(ReadSourceLocation(Record, Idx)); + E->setClassLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) { @@ -858,13 +872,13 @@ void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) { break; case ObjCMessageExpr::Class: - E->setClassReceiver(Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx)); + E->setClassReceiver(GetTypeSourceInfo(Record, Idx)); break; case ObjCMessageExpr::SuperClass: case ObjCMessageExpr::SuperInstance: { QualType T = Reader.GetType(Record[Idx++]); - SourceLocation SuperLoc = SourceLocation::getFromRawEncoding(Record[Idx++]); + SourceLocation SuperLoc = ReadSourceLocation(Record, Idx); E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance); break; } @@ -877,8 +891,8 @@ void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) { else E->setSelector(Reader.GetSelector(Record, Idx)); - E->setLeftLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRightLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLeftLoc(ReadSourceLocation(Record, Idx)); + E->setRightLoc(ReadSourceLocation(Record, Idx)); for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I) E->setArg(I, Reader.ReadSubExpr()); @@ -886,7 +900,7 @@ void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) { void ASTStmtReader::VisitObjCSuperExpr(ObjCSuperExpr *E) { VisitExpr(E); - E->setLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) { @@ -894,22 +908,22 @@ void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) { S->setElement(Reader.ReadSubStmt()); S->setCollection(Reader.ReadSubExpr()); S->setBody(Reader.ReadSubStmt()); - S->setForLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setForLoc(ReadSourceLocation(Record, Idx)); + S->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) { VisitStmt(S); S->setCatchBody(Reader.ReadSubStmt()); S->setCatchParamDecl(cast_or_null<VarDecl>(Reader.GetDecl(Record[Idx++]))); - S->setAtCatchLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - S->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setAtCatchLoc(ReadSourceLocation(Record, Idx)); + S->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) { VisitStmt(S); S->setFinallyBody(Reader.ReadSubStmt()); - S->setAtFinallyLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setAtFinallyLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) { @@ -923,20 +937,20 @@ void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) { if (HasFinally) S->setFinallyStmt(Reader.ReadSubStmt()); - S->setAtTryLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setAtTryLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) { VisitStmt(S); S->setSynchExpr(Reader.ReadSubStmt()); S->setSynchBody(Reader.ReadSubStmt()); - S->setAtSynchronizedLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setAtSynchronizedLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) { VisitStmt(S); S->setThrowExpr(Reader.ReadSubStmt()); - S->setThrowLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setThrowLoc(ReadSourceLocation(Record, Idx)); } //===----------------------------------------------------------------------===// @@ -945,7 +959,7 @@ void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) { void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) { VisitStmt(S); - S->CatchLoc = Reader.ReadSourceLocation(Record, Idx); + S->CatchLoc = ReadSourceLocation(Record, Idx); S->ExceptionDecl = cast_or_null<VarDecl>(Reader.GetDecl(Record[Idx++])); S->HandlerBlock = Reader.ReadSubStmt(); } @@ -954,7 +968,7 @@ void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) { VisitStmt(S); assert(Record[Idx] == S->getNumHandlers() && "NumStmtFields is wrong ?"); ++Idx; - S->TryLoc = Reader.ReadSourceLocation(Record, Idx); + S->TryLoc = ReadSourceLocation(Record, Idx); S->getStmts()[0] = Reader.ReadSubStmt(); for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i) S->getStmts()[i + 1] = Reader.ReadSubStmt(); @@ -973,7 +987,7 @@ void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) { for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I) E->setArg(I, Reader.ReadSubExpr()); E->setConstructor(cast<CXXConstructorDecl>(Reader.GetDecl(Record[Idx++]))); - E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLocation(ReadSourceLocation(Record, Idx)); E->setElidable(Record[Idx++]); E->setRequiresZeroInitialization(Record[Idx++]); E->setConstructionKind((CXXConstructExpr::ConstructionKind)Record[Idx++]); @@ -981,13 +995,13 @@ void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) { void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) { VisitCXXConstructExpr(E); - E->Type = Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx); - E->RParenLoc = Reader.ReadSourceLocation(Record, Idx); + E->Type = GetTypeSourceInfo(Record, Idx); + E->RParenLoc = ReadSourceLocation(Record, Idx); } void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) { VisitExplicitCastExpr(E); - E->setOperatorLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setOperatorLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) { @@ -1008,27 +1022,27 @@ void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) { void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) { VisitExplicitCastExpr(E); - E->setTypeBeginLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setTypeBeginLoc(ReadSourceLocation(Record, Idx)); + E->setRParenLoc(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) { VisitExpr(E); E->setValue(Record[Idx++]); - E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLocation(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) { VisitExpr(E); - E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLocation(ReadSourceLocation(Record, Idx)); } void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) { VisitExpr(E); - E->setSourceRange(Reader.ReadSourceRange(Record, Idx)); + E->setSourceRange(ReadSourceRange(Record, Idx)); if (E->isTypeOperand()) { // typeid(int) E->setTypeOperandSourceInfo( - Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx)); + GetTypeSourceInfo(Record, Idx)); return; } @@ -1037,10 +1051,10 @@ void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) { } void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) { VisitExpr(E); - E->setSourceRange(Reader.ReadSourceRange(Record, Idx)); + E->setSourceRange(ReadSourceRange(Record, Idx)); if (E->isTypeOperand()) { // __uuidof(ComType) E->setTypeOperandSourceInfo( - Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx)); + GetTypeSourceInfo(Record, Idx)); return; } @@ -1050,13 +1064,13 @@ void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) { void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) { VisitExpr(E); - E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setLocation(ReadSourceLocation(Record, Idx)); E->setImplicit(Record[Idx++]); } void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) { VisitExpr(E); - E->setThrowLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setThrowLoc(ReadSourceLocation(Record, Idx)); E->setSubExpr(Reader.ReadSubExpr()); } @@ -1066,7 +1080,7 @@ void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) { assert(Record[Idx] == E->Param.getInt() && "We messed up at creation ?"); ++Idx; // HasOtherExprStored and SubExpr was handled during creation. E->Param.setPointer(cast<ParmVarDecl>(Reader.GetDecl(Record[Idx++]))); - E->Loc = Reader.ReadSourceLocation(Record, Idx); + E->Loc = ReadSourceLocation(Record, Idx); } void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) { @@ -1077,8 +1091,8 @@ void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) { void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) { VisitExpr(E); - E->TypeInfo = Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx); - E->RParenLoc = SourceLocation::getFromRawEncoding(Record[Idx++]); + E->TypeInfo = GetTypeSourceInfo(Record, Idx); + E->RParenLoc = ReadSourceLocation(Record, Idx); } void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) { @@ -1093,13 +1107,13 @@ void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) { cast_or_null<FunctionDecl>(Reader.GetDecl(Record[Idx++]))); E->setConstructor( cast_or_null<CXXConstructorDecl>(Reader.GetDecl(Record[Idx++]))); - E->AllocatedTypeInfo = Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx); + E->AllocatedTypeInfo |