<p dir="ltr">Thanks!</p>
<div class="gmail_quote">On Jul 2, 2013 9:20 PM, "Craig Topper" <<a href="mailto:craig.topper@gmail.com">craig.topper@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: ctopper<br>
Date: Tue Jul 2 23:17:25 2013<br>
New Revision: 185504<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=185504&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=185504&view=rev</a><br>
Log:<br>
Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size.<br>
<br>
Modified:<br>
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=185504&r1=185503&r2=185504&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=185504&r1=185503&r2=185504&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Jul 2 23:17:25 2013<br>
@@ -451,7 +451,7 @@ DIE *DwarfDebug::constructLexicalScopeDI<br>
TheCU->addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_data4,<br>
DebugRangeSymbols.size()<br>
* Asm->getDataLayout().getPointerSize());<br>
- for (SmallVector<InsnRange, 4>::const_iterator RI = Ranges.begin(),<br>
+ for (SmallVectorImpl<InsnRange>::const_iterator RI = Ranges.begin(),<br>
RE = Ranges.end(); RI != RE; ++RI) {<br>
DebugRangeSymbols.push_back(getLabelBeforeInsn(RI->first));<br>
DebugRangeSymbols.push_back(getLabelAfterInsn(RI->second));<br>
@@ -464,7 +464,7 @@ DIE *DwarfDebug::constructLexicalScopeDI<br>
}<br>
<br>
// Construct the address range for this DIE.<br>
- SmallVector<InsnRange, 4>::const_iterator RI = Ranges.begin();<br>
+ SmallVectorImpl<InsnRange>::const_iterator RI = Ranges.begin();<br>
MCSymbol *Start = getLabelBeforeInsn(RI->first);<br>
MCSymbol *End = getLabelAfterInsn(RI->second);<br>
<br>
@@ -508,7 +508,7 @@ DIE *DwarfDebug::constructInlinedScopeDI<br>
TheCU->addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_data4,<br>
DebugRangeSymbols.size()<br>
* Asm->getDataLayout().getPointerSize());<br>
- for (SmallVector<InsnRange, 4>::const_iterator RI = Ranges.begin(),<br>
+ for (SmallVectorImpl<InsnRange>::const_iterator RI = Ranges.begin(),<br>
RE = Ranges.end(); RI != RE; ++RI) {<br>
DebugRangeSymbols.push_back(getLabelBeforeInsn(RI->first));<br>
DebugRangeSymbols.push_back(getLabelAfterInsn(RI->second));<br>
@@ -516,7 +516,7 @@ DIE *DwarfDebug::constructInlinedScopeDI<br>
DebugRangeSymbols.push_back(NULL);<br>
DebugRangeSymbols.push_back(NULL);<br>
} else {<br>
- SmallVector<InsnRange, 4>::const_iterator RI = Ranges.begin();<br>
+ SmallVectorImpl<InsnRange>::const_iterator RI = Ranges.begin();<br>
MCSymbol *StartLabel = getLabelBeforeInsn(RI->first);<br>
MCSymbol *EndLabel = getLabelAfterInsn(RI->second);<br>
<br>
@@ -632,7 +632,7 @@ DIE *DwarfDebug::constructScopeDIE(Compi<br>
if (!ScopeDIE) return NULL;<br>
<br>
// Add children<br>
- for (SmallVector<DIE *, 8>::iterator I = Children.begin(),<br>
+ for (SmallVectorImpl<DIE *>::iterator I = Children.begin(),<br>
E = Children.end(); I != E; ++I)<br>
ScopeDIE->addChild(*I);<br>
<br>
@@ -1099,7 +1099,7 @@ void DwarfDebug::endModule() {<br>
E = CUMap.end(); I != E; ++I)<br>
delete I->second;<br>
<br>
- for (SmallVector<CompileUnit *, 1>::iterator I = SkeletonCUs.begin(),<br>
+ for (SmallVectorImpl<CompileUnit *>::iterator I = SkeletonCUs.begin(),<br>
E = SkeletonCUs.end(); I != E; ++I)<br>
delete *I;<br>
<br>
@@ -1414,7 +1414,7 @@ void DwarfDebug::identifyScopeMarkers()<br>
<br>
const SmallVector<LexicalScope *, 4> &Children = S->getChildren();<br>
if (!Children.empty())<br>
- for (SmallVector<LexicalScope *, 4>::const_iterator SI = Children.begin(),<br>
+ for (SmallVectorImpl<LexicalScope *>::const_iterator SI = Children.begin(),<br>
SE = Children.end(); SI != SE; ++SI)<br>
WorkList.push_back(*SI);<br>
<br>
@@ -1424,7 +1424,7 @@ void DwarfDebug::identifyScopeMarkers()<br>
const SmallVector<InsnRange, 4> &Ranges = S->getRanges();<br>
if (Ranges.empty())<br>
continue;<br>
- for (SmallVector<InsnRange, 4>::const_iterator RI = Ranges.begin(),<br>
+ for (SmallVectorImpl<InsnRange>::const_iterator RI = Ranges.begin(),<br>
RE = Ranges.end(); RI != RE; ++RI) {<br>
assert(RI->first && "InsnRange does not have first instruction!");<br>
assert(RI->second && "InsnRange does not have second instruction!");<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">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>
</blockquote></div>