[cfe-commits] r136340 - /cfe/trunk/NOTES.txt

John McCall rjmccall at apple.com
Thu Jul 28 00:41:22 PDT 2011


Author: rjmccall
Date: Thu Jul 28 02:41:22 2011
New Revision: 136340

URL: http://llvm.org/viewvc/llvm-project?rev=136340&view=rev
Log:
Make a note about a missing optimization.


Modified:
    cfe/trunk/NOTES.txt

Modified: cfe/trunk/NOTES.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/NOTES.txt?rev=136340&r1=136339&r2=136340&view=diff
==============================================================================
--- cfe/trunk/NOTES.txt (original)
+++ cfe/trunk/NOTES.txt Thu Jul 28 02:41:22 2011
@@ -83,3 +83,21 @@
 };
 
 //===---------------------------------------------------------------------===//
+
+Blocks should not capture variables that are only used in dead code.
+
+The rule that we came up with is that blocks are required to capture
+variables if they're referenced in evaluated code, even if that code
+doesn't actually rely on the value of the captured variable.
+
+For example, this requires a capture:
+  (void) var;
+But this does not:
+  if (false) puts(var);
+
+Summary of <rdar://problem/9851835>: if we implement this, we should
+warn about non-POD variables that are referenced but not captured, but
+only if the non-reachability is not due to macro or template
+metaprogramming.
+
+//===---------------------------------------------------------------------===//





More information about the cfe-commits mailing list