Do not assume the first file is a bytecode file. Instead, construct a dummy
authorBrian Gaeke <gaeke@uiuc.edu>
Wed, 5 Nov 2003 22:13:00 +0000 (22:13 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Wed, 5 Nov 2003 22:13:00 +0000 (22:13 +0000)
Module and link things into that.

Also, fix a typo in an error message.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9748 91177308-0d34-0410-b5e6-96231b3b80d8

tools/gccld/gccld.cpp

index dd1c92f38c0baed826fcc436c98df26d501a4c0d..45163f439685e28fe91d9e51cf71247a8ce44e9f 100644 (file)
@@ -215,10 +215,8 @@ void RemoveEnv(const char * name, char ** const envp) {
 int main(int argc, char **argv, char **envp) {
   cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n");
 
-  std::string ErrorMessage;
-  std::auto_ptr<Module> Composite(LoadObject(InputFilenames[0], ErrorMessage));
-  if (Composite.get() == 0)
-    return PrintAndReturn(argv[0], ErrorMessage);
+  std::string ModuleID ("gccld-output");
+  std::auto_ptr<Module> Composite(new Module(ModuleID));
 
   // We always look first in the current directory when searching for libraries.
   LibPaths.insert(LibPaths.begin(), ".");
@@ -257,7 +255,7 @@ int main(int argc, char **argv, char **envp) {
   // Generate the bytecode file.
   if (GenerateBytecode(Composite.get(), Strip, !NoInternalize, &Out)) {
     Out.close();
-    return PrintAndReturn(argv[0], "error generating bytcode");
+    return PrintAndReturn(argv[0], "error generating bytecode");
   }
 
   // Close the bytecode file.