<div dir="auto">Adding ifdefs like this is not very maintainable. can we put this in a helper?</div><div class="gmail_extra"><br><div class="gmail_quote">On Dec 8, 2016 11:20 AM, "Rui Ueyama via llvm-commits" <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ruiu<br>
Date: Thu Dec 8 13:10:28 2016<br>
New Revision: 289089<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=289089&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=289089&view=rev</a><br>
Log:<br>
Start using make() in COFF (with a smaller change.)<br>
<br>
Modified:<br>
lld/trunk/COFF/Driver.cpp<br>
lld/trunk/COFF/Error.cpp<br>
<br>
Modified: lld/trunk/COFF/Driver.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=289089&r1=289088&r2=289089&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/COFF/Driver.<wbr>cpp?rev=289089&r1=289088&r2=<wbr>289089&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/COFF/Driver.cpp (original)<br>
+++ lld/trunk/COFF/Driver.cpp Thu Dec 8 13:10:28 2016<br>
@@ -15,6 +15,7 @@<br>
#include "Symbols.h"<br>
#include "Writer.h"<br>
#include "lld/Driver/Driver.h"<br>
+#include "lld/Support/Memory.h"<br>
#include "llvm/ADT/Optional.h"<br>
#include "llvm/ADT/StringSwitch.h"<br>
#include "llvm/LibDriver/LibDriver.h"<br>
@@ -43,10 +44,8 @@ Configuration *Config;<br>
LinkerDriver *Driver;<br>
<br>
bool link(llvm::ArrayRef<const char *> Args) {<br>
- Configuration C;<br>
- LinkerDriver D;<br>
- Config = &C;<br>
- Driver = &D;<br>
+ Config = make<Configuration>();<br>
+ Driver = make<LinkerDriver>();<br>
Driver->link(Args);<br>
return true;<br>
}<br>
<br>
Modified: lld/trunk/COFF/Error.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Error.cpp?rev=289089&r1=289088&r2=289089&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/COFF/Error.<wbr>cpp?rev=289089&r1=289088&r2=<wbr>289089&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/COFF/Error.cpp (original)<br>
+++ lld/trunk/COFF/Error.cpp Thu Dec 8 13:10:28 2016<br>
@@ -14,6 +14,10 @@<br>
#include "llvm/Support/Process.h"<br>
#include "llvm/Support/raw_ostream.h"<br>
<br>
+#if !defined(_MSC_VER) && !defined(__MINGW32__)<br>
+#include <unistd.h><br>
+#endif<br>
+<br>
using namespace llvm;<br>
<br>
namespace lld {<br>
@@ -27,9 +31,11 @@ void fatal(const Twine &Msg) {<br>
} else {<br>
errs() << "error: ";<br>
}<br>
-<br>
errs() << Msg << "\n";<br>
- exit(1);<br>
+<br>
+ outs().flush();<br>
+ errs().flush();<br>
+ _exit(1);<br>
}<br>
<br>
void fatal(std::error_code EC, const Twine &Msg) {<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>