<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Oct 12, 2013, at 9:33 AM, Peter Zotov <<a href="mailto:whitequark@whitequark.org">whitequark@whitequark.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Sylvestre Ledru писал 12.10.2013 20:30:<br><blockquote type="cite">Hello,<br>General to your recent patches, you should not mix comestic changes<br>and feature changes.<br></blockquote><br>Sorry, this slipped in accidentally. Should I redo the patch?<br></div></blockquote><div dir="auto"><br></div><div dir="auto">Please!</div><br><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><blockquote type="cite">Sylvestre<br>On 12/10/2013 17:48, Peter Zotov wrote:<br><blockquote type="cite">If no targets are registered, LLVMGetFirstTarget currently fails with an assertion. This patch makes it return NULL instead, similarly to how LLVMGetNextTarget would.<br><a href="http://llvm-reviews.chandlerc.com/D1908">http://llvm-reviews.chandlerc.com/D1908</a><span class="Apple-converted-space"> </span>[1]<br>Files:<br>lib/Target/TargetMachineC.cpp<br>Index: lib/Target/TargetMachineC.cpp<br>===================================================================<br>--- lib/Target/TargetMachineC.cpp<br>+++ lib/Target/TargetMachineC.cpp<br>@@ -48,21 +48,29 @@<br>inline TargetMachine *unwrap(LLVMTargetMachineRef P) {<br>return reinterpret_cast<TargetMachine*>(P);<br>}<br>+<br>inline Target *unwrap(LLVMTargetRef P) {<br>return reinterpret_cast<Target*>(P);<br>}<br>+<br>inline LLVMTargetMachineRef wrap(const TargetMachine *P) {<br>return<br>reinterpret_cast<LLVMTargetMachineRef>(const_cast<TargetMachine*>(P));<br>}<br>+<br>inline LLVMTargetRef wrap(const Target * P) {<br>return reinterpret_cast<LLVMTargetRef>(const_cast<Target*>(P));<br>}<br>LLVMTargetRef LLVMGetFirstTarget() {<br>- const Target* target = &*TargetRegistry::begin();<br>- return wrap(target);<br>+ if(TargetRegistry::begin() == TargetRegistry::end()) {<br>+ return NULL;<br>+ }<br>+<br>+ const Target* target = &*TargetRegistry::begin();<br>+ return wrap(target);<br>}<br>+<br>LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T) {<br>return wrap(unwrap(T)->getNext());<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">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><span class="Apple-converted-space"> </span>[2]<br></blockquote>Links:<br>------<br>[1]<span class="Apple-converted-space"> </span><a href="http://llvm-reviews.chandlerc.com/D1908">http://llvm-reviews.chandlerc.com/D1908</a><br>[2]<span class="Apple-converted-space"> </span><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br></blockquote><br>--<span class="Apple-converted-space"> </span><br> WBR, Peter Zotov.<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">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></div></blockquote></div><br></body></html>