summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/RewriteObjC.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-01-18 19:35:47 +0000
committerJohn McCall <rjmccall@apple.com>2010-01-18 19:35:47 +0000
commite15bbff98dbbce2e3253bcc5489712ec011e2f60 (patch)
treefa434abbfa96611a7d073cd798de2b51a3aab238 /clang/lib/Frontend/RewriteObjC.cpp
parent9a48db1659dbd53cc71ecf940fb6a865f2ee4e26 (diff)
downloadbcm5719-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.cpp11
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 {
OpenPOWER on IntegriCloud