[llvm-branch-commits] [cfe-branch] r111416 - in /cfe/branches/Apple/williamson: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Basic/DiagnosticSemaKinds.td.orig lib/Sema/SemaExpr.cpp lib/Sema/SemaExpr.cpp.orig test/SemaObjC/conflict-nonfragile-abi2.m
Daniel Dunbar
daniel at zuster.org
Wed Aug 18 13:33:52 PDT 2010
Author: ddunbar
Date: Wed Aug 18 15:33:52 2010
New Revision: 111416
URL: http://llvm.org/viewvc/llvm-project?rev=111416&view=rev
Log:
Merge r111023:
--
Author: Fariborz Jahanian <fjahanian at apple.com>
Date: Fri Aug 13 18:09:39 2010 +0000
When issuing warning for future conflict resolution,
(nonfragile-abi2), do not consider 'ivar' access
in class methods. Also, improve on diagnostics.
Radar 8304561.
Added:
cfe/branches/Apple/williamson/include/clang/Basic/DiagnosticSemaKinds.td.orig
- copied, changed from r111415, cfe/branches/Apple/williamson/include/clang/Basic/DiagnosticSemaKinds.td
cfe/branches/Apple/williamson/lib/Sema/SemaExpr.cpp.orig
- copied, changed from r111415, cfe/branches/Apple/williamson/lib/Sema/SemaExpr.cpp
Modified:
cfe/branches/Apple/williamson/include/clang/Basic/DiagnosticSemaKinds.td
cfe/branches/Apple/williamson/lib/Sema/SemaExpr.cpp
cfe/branches/Apple/williamson/test/SemaObjC/conflict-nonfragile-abi2.m
Modified: cfe/branches/Apple/williamson/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/williamson/include/clang/Basic/DiagnosticSemaKinds.td?rev=111416&r1=111415&r2=111416&view=diff
==============================================================================
--- cfe/branches/Apple/williamson/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/branches/Apple/williamson/include/clang/Basic/DiagnosticSemaKinds.td Wed Aug 18 15:33:52 2010
@@ -2501,8 +2501,10 @@
"%0 is always %select{zero|false|NULL}1 in this context">;
def warn_ivar_variable_conflict : Warning<
- "%0 lookup will access the property ivar in nonfragile-abi2 mode">,
+ "when default property synthesis is on, "
+ "%0 lookup will access property ivar instead of global variable">,
InGroup<NonfragileAbi2>;
+def note_global_declared_at : Note<"global variable declared here">;
// assignment related diagnostics (also for argument passing, returning, etc).
// In most of these diagnostics the %2 is a value from the
Copied: cfe/branches/Apple/williamson/include/clang/Basic/DiagnosticSemaKinds.td.orig (from r111415, cfe/branches/Apple/williamson/include/clang/Basic/DiagnosticSemaKinds.td)
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/williamson/include/clang/Basic/DiagnosticSemaKinds.td.orig?p2=cfe/branches/Apple/williamson/include/clang/Basic/DiagnosticSemaKinds.td.orig&p1=cfe/branches/Apple/williamson/include/clang/Basic/DiagnosticSemaKinds.td&r1=111415&r2=111416&rev=111416&view=diff
==============================================================================
(empty)
Modified: cfe/branches/Apple/williamson/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/williamson/lib/Sema/SemaExpr.cpp?rev=111416&r1=111415&r2=111416&view=diff
==============================================================================
--- cfe/branches/Apple/williamson/lib/Sema/SemaExpr.cpp (original)
+++ cfe/branches/Apple/williamson/lib/Sema/SemaExpr.cpp Wed Aug 18 15:33:52 2010
@@ -1126,6 +1126,8 @@
return ActOnIdExpression(S, SS, Id, HasTrailingLParen,
isAddressOfOperand);
}
+ // for further use, this must be set to false if in class method.
+ IvarLookupFollowUp = getCurMethodDecl()->isInstanceMethod();
}
}
@@ -1177,6 +1179,7 @@
if (Property) {
Diag(NameLoc, diag::warn_ivar_variable_conflict) << Var->getDeclName();
Diag(Property->getLocation(), diag::note_property_declare);
+ Diag(Var->getLocation(), diag::note_global_declared_at);
}
}
Copied: cfe/branches/Apple/williamson/lib/Sema/SemaExpr.cpp.orig (from r111415, cfe/branches/Apple/williamson/lib/Sema/SemaExpr.cpp)
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/williamson/lib/Sema/SemaExpr.cpp.orig?p2=cfe/branches/Apple/williamson/lib/Sema/SemaExpr.cpp.orig&p1=cfe/branches/Apple/williamson/lib/Sema/SemaExpr.cpp&r1=111415&r2=111416&rev=111416&view=diff
==============================================================================
(empty)
Modified: cfe/branches/Apple/williamson/test/SemaObjC/conflict-nonfragile-abi2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/williamson/test/SemaObjC/conflict-nonfragile-abi2.m?rev=111416&r1=111415&r2=111416&view=diff
==============================================================================
--- cfe/branches/Apple/williamson/test/SemaObjC/conflict-nonfragile-abi2.m (original)
+++ cfe/branches/Apple/williamson/test/SemaObjC/conflict-nonfragile-abi2.m Wed Aug 18 15:33:52 2010
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fobjc-nonfragile-abi -verify -fsyntax-only %s
// rdar : // 8225011
-int glob;
+int glob; // expected-note {{global variable declared here}}
@interface I
@property int glob; // expected-note {{property declared here}}
@@ -13,7 +13,7 @@
@end
@implementation I
-- (int) Meth { return glob; } // expected-warning {{'glob' lookup will access the property ivar in nonfragile-abi2 mode}}
+- (int) Meth { return glob; } // expected-warning {{when default property synthesis is on, 'glob' lookup will access}}
@synthesize glob;
// rdar: // 8248681
- (int) Meth1: (int) p {
More information about the llvm-branch-commits
mailing list