]> granicus.if.org Git - clang/commitdiff
give location info to another paren expr.
authorChris Lattner <sabre@nondot.org>
Wed, 28 May 2008 16:38:23 +0000 (16:38 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 28 May 2008 16:38:23 +0000 (16:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51646 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteObjC.cpp

index eb9d01256497bd92efcb2a188d0667c801c6f1d5..6d49c7eef06cc54349083e77696f546e07704c52 100644 (file)
@@ -875,7 +875,8 @@ Stmt *RewriteObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV,
       QualType castT = Context->getPointerType(Context->getTagDeclType(RD));
       CastExpr *castExpr = new CastExpr(castT, IV->getBase(), SourceLocation());
       // Don't forget the parens to enforce the proper binding.
-      ParenExpr *PE = new ParenExpr(SourceLocation(), SourceLocation(), castExpr);
+      ParenExpr *PE = new ParenExpr(IV->getBase()->getLocStart(),
+                                    IV->getBase()->getLocEnd(), castExpr);
       ReplaceStmt(IV->getBase(), PE);
       // Cannot delete IV->getBase(), since PE points to it.
       // Replace the old base with the cast. This is important when doing