jlebar added inline comments.
================ Comment at: lib/Sema/SemaExprCXX.cpp:2596 - QualType FnType = Context.getFunctionType(Return, Params, EPI); - FunctionDecl *Alloc = - FunctionDecl::Create(Context, GlobalCtx, SourceLocation(), - SourceLocation(), Name, - FnType, /*TInfo=*/nullptr, SC_None, false, true); - Alloc->setImplicit(); + auto CreateAllocationFunctionDecl = [&]() { + QualType FnType = Context.getFunctionType(Return, Params, EPI); ---------------- Nit, no need for empty parens. ================ Comment at: lib/Sema/SemaExprCXX.cpp:2622 Context.getTranslationUnitDecl()->addDecl(Alloc); IdResolver.tryAddTopLevelDecl(Alloc, Name); + ---------------- I kind of feel like it would be easier to add a boolean parameter to CreateAllocationFunctionDecl, then you don't need to repeat these two lines. https://reviews.llvm.org/D25796 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits