]> granicus.if.org Git - clang/commitdiff
This is an attempt to improve loc info for 'unused result' expression
authorChris Lattner <sabre@nondot.org>
Sun, 16 Aug 2009 16:45:18 +0000 (16:45 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 16 Aug 2009 16:45:18 +0000 (16:45 +0000)
warnings, but it fails because we don't have the location of the .
and I don't understand ObjCKVCRefExpr.  I'll revisit this later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79190 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Expr.cpp

index fa5ce9f0478fce0f7058210146ef4c44fc5d4758..f000ff63d0bc0cdf9d1a59c50a1df52ec755b7e8 100644 (file)
@@ -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.