#include "Symbols.h"
#include "Writer.h"
#include "lld/Driver/Driver.h"
+#include "lld/Support/Memory.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/LibDriver/LibDriver.h"
LinkerDriver *Driver;
bool link(llvm::ArrayRef<const char *> Args) {
- Configuration C;
- LinkerDriver D;
- Config = &C;
- Driver = &D;
+ Config = make<Configuration>();
+ Driver = make<LinkerDriver>();
Driver->link(Args);
return true;
}
#include "llvm/Support/Process.h"
#include "llvm/Support/raw_ostream.h"
+#if !defined(_MSC_VER) && !defined(__MINGW32__)
+#include <unistd.h>
+#endif
+
using namespace llvm;
namespace lld {
} else {
errs() << "error: ";
}
-
errs() << Msg << "\n";
- exit(1);
+
+ outs().flush();
+ errs().flush();
+ _exit(1);
}
void fatal(std::error_code EC, const Twine &Msg) {