diff options
author | John McCall <rjmccall@apple.com> | 2010-01-18 19:35:47 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-01-18 19:35:47 +0000 |
commit | e15bbff98dbbce2e3253bcc5489712ec011e2f60 (patch) | |
tree | fa434abbfa96611a7d073cd798de2b51a3aab238 /clang/lib/Frontend/RewriteObjC.cpp | |
parent | 9a48db1659dbd53cc71ecf940fb6a865f2ee4e26 (diff) | |
download | bcm5719-llvm-e15bbff98dbbce2e3253bcc5489712ec011e2f60.tar.gz bcm5719-llvm-e15bbff98dbbce2e3253bcc5489712ec011e2f60.zip |
Preserve type source information in compound literal expressions.
Patch by Enea Zaffanella!
llvm-svn: 93752
Diffstat (limited to 'clang/lib/Frontend/RewriteObjC.cpp')
-rw-r--r-- | clang/lib/Frontend/RewriteObjC.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
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 { |