diff options
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r-- | clang/lib/Frontend/PCHReaderStmt.cpp | 1 | ||||
-rw-r--r-- | clang/lib/Frontend/PCHWriterStmt.cpp | 1 | ||||
-rw-r--r-- | clang/lib/Frontend/RewriteObjC.cpp | 11 |
3 files changed, 10 insertions, 3 deletions
diff --git a/clang/lib/Frontend/PCHReaderStmt.cpp b/clang/lib/Frontend/PCHReaderStmt.cpp index c49f5e8fa45..21c9cbf17cd 100644 --- a/clang/lib/Frontend/PCHReaderStmt.cpp +++ b/clang/lib/Frontend/PCHReaderStmt.cpp @@ -533,6 +533,7 @@ unsigned PCHStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) { unsigned PCHStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) { VisitExpr(E); E->setLParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setTypeSourceInfo(Reader.GetTypeSourceInfo(Record, Idx)); E->setInitializer(cast<Expr>(StmtStack.back())); E->setFileScope(Record[Idx++]); return 1; diff --git a/clang/lib/Frontend/PCHWriterStmt.cpp b/clang/lib/Frontend/PCHWriterStmt.cpp index a5ad859b651..fdfdfefe08e 100644 --- a/clang/lib/Frontend/PCHWriterStmt.cpp +++ b/clang/lib/Frontend/PCHWriterStmt.cpp @@ -496,6 +496,7 @@ void PCHStmtWriter::VisitCStyleCastExpr(CStyleCastExpr *E) { void PCHStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) { VisitExpr(E); Writer.AddSourceLocation(E->getLParenLoc(), Record); + Writer.AddTypeSourceInfo(E->getTypeSourceInfo(), Record); Writer.WriteSubStmt(E->getInitializer()); Record.push_back(E->isFileScope()); Code = pch::EXPR_COMPOUND_LITERAL; diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp index 68c23c708aa..5a5b0eada3a 100644 --- a/clang/lib/Frontend/RewriteObjC.cpp +++ b/clang/lib/Frontend/RewriteObjC.cpp @@ -2514,8 +2514,10 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp) { InitListExpr *ILE = new (Context) InitListExpr(SourceLocation(), &InitExprs[0], InitExprs.size(), SourceLocation()); - SuperRep = new (Context) CompoundLiteralExpr(SourceLocation(), superType, ILE, - false); + TypeSourceInfo *superTInfo + = Context->getTrivialTypeSourceInfo(superType); + SuperRep = new (Context) CompoundLiteralExpr(SourceLocation(), + superTInfo, ILE, false); // struct objc_super * SuperRep = new (Context) UnaryOperator(SuperRep, UnaryOperator::AddrOf, Context->getPointerType(SuperRep->getType()), @@ -2597,7 +2599,10 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp) { InitListExpr *ILE = new (Context) InitListExpr(SourceLocation(), &InitExprs[0], InitExprs.size(), SourceLocation()); - SuperRep = new (Context) CompoundLiteralExpr(SourceLocation(), superType, ILE, false); + TypeSourceInfo *superTInfo + = Context->getTrivialTypeSourceInfo(superType); + SuperRep = new (Context) CompoundLiteralExpr(SourceLocation(), + superTInfo, ILE, false); } MsgExprs.push_back(SuperRep); } else { |