<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 15, 2015 at 11:39 AM, Richard Trieu <span dir="ltr"><<a href="mailto:rtrieu@google.com" target="_blank">rtrieu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Apr 14, 2015 at 9:36 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>On Tue, Apr 14, 2015 at 9:18 PM, Richard Trieu <<a href="mailto:rtrieu@google.com" target="_blank">rtrieu@google.com</a>> wrote:<br>
><br>
><br>
> On Tue, Apr 14, 2015 at 8:28 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
>><br>
>> On Tue, Apr 14, 2015 at 8:21 PM, Richard Trieu <<a href="mailto:rtrieu@google.com" target="_blank">rtrieu@google.com</a>> wrote:<br>
>> > On Tue, Apr 14, 2015 at 6:33 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> On Tue, Apr 14, 2015 at 6:21 PM, Richard Trieu <<a href="mailto:rtrieu@google.com" target="_blank">rtrieu@google.com</a>><br>
>> >> wrote:<br>
>> >> > Author: rtrieu<br>
>> >> > Date: Tue Apr 14 20:21:15 2015<br>
>> >> > New Revision: 234963<br>
>> >> ><br>
>> >> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=234963&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=234963&view=rev</a><br>
>> >> > Log:<br>
>> >> > Change range-based for-loops to be -Wrange-loop-analysis clean.<br>
>> >> > No functionality change.<br>
>> >> ><br>
>> >> > Modified:<br>
>> >> >     llvm/trunk/lib/Analysis/RegionPass.cpp<br>
>> >> >     llvm/trunk/lib/CodeGen/WinEHPrepare.cpp<br>
>> >> >     llvm/trunk/lib/MC/MCDwarf.cpp<br>
>> >> >     llvm/trunk/lib/Object/COFFObjectFile.cpp<br>
>> >> >     llvm/trunk/lib/Target/AArch64/AArch64CollectLOH.cpp<br>
>> >> >     llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp<br>
>> >> >     llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp<br>
>> >> >     llvm/trunk/utils/TableGen/CodeGenRegisters.cpp<br>
>> >> ><br>
>> >> > Modified: llvm/trunk/lib/Analysis/RegionPass.cpp<br>
>> >> > URL:<br>
>> >> ><br>
>> >> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionPass.cpp?rev=234963&r1=234962&r2=234963&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionPass.cpp?rev=234963&r1=234962&r2=234963&view=diff</a><br>
>> >> ><br>
>> >> ><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/lib/Analysis/RegionPass.cpp (original)<br>
>> >> > +++ llvm/trunk/lib/Analysis/RegionPass.cpp Tue Apr 14 20:21:15 2015<br>
>> >> > @@ -199,7 +199,7 @@ public:<br>
>> >> ><br>
>> >> >    bool runOnRegion(Region *R, RGPassManager &RGM) override {<br>
>> >> >      Out << Banner;<br>
>> >> > -    for (const auto &BB : R->blocks()) {<br>
>> >> > +    for (const auto *BB : R->blocks()) {<br>
>> >> >        if (BB)<br>
>> >> >          BB->print(Out);<br>
>> >> >        else<br>
>> >> ><br>
>> >> > Modified: llvm/trunk/lib/CodeGen/WinEHPrepare.cpp<br>
>> >> > URL:<br>
>> >> ><br>
>> >> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/WinEHPrepare.cpp?rev=234963&r1=234962&r2=234963&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/WinEHPrepare.cpp?rev=234963&r1=234962&r2=234963&view=diff</a><br>
>> >> ><br>
>> >> ><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/lib/CodeGen/WinEHPrepare.cpp (original)<br>
>> >> > +++ llvm/trunk/lib/CodeGen/WinEHPrepare.cpp Tue Apr 14 20:21:15 2015<br>
>> >> > @@ -909,7 +909,7 @@ bool WinEHPrepare::outlineHandler(Action<br>
>> >> >      // save the association of the blocks in LPadTargetBlocks.  The<br>
>> >> >      // return instructions which are created from these branches<br>
>> >> > will<br>
>> >> > be<br>
>> >> >      // replaced after all landing pads have been outlined.<br>
>> >> > -    for (const auto &MapEntry : VMap) {<br>
>> >> > +    for (const auto MapEntry : VMap) {<br>
>> >><br>
>> >> What's the deal with this change? Is the type small & trivially<br>
>> >> copyable & we're suggesting using values instead of references?<br>
>> >><br>
>> > VMap does not return a reference, so remove the reference type to<br>
>> > indicate a<br>
>> > copy is always made.<br>
>><br>
>> Seems ValueMap uses a proxy (much like std::vector<bool>/bitset/etc).<br>
>><br>
>> How much value do you think there is in warning when a reference is<br>
>> bound to a value return from operator*? I appreciate that it's useful<br>
>> when there's an intentional type difference (though that's tricky -<br>
>> are we warning there now? I forget) but if the types match it's sort<br>
>> of a benign reference, right?<br>
>><br>
> I think it's mostly benign, as long as the container isn't changed and the<br>
> code expects the new value,<br>
<br>
</div></div>Actually that's the trick - because these things are proxied, the code<br>
looks like it makes a copy of the container elements, but it actually<br>
doesn't:<br>
<br>
for (auto x : my_vec_bool_or_bitset)<br>
  x = 0;<br>
<br>
Does that code modify the container? Surprisingly, it does... - so I'm<br>
not sure it's helpful to remove the ref qualifier. While, yes,<br>
including the ref qualifier is a lie, I suspect it might be the lesser<br>
evil here... maybe. (granted you can use "const auto &x" and then<br>
write "x = 0;" and that will compile, and similarly be confusing to<br>
the author... so I'm not saying I have an iron-clad argument here)<br>
<div><div><br></div></div></blockquote></div></div><div>It looks like if there is "const auto &x" or "const auto x" for vector<bool>, then "x = 0;" won't compile.  I wouldn't mind supporting "const auto &x" for this case, but is there a way to detect these proxy types?</div></div></div></div></blockquote><div><br>I don't think there's anything in particular we could do (maybe look for op= overloads?) to catch these cases, beyond just any by-value-returning iterator.<br><br>My understanding was that the purpose of the warning was to find accidental conversions (eg: "const std::pair<int, int> &x : my_map"). I'm not sure what bugs we would be detecting/avoiding if we used references for cases where there is no conversion. Are there any particular bugs/problems you foresee/have encountered with that case?<br><br>- David<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
> or the reference is kept around after the loop.<br>
> However, this was the whole point of the warning, to divide up the syntax<br>
> for range-based for-loops so that every copy is done with a non-reference<br>
> type while every reference type will not bind to a temporary.  Exceptions to<br>
> this rule just weaken the warning.<br>
<br>
<br>
<br>
>><br>
>> ><br>
>> >><br>
>> >> >        // VMap maps all values and blocks that were just cloned, but<br>
>> >> > dead<br>
>> >> >        // blocks which were pruned will map to nullptr.<br>
>> >> >        if (!isa<BasicBlock>(MapEntry.first) || MapEntry.second ==<br>
>> >> > nullptr)<br>
>> >> ><br>
>> >> > Modified: llvm/trunk/lib/MC/MCDwarf.cpp<br>
>> >> > URL:<br>
>> >> ><br>
>> >> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=234963&r1=234962&r2=234963&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=234963&r1=234962&r2=234963&view=diff</a><br>
>> >> ><br>
>> >> ><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/lib/MC/MCDwarf.cpp (original)<br>
>> >> > +++ llvm/trunk/lib/MC/MCDwarf.cpp Tue Apr 14 20:21:15 2015<br>
>> >> > @@ -803,7 +803,7 @@ static void EmitGenDwarfRanges(MCStreame<br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> > MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection());<br>
>> >> ><br>
>> >> > -  for (const auto sec : Sections) {<br>
>> >> > +  for (const auto &sec : Sections) {<br>
>> >> ><br>
>> >> >      MCSymbol *StartSymbol = sec.second.first;<br>
>> >> >      MCSymbol *EndSymbol = sec.second.second;<br>
>> >> ><br>
>> >> > Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp<br>
>> >> > URL:<br>
>> >> ><br>
>> >> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=234963&r1=234962&r2=234963&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=234963&r1=234962&r2=234963&view=diff</a><br>
>> >> ><br>
>> >> ><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)<br>
>> >> > +++ llvm/trunk/lib/Object/COFFObjectFile.cpp Tue Apr 14 20:21:15 2015<br>
>> >> > @@ -262,7 +262,7 @@ std::error_code COFFObjectFile::getSymbo<br>
>> >> >    }<br>
>> >> >    const section_iterator SecEnd = section_end();<br>
>> >> >    uint64_t AfterAddr = UnknownAddressOrSize;<br>
>> >> > -  for (const symbol_iterator &SymbI : symbols()) {<br>
>> >> > +  for (const symbol_iterator SymbI : symbols()) {<br>
>> >><br>
>> >> Drop const if we're dropping ref?<br>
>> ><br>
>> > See two lines above where the code uses a const iterator.  This change<br>
>> > follows the current code.<br>
>><br>
>> Fair enough<br>
>><br>
>> >><br>
>> >><br>
>> >> >      section_iterator SecI = SecEnd;<br>
>> >> >      if (std::error_code EC = SymbI->getSection(SecI))<br>
>> >> >        return EC;<br>
>> >> ><br>
>> >> > Modified: llvm/trunk/lib/Target/AArch64/AArch64CollectLOH.cpp<br>
>> >> > URL:<br>
>> >> ><br>
>> >> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64CollectLOH.cpp?rev=234963&r1=234962&r2=234963&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64CollectLOH.cpp?rev=234963&r1=234962&r2=234963&view=diff</a><br>
>> >> ><br>
>> >> ><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/lib/Target/AArch64/AArch64CollectLOH.cpp (original)<br>
>> >> > +++ llvm/trunk/lib/Target/AArch64/AArch64CollectLOH.cpp Tue Apr 14<br>
>> >> > 20:21:15 2015<br>
>> >> > @@ -328,7 +328,7 @@ static void initReachingDef(const Machin<br>
>> >> >          const uint32_t *PreservedRegs = MO.getRegMask();<br>
>> >> ><br>
>> >> >          // Set generated regs.<br>
>> >> > -        for (const auto Entry : RegToId) {<br>
>> >> > +        for (const auto &Entry : RegToId) {<br>
>> >> >            unsigned Reg = Entry.second;<br>
>> >> >            // Use the global register ID when querying APIs external<br>
>> >> > to<br>
>> >> > this<br>
>> >> >            // pass.<br>
>> >> ><br>
>> >> > Modified: llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp<br>
>> >> > URL:<br>
>> >> ><br>
>> >> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp?rev=234963&r1=234962&r2=234963&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp?rev=234963&r1=234962&r2=234963&view=diff</a><br>
>> >> ><br>
>> >> ><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp (original)<br>
>> >> > +++ llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp Tue Apr 14<br>
>> >> > 20:21:15 2015<br>
>> >> > @@ -887,7 +887,7 @@ void StructurizeCFG::createFlow() {<br>
>> >> >  /// no longer dominate all their uses. Not sure if this is really<br>
>> >> > nessasary<br>
>> >> >  void StructurizeCFG::rebuildSSA() {<br>
>> >> >    SSAUpdater Updater;<br>
>> >> > -  for (const auto &BB : ParentRegion->blocks())<br>
>> >> > +  for (auto *BB : ParentRegion->blocks())<br>
>> >> >      for (BasicBlock::iterator II = BB->begin(), IE = BB->end();<br>
>> >> >           II != IE; ++II) {<br>
>> >> ><br>
>> >> ><br>
>> >> > Modified: llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp<br>
>> >> > URL:<br>
>> >> ><br>
>> >> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp?rev=234963&r1=234962&r2=234963&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp?rev=234963&r1=234962&r2=234963&view=diff</a><br>
>> >> ><br>
>> >> ><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp (original)<br>
>> >> > +++ llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp Tue Apr 14<br>
>> >> > 20:21:15<br>
>> >> > 2015<br>
>> >> > @@ -355,7 +355,8 @@ static void dumpCXXData(const ObjectFile<br>
>> >> >      StringRef SymName = VFTableEntry.second;<br>
>> >> >      outs() << VFTableName << '[' << Offset << "]: " << SymName <<<br>
>> >> > '\n';<br>
>> >> >    }<br>
>> >> > -  for (const std::pair<StringRef, ArrayRef<little32_t>> &VBTable :<br>
>> >> > VBTables) {<br>
>> >> > +  for (const std::pair<const StringRef, ArrayRef<little32_t>><br>
>> >> > &VBTable<br>
>> >> > :<br>
>> >><br>
>> >> Can probably use 'const auto &' here.<br>
>> ><br>
>> > Fixed in r234974.<br>
>> >><br>
>> >><br>
>> >> > +       VBTables) {<br>
>> >> >      StringRef VBTableName = VBTable.first;<br>
>> >> >      uint32_t Idx = 0;<br>
>> >> >      for (little32_t Offset : VBTable.second) {<br>
>> >> > @@ -363,7 +364,8 @@ static void dumpCXXData(const ObjectFile<br>
>> >> >        Idx += sizeof(Offset);<br>
>> >> >      }<br>
>> >> >    }<br>
>> >> > -  for (const std::pair<StringRef, CompleteObjectLocator> &COLPair :<br>
>> >> > COLs) {<br>
>> >> > +  for (const std::pair<const StringRef, CompleteObjectLocator><br>
>> >> > &COLPair<br>
>> >> > :<br>
>> >> > +       COLs) {<br>
>> >> >      StringRef COLName = COLPair.first;<br>
>> >> >      const CompleteObjectLocator &COL = COLPair.second;<br>
>> >> >      outs() << COLName << "[IsImageRelative]: " << COL.Data[0] <<<br>
>> >> > '\n';<br>
>> >> > @@ -373,7 +375,8 @@ static void dumpCXXData(const ObjectFile<br>
>> >> >      outs() << COLName << "[ClassHierarchyDescriptor]: " <<<br>
>> >> > COL.Symbols[1]<br>
>> >> >             << '\n';<br>
>> >> >    }<br>
>> >> > -  for (const std::pair<StringRef, ClassHierarchyDescriptor> &CHDPair<br>
>> >> > :<br>
>> >> > CHDs) {<br>
>> >> > +  for (const std::pair<const StringRef, ClassHierarchyDescriptor><br>
>> >> > &CHDPair :<br>
>> >> > +       CHDs) {<br>
>> >> >      StringRef CHDName = CHDPair.first;<br>
>> >> >      const ClassHierarchyDescriptor &CHD = CHDPair.second;<br>
>> >> >      outs() << CHDName << "[AlwaysZero]: " << CHD.Data[0] << '\n';<br>
>> >> > @@ -381,14 +384,14 @@ static void dumpCXXData(const ObjectFile<br>
>> >> >      outs() << CHDName << "[NumClasses]: " << CHD.Data[2] << '\n';<br>
>> >> >      outs() << CHDName << "[BaseClassArray]: " << CHD.Symbols[0] <<<br>
>> >> > '\n';<br>
>> >> >    }<br>
>> >> > -  for (const std::pair<std::pair<StringRef, uint64_t>, StringRef><br>
>> >> > &BCAEntry :<br>
>> >> > -       BCAEntries) {<br>
>> >> > +  for (const std::pair<const std::pair<StringRef, uint64_t>,<br>
>> >> > StringRef><br>
>> >><br>
>> >> And "const auto &" here too, I suspect.<br>
>> >><br>
>> >> > +           &BCAEntry : BCAEntries) {<br>
>> >> >      StringRef BCAName = BCAEntry.first.first;<br>
>> >> >      uint64_t Offset = BCAEntry.first.second;<br>
>> >> >      StringRef SymName = BCAEntry.second;<br>
>> >> >      outs() << BCAName << '[' << Offset << "]: " << SymName << '\n';<br>
>> >> >    }<br>
>> >> > -  for (const std::pair<StringRef, BaseClassDescriptor> &BCDPair :<br>
>> >> > BCDs)<br>
>> >> > {<br>
>> >> > +  for (const std::pair<const StringRef, BaseClassDescriptor><br>
>> >> > &BCDPair :<br>
>> >> > BCDs) {<br>
>> >><br>
>> >> and here<br>
>> >><br>
>> >> >      StringRef BCDName = BCDPair.first;<br>
>> >> >      const BaseClassDescriptor &BCD = BCDPair.second;<br>
>> >> >      outs() << BCDName << "[TypeDescriptor]: " << BCD.Symbols[0] <<<br>
>> >> > '\n';<br>
>> >> > @@ -400,7 +403,7 @@ static void dumpCXXData(const ObjectFile<br>
>> >> >      outs() << BCDName << "[ClassHierarchyDescriptor]: " <<<br>
>> >> > BCD.Symbols[1]<br>
>> >> >             << '\n';<br>
>> >> >    }<br>
>> >> > -  for (const std::pair<StringRef, TypeDescriptor> &TDPair : TDs) {<br>
>> >> > +  for (const std::pair<const StringRef, TypeDescriptor> &TDPair :<br>
>> >> > TDs)<br>
>> >> > {<br>
>> >><br>
>> >> and here<br>
>> >><br>
>> >> >      StringRef TDName = TDPair.first;<br>
>> >> >      const TypeDescriptor &TD = TDPair.second;<br>
>> >> >      outs() << TDName << "[VFPtr]: " << TD.Symbols[0] << '\n';<br>
>> >> > @@ -410,7 +413,7 @@ static void dumpCXXData(const ObjectFile<br>
>> >> >                           /*UseHexEscapes=*/true)<br>
>> >> >          << '\n';<br>
>> >> >    }<br>
>> >> > -  for (const std::pair<StringRef, ThrowInfo> &TIPair : TIs) {<br>
>> >> > +  for (const std::pair<const StringRef, ThrowInfo> &TIPair : TIs) {<br>
>> >><br>
>> >> and here<br>
>> >><br>
>> >> >      StringRef TIName = TIPair.first;<br>
>> >> >      const ThrowInfo &TI = TIPair.second;<br>
>> >> >      auto dumpThrowInfoFlag = [&](const char *Name, uint32_t Flag) {<br>
>> >> > @@ -429,7 +432,7 @@ static void dumpCXXData(const ObjectFile<br>
>> >> >      dumpThrowInfoSymbol("ForwardCompat", 8);<br>
>> >> >      dumpThrowInfoSymbol("CatchableTypeArray", 12);<br>
>> >> >    }<br>
>> >> > -  for (const std::pair<StringRef, CatchableTypeArray> &CTAPair :<br>
>> >> > CTAs)<br>
>> >> > {<br>
>> >> > +  for (const std::pair<const StringRef, CatchableTypeArray> &CTAPair<br>
>> >> > :<br>
>> >> > CTAs) {<br>
>> >><br>
>> >> And here<br>
>> >><br>
>> >> >      StringRef CTAName = CTAPair.first;<br>
>> >> >      const CatchableTypeArray &CTA = CTAPair.second;<br>
>> >> ><br>
>> >> > @@ -441,7 +444,7 @@ static void dumpCXXData(const ObjectFile<br>
>> >> >           I != E; ++I)<br>
>> >> >        outs() << CTAName << '[' << Idx++ << "]: " << I->second <<<br>
>> >> > '\n';<br>
>> >> >    }<br>
>> >> > -  for (const std::pair<StringRef, CatchableType> &CTPair : CTs) {<br>
>> >> > +  for (const std::pair<const StringRef, CatchableType> &CTPair :<br>
>> >> > CTs) {<br>
>> >><br>
>> >> And here<br>
>> >><br>
>> >> >      StringRef CTName = CTPair.first;<br>
>> >> >      const CatchableType &CT = CTPair.second;<br>
>> >> >      auto dumpCatchableTypeFlag = [&](const char *Name, uint32_t<br>
>> >> > Flag) {<br>
>> >> > @@ -464,14 +467,14 @@ static void dumpCXXData(const ObjectFile<br>
>> >> >             << "[CopyCtor]: " << (CT.Symbols[1].empty() ? "null" :<br>
>> >> > CT.Symbols[1])<br>
>> >> >             << '\n';<br>
>> >> >    }<br>
>> >> > -  for (const std::pair<std::pair<StringRef, uint64_t>, StringRef><br>
>> >> > &VTTPair :<br>
>> >> > -       VTTEntries) {<br>
>> >> > +  for (const std::pair<const std::pair<StringRef, uint64_t>,<br>
>> >> > StringRef><br>
>> >><br>
>> >> And here<br>
>> >><br>
>> >> > +           &VTTPair : VTTEntries) {<br>
>> >> >      StringRef VTTName = VTTPair.first.first;<br>
>> >> >      uint64_t VTTOffset = VTTPair.first.second;<br>
>> >> >      StringRef VTTEntry = VTTPair.second;<br>
>> >> >      outs() << VTTName << '[' << VTTOffset << "]: " << VTTEntry <<<br>
>> >> > '\n';<br>
>> >> >    }<br>
>> >> > -  for (const std::pair<StringRef, StringRef> &TIPair : TINames) {<br>
>> >> > +  for (const std::pair<const StringRef, StringRef> &TIPair :<br>
>> >> > TINames) {<br>
>> >><br>
>> >> And here<br>
>> >><br>
>> >> >      StringRef TIName = TIPair.first;<br>
>> >> >      outs() << TIName << ": " << TIPair.second << '\n';<br>
>> >> >    }<br>
>> >> ><br>
>> >> > Modified: llvm/trunk/utils/TableGen/CodeGenRegisters.cpp<br>
>> >> > URL:<br>
>> >> ><br>
>> >> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenRegisters.cpp?rev=234963&r1=234962&r2=234963&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenRegisters.cpp?rev=234963&r1=234962&r2=234963&view=diff</a><br>
>> >> ><br>
>> >> ><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/utils/TableGen/CodeGenRegisters.cpp (original)<br>
>> >> > +++ llvm/trunk/utils/TableGen/CodeGenRegisters.cpp Tue Apr 14<br>
>> >> > 20:21:15<br>
>> >> > 2015<br>
>> >> > @@ -1780,7 +1780,7 @@ void CodeGenRegBank::computeRegUnitLaneM<br>
>> >> >        const CodeGenRegister *SubRegister = S->second;<br>
>> >> >        unsigned LaneMask = SubRegIndex->LaneMask;<br>
>> >> >        // Distribute LaneMask to Register Units touched.<br>
>> >> > -      for (const auto &SUI : SubRegister->getRegUnits()) {<br>
>> >> > +      for (unsigned SUI : SubRegister->getRegUnits()) {<br>
>> >> >          bool Found = false;<br>
>> >> >          unsigned u = 0;<br>
>> >> >          for (unsigned RU : RegUnits) {<br>
>> >> ><br>
>> >> ><br>
>> >> > _______________________________________________<br>
>> >> > llvm-commits mailing list<br>
>> >> > <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
>> >> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div>