[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 20 16:20:46 PDT 2018


leonardchan added a comment.

In https://reviews.llvm.org/D49511#1168692, @rsmith wrote:

> The way in which you're checking for the problematic cases is unnecessarily expensive. Instead of performing a separate AST traversal, please detect whether you should be producing the warning directly when forming the problematic expressions. (For example, you could store a list of pending "dereference of noderef" expressions in the `ExpressionEvaluationContextRecord`, remove items from the list if you find they're the operand of a unary address-of operator, and diagnose any remaining items once you've left the evaluation context.)


Done. I opted for not using `ExpressionEvaluationContextRecord` because I don't think I was using it correctly. A few other tests in sema failed when I tried pushing and popping from the stack holding these. I still process expressions as they are parsed though without using AST traversal on every expression.


Repository:
  rC Clang

https://reviews.llvm.org/D49511





More information about the cfe-commits mailing list