<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 16, 2015 at 9:48 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 dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, Jan 16, 2015 at 9:40 PM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</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"><div class="gmail_extra"><div class="gmail_quote"><span>On Fri, Jan 16, 2015 at 9:05 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 dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Fri, Jan 16, 2015 at 6:27 PM, Nico Weber <span dir="ltr"><<a href="mailto:nicolasweber@gmx.de" target="_blank">nicolasweber@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: nico<br>
Date: Fri Jan 16 20:27:54 2015<br>
New Revision: 226364<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=226364&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=226364&view=rev</a><br>
Log:<br>
Wrap to 80 columns. No behavior change.<br>
<br>
Modified:<br>
    cfe/trunk/lib/CodeGen/ModuleBuilder.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/ModuleBuilder.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ModuleBuilder.cpp?rev=226364&r1=226363&r2=226364&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ModuleBuilder.cpp?rev=226364&r1=226363&r2=226364&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/ModuleBuilder.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/ModuleBuilder.cpp Fri Jan 16 20:27:54 2015<br>
@@ -95,7 +95,8 @@ namespace {<br>
<br>
       M->setTargetTriple(Ctx->getTargetInfo().getTriple().getTriple());<br>
       M->setDataLayout(Ctx->getTargetInfo().getTargetDescription());<br>
-      TD.reset(new llvm::DataLayout(Ctx->getTargetInfo().getTargetDescription()));<br>
+      TD.reset(<br>
+          new llvm::DataLayout(Ctx->getTargetInfo().getTargetDescription()));<br></blockquote></span><div><br>llvm::make_unique, perhaps?<br></div></div></div></div></blockquote><div><br></div></span><div>In a reset() call? Why?</div></div></div></div></blockquote></span><div><br>Perhaps there are other preferences, but I tend to prefer:<br><br>  x = make_unique<T>(...);<br><br>over<br><br>  x.reset(new T(...));<br><br>except when necessary (the T ctor is private is the usual reason/limitation) because I find it easier to read/less to think about - whenever I see a raw 'new' I tend to pause a moment to think about where it's going/who's owning it (even if it's just long enough to see the reset call, etc).<br><br>Not sure which one's more popular in the codebase at the moment but I'd wager/hope it's the first & would like to encourage things in that direction.</div></div></div></div></blockquote><div><br></div><div>Personally, I find `reset(new` much easier to read.</div><div> </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><span class="HOEnZb"><font color="#888888"><br><br>- David<br> </font></span></div><span class=""><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"><span><div> </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><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
       Builder.reset(new CodeGen::CodeGenModule(Context, CodeGenOpts, *M, *TD,<br>
                                                Diags, CoverageInfo));<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></span></div><br></div></div>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></span></div><br></div></div>
</blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>