arphaman added inline comments.

================
Comment at: lib/Sema/SemaDeclAttr.cpp:7151
+    Visitor.Scope = Scope;
+    Visitor.TraverseStmt(const_cast<CompoundStmt *>(Scope));
+    return Visitor.LastMatchingDREFirstNonScopeStmt;
----------------
erik.pilkington wrote:
> I think this could be simplified: If we iterate backwards through the 
> CompoundStmt::body(), calling `RecursiveASTVisitor::TraverseStmt()`, and bail 
> out if we encounter a `DeclRefExpr` to D, returning the current Stmt. This 
> also has the advantage that we don't have to iterate forward through the 
> CompoundStmt when we're looking for the last Child Stmt. Have you considered 
> this option?
Good idea, I will change this code.


Repository:
  rL LLVM

https://reviews.llvm.org/D32424



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to