Convert to use new Pass framework...
[oota-llvm.git] / tools / llvm-link / llvm-link.cpp
index ad4cbdbe8cb2c7154aa9a95d62a981ca12000923..bdd04685ce3a7bdc24737f98a1c94e6ae9e2910f 100644 (file)
@@ -19,7 +19,6 @@
 #include <fstream>
 #include <memory>
 #include <sys/types.h>     // For FileExists
-typedef int blksize_t;   // SYS/TYPES is broken!!!
 #include <sys/stat.h>
 
 
@@ -30,6 +29,7 @@ cl::Flag   Force         ("f", "Overwrite output files", cl::NoFlags, false);
 cl::Flag   Verbose       ("v", "Print information about actions taken");
 cl::Flag   DumpAsm       ("d", "Print assembly as linked", cl::Hidden, false);
 cl::StringList LibPaths  ("L", "Specify a library search path", cl::ZeroOrMore);
+cl::StringList Libraries ("l", "Specify libraries to link to", cl::ZeroOrMore);
 
 
 // FileExists - Return true if the specified string is an openable file...
@@ -91,6 +91,9 @@ int main(int argc, char **argv) {
     OutputFilename = InputFilenames[1];
   }
 
+  if (!Libraries.empty())
+    cerr << "LLVM Linker Warning:  Linking to libraries is unimplemented!\n";
+
   std::auto_ptr<Module> Composite(LoadFile(InputFilenames[BaseArg]));
   if (Composite.get() == 0) return 1;
 
@@ -112,7 +115,7 @@ int main(int argc, char **argv) {
 
   ostream *Out = &cout;  // Default to printing to stdout...
   if (OutputFilename != "-") {
-    if (!Force && !std::ifstream(OutputFilename.c_str())) {
+    if (!Force && std::ifstream(OutputFilename.c_str())) {
       // If force is not specified, make sure not to overwrite a file!
       cerr << "Error opening '" << OutputFilename << "': File exists!\n"
            << "Use -f command line argument to force output\n";