This is not functional change to adopt new emit() API added in https://reviews.llvm.org/D37921.
Details
Diff Detail
Event Timeline
lib/Analysis/ValueTracking.cpp | ||
---|---|---|
779–780 | Move this inside the lambda and then also no need for {} | |
lib/CodeGen/StackProtector.cpp | ||
268–293 | auto RemarkBuilder = [&]() { return OptimizationRemark(DEBUG_TYPE, "StackProtectorAllocaOrArray", &I) << "Stack protection applied to function " << ore::NV("Function", F) << " due to a call to alloca or use of a variable length array"; } and then later just: ORE.emit(RemarkBuilder); | |
lib/Transforms/IPO/Inliner.cpp | ||
935–951 | Move the if inside the lambda? | |
lib/Transforms/IPO/SampleProfile.cpp | ||
530–543 | Move 'if' inside the lambda | |
lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp | ||
386–392 | Move the 'using namespace' inside the lambda. You have more of this later. | |
lib/Transforms/Scalar/GVN.cpp | ||
857 | The caller of this function already uses allowExtraAnalysis so no need to use the closure syntax here. | |
lib/Transforms/Vectorize/LoopVectorize.cpp | ||
1250–1273 | Do this whole thing in the lambda. | |
5752–5756 | Again the point of the lambda to only conditionally construct the remark so please either build the remark inside or don't use the lambda syntax. |
One more idea for improvement and then this is ready to go.
lib/Transforms/IPO/Inliner.cpp | ||
---|---|---|
936–946 | Can you actually factor this a bit further so that the common parts are done unconditionally. The reason why we use an insertion operator so that we can do such things. | |
lib/Transforms/IPO/SampleProfile.cpp | ||
532–543 | Same thing here. Just build the common object and conditionally insert the discriminator. |
Move this inside the lambda and then also no need for {}