avt77 added inline comments.
================ Comment at: lib/Sema/SemaLambda.cpp:1447 + getFrontendFunctionTimeCtx<const FunctionDecl *>()->startFrontendTimer( + {LSI.CallOperator, 0.0}); + } ---------------- efriedma wrote: > This seems sort of late? You're starting the timer after the body has > already been parsed. Yes and no but if we decided to extend usage of RAII objects - it deos not matter. I'll change it. ================ Comment at: lib/Sema/TreeTransform.h:11011 + getFrontendFunctionTimeCtx<const FunctionDecl *>()->startFrontendTimer( + {NewCallOperator, 0.0}); + } ---------------- efriedma wrote: > What happens if we never hit ActOnFinishFunctionBody()? TransformLambdaExpr > has an early return if the body doesn't typecheck. > > More generally, given that we have early returns all over the place in Sema, > I would be more comfortable using the RAII helper, rather than explicitly > calling start/stop, even if that means you have to insert FrontendTimeRAII > variables in half a dozen different places in the parser. (Note I'm > specifically talking about the parser here; the explicit stopFrontendTimer in > ~CodeGenFunction seems fine.) It seems you're right: usage of RAII objects is safely. OK, I'll change it. https://reviews.llvm.org/D47196 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits