summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-16 16:45:18 +0000
committerChris Lattner <sabre@nondot.org>2009-08-16 16:45:18 +0000
commitd8b800ad31f87779fa0f2decffc6564458c0a359 (patch)
tree983d124402dd5eef1b5f213bd281441997d3d540 /clang
parent2c64130c4320b2bb53db71f737faadd0cc493cd3 (diff)
downloadbcm5719-llvm-d8b800ad31f87779fa0f2decffc6564458c0a359.tar.gz
bcm5719-llvm-d8b800ad31f87779fa0f2decffc6564458c0a359.zip
This is an attempt to improve loc info for 'unused result' expression
warnings, but it fails because we don't have the location of the . and I don't understand ObjCKVCRefExpr. I'll revisit this later. llvm-svn: 79190
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/AST/Expr.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index fa5ce9f0478..f000ff63d0b 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -541,6 +541,18 @@ bool Expr::isUnusedResultAWarning(SourceLocation &Loc, SourceRange &R1,
}
case ObjCMessageExprClass:
return false;
+
+ case ObjCKVCRefExprClass: { // Dot syntax for message send.
+#if 0
+ const ObjCKVCRefExpr *KVCRef = cast<ObjCKVCRefExpr>(this);
+ // FIXME: We really want the location of the '.' here.
+ Loc = KVCRef->getLocation();
+ R1 = SourceRange(KVCRef->getLocation(), KVCRef->getLocation());
+ if (KVCRef->getBase())
+ R2 = KVCRef->getBase()->getSourceRange();
+#endif
+ return true;
+ }
case StmtExprClass: {
// Statement exprs don't logically have side effects themselves, but are
// sometimes used in macros in ways that give them a type that is unused.
OpenPOWER on IntegriCloud