<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Feb 7, 2007, at 5:41 PM, Bill Wendling wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-converted-space"> </SPAN>CodeGenPasses->add(new TargetData(*Target->getTargetData()));</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">-<SPAN class="Apple-converted-space"> </SPAN>Target->addPassesToEmitFile(*CodeGenPasses, Out, TargetMachine::AssemblyFile,<SPAN class="Apple-converted-space"> </SPAN></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">-<SPAN class="Apple-converted-space"> </SPAN>true);</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>MachineCodeEmitter *MCE = 0;</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>switch (Target->addPassesToEmitFile(*CodeGenPasses, Out,</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+ <SPAN class="Apple-converted-space"> </SPAN>TargetMachine::AssemblyFile, true)) {</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>default:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>assert(0 && "Invalid file model!");</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>return LTO_UNKNOWN;</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>case FileModel::Error:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>// FIXME: Error...</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>return LTO_UNKNOWN;</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>case FileModel::AsmFile:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>break;</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>case FileModel::MachOFile:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>MCE = AddMachOWriter(*CodeGenPasses, Out, *Target);</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>break;</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>case FileModel::ElfFile:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>MCE = AddELFWriter(*CodeGenPasses, Out, *Target);</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>break;</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>}</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>if (Target->addPassesToEmitFileFinish(*CodeGenPasses, MCE, true)) {</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>// FIXME: Error...</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>return LTO_UNKNOWN;</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">+<SPAN class="Apple-converted-space"> </SPAN>}</FONT></P> </BLOCKQUOTE></DIV><BR><DIV>Please avoid assert() in lto. Let linker handle all failures.</DIV><DIV>Use LTO_WRITE_FAILURE instead of LTO_UNKNOWN.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks,</DIV><DIV>-</DIV><DIV>Devang</DIV></BODY></HTML>