This is an archive of the discontinued LLVM Phabricator instance.

COFF: Implement /lib using LibDriver.
ClosedPublic

Authored by pcc on Jun 9 2015, 2:44 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 27401.Jun 9 2015, 2:44 PM
pcc retitled this revision from to COFF: Implement /lib using LibDriver..
pcc updated this object.
pcc edited the test plan for this revision. (Show Details)
pcc added a reviewer: ruiu.
pcc added subscribers: rafael, Unknown Object (MLST).
ruiu edited edge metadata.Jun 9 2015, 2:55 PM

LGTM
2015/06/09 午後2:44 "Peter Collingbourne" <peter@pcc.me.uk>:

Hi ruiu,

http://reviews.llvm.org/D10347

Files:

COFF/CMakeLists.txt
COFF/Driver.cpp

Index: COFF/CMakeLists.txt

  • COFF/CMakeLists.txt

+++ COFF/CMakeLists.txt
@@ -16,6 +16,7 @@

${LLVM_TARGETS_TO_BUILD}
Core
LTO

+ LibDriver

MC
MCDisassembler
Support

Index: COFF/Driver.cpp

  • COFF/Driver.cpp

+++ COFF/Driver.cpp
@@ -16,6 +16,7 @@
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/LibDriver/LibDriver.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
@@ -185,6 +186,11 @@

llvm::InitializeAllAsmPrinters();
llvm::InitializeAllDisassemblers();

+ If the first command line argument is "/lib", link.exe acts like
lib.exe.
+
We call our own implementation of lib.exe that understands bitcode
files.
+ if (Argc > 1 && StringRef(Argv[1]).equals_lower("/lib"))
+ return llvm::libDriverMain(Argc - 1, Argv + 1) == 0;
+

// Parse command line options.
auto ArgsOrErr = Parser.parse(Argc, Argv);
if (auto EC = ArgsOrErr.getError()) {

EMAIL PREFERENCES

http://reviews.llvm.org/settings/panel/emailpreferences/
This revision was automatically updated to reflect the committed changes.