Skip to content

Commit fabe079

Browse files
committed
Make a note about a missing optimization.
llvm-svn: 136340
1 parent fa28440 commit fabe079

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

clang/NOTES.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,21 @@ enum VerifyConstraintResult {
8383
};
8484

8585
//===---------------------------------------------------------------------===//
86+
87+
Blocks should not capture variables that are only used in dead code.
88+
89+
The rule that we came up with is that blocks are required to capture
90+
variables if they're referenced in evaluated code, even if that code
91+
doesn't actually rely on the value of the captured variable.
92+
93+
For example, this requires a capture:
94+
(void) var;
95+
But this does not:
96+
if (false) puts(var);
97+
98+
Summary of <rdar://problem/9851835>: if we implement this, we should
99+
warn about non-POD variables that are referenced but not captured, but
100+
only if the non-reachability is not due to macro or template
101+
metaprogramming.
102+
103+
//===---------------------------------------------------------------------===//

0 commit comments

Comments
 (0)