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 | ||
---|---|---|
781 | Move this inside the lambda and then also no need for {} | |
lib/CodeGen/StackProtector.cpp | ||
269–291 | 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 | ||
936–950 | Move the if inside the lambda? | |
lib/Transforms/IPO/SampleProfile.cpp | ||
529–543 | Move 'if' inside the lambda | |
lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp | ||
386–393 | 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 | ||
1251–1270 | Do this whole thing in the lambda. | |
5752–5754 | 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 | ||
---|---|---|
938–948 | 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 | ||
539–550 | Same thing here. Just build the common object and conditionally insert the discriminator. |
Move this inside the lambda and then also no need for {}