[PATCH] D24587: Output optimization remarks in YAML

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 14:16:07 PDT 2016


anemet added a comment.

In https://reviews.llvm.org/D24587#552967, @hfinkel wrote:

> I'm glad you liked by suggestion for 'NV', because it is easy to type, but I do wonder if we'll have any issues because 'NV' is currently used as a variable name in a number of places. Having variable/type shadowing can certainly be confusing. What do you think?


I was worried about the same thing but I haven't started propagating this pattern yet so I don't know if we hit something.

My backup solution is creating a small namespace for NV and perhaps IsVerbose, something like "ore".  Then you'd have to qualify NV:

  ORE.emit(DiagnosticInfoOptimizationRemarkMissed( DEBUG_TYPE, "NotInlined", &I) 
                   << ore::NV("Callee", Callee) << " will not be inlined into "
                   << ore::NV("Caller", CS.getCaller())
                   << ore::setIsVerbose());

What do you think?  Another option I was thinking is using std::make_pair directly.


https://reviews.llvm.org/D24587





More information about the llvm-commits mailing list