[llvm-commits] [llvm] r135669 - in /llvm/trunk: include/llvm/ADT/STLExtras.h lib/Support/StringExtras.cpp lib/Transforms/IPO/GlobalOpt.cpp lib/Transforms/Scalar/IndVarSimplify.cpp lib/Transforms/Scalar/SCCP.cpp lib/VMCore/Module.cpp utils/TableGe

Chris Lattner sabre at nondot.org
Wed Jul 20 23:37:58 PDT 2011


On Jul 20, 2011, at 11:35 PM, David Blaikie wrote:

>> move tier out of an anonymous namespace, it doesn't make sense
>> to for it to be an an anon namespace and be in a header.
> 
> Thanks!
> 
>> Eliminate some extraenous uses of tie.
> 
> Just curious - which usage do you consider to be appropriate use of
> tie & which is extraneous? Several of the cases seem like the help
> readability by naming the variables & aren't much/any longer than the
> version using the pair directly. And the example below seems like what
> I would consider a canonical use case for tie. I take it you'd only
> consider tie appropriate when both variables are not coming into
> existence at the point of the tie, but instead are both coming from
> broader scopes?

I don't really like tie and would like it to go away.  I actually was scrubbing the code base when I ran into many legit uses in lib/CodeGen.  While I'd prefer the APIs involved to be changed to not return a pair (e.g. there are things that return pairs of bools, they could return the bools by-ref) keeping it around for now seems reasonable.

With C++'0x features like auto, the need for it would go away completely IMO.

-Chris



More information about the llvm-commits mailing list