[llvm-commits] CVS: llvm/lib/Linker/LinkArchives.cpp Linker.cpp

Chris Lattner sabre at nondot.org
Sun May 6 02:29:32 PDT 2007



Changes in directory llvm/lib/Linker:

LinkArchives.cpp updated: 1.58 -> 1.59
Linker.cpp updated: 1.15 -> 1.16
---
Log message:

switch this to bitcode instead of bytecode


---
Diffs of the changes:  (+8 -17)

 LinkArchives.cpp |    6 +++---
 Linker.cpp       |   19 +++++--------------
 2 files changed, 8 insertions(+), 17 deletions(-)


Index: llvm/lib/Linker/LinkArchives.cpp
diff -u llvm/lib/Linker/LinkArchives.cpp:1.58 llvm/lib/Linker/LinkArchives.cpp:1.59
--- llvm/lib/Linker/LinkArchives.cpp:1.58	Sun May  6 01:02:13 2007
+++ llvm/lib/Linker/LinkArchives.cpp	Sun May  6 04:29:13 2007
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file contains routines to handle linking together LLVM bytecode files,
+// This file contains routines to handle linking together LLVM bitcode files,
 // and to handle annoying things like static libraries.
 //
 //===----------------------------------------------------------------------===//
@@ -16,7 +16,7 @@
 #include "llvm/Module.h"
 #include "llvm/ModuleProvider.h"
 #include "llvm/ADT/SetOperations.h"
-#include "llvm/Bytecode/Archive.h"
+#include "llvm/Bitcode/Archive.h"
 #include "llvm/Config/config.h"
 #include <memory>
 #include <set>
@@ -96,7 +96,7 @@
   // Open the archive file
   verbose("Linking archive file '" + Filename.toString() + "'");
 
-  // Find all of the symbols currently undefined in the bytecode program.
+  // Find all of the symbols currently undefined in the bitcode program.
   // If all the symbols are defined, the program is complete, and there is
   // no reason to link in any archive files.
   std::set<std::string> UndefinedSymbols;


Index: llvm/lib/Linker/Linker.cpp
diff -u llvm/lib/Linker/Linker.cpp:1.15 llvm/lib/Linker/Linker.cpp:1.16
--- llvm/lib/Linker/Linker.cpp:1.15	Sun May  6 01:02:13 2007
+++ llvm/lib/Linker/Linker.cpp	Sun May  6 04:29:13 2007
@@ -13,16 +13,12 @@
 
 #include "llvm/Linker.h"
 #include "llvm/Module.h"
-#include "llvm/Bytecode/Reader.h"
 #include "llvm/Bitcode/ReaderWriter.h"
 #include "llvm/Config/config.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/Streams.h"
-#include "llvm/Support/Compressor.h"
 using namespace llvm;
 
-static const bool Bitcode = false;
-
 Linker::Linker(const std::string& progname, const std::string& modname, unsigned flags)
   : Composite(0)
   , LibPaths()
@@ -107,18 +103,13 @@
   Module *Result = 0;
   
   const std::string &FNS = FN.toString();
-  if (Bitcode) {
-    std::auto_ptr<MemoryBuffer> Buffer(
+  std::auto_ptr<MemoryBuffer> Buffer(
                           MemoryBuffer::getFileOrSTDIN(&FNS[0], FNS.size()));
-    if (Buffer.get())
-      Result = ParseBitcodeFile(Buffer.get(), &ParseErrorMessage);
-    else
-      ParseErrorMessage = "Error reading file '" + FNS + "'";
+  if (Buffer.get())
+    Result = ParseBitcodeFile(Buffer.get(), &ParseErrorMessage);
+  else
+    ParseErrorMessage = "Error reading file '" + FNS + "'";
     
-  } else {
-    Result = ParseBytecodeFile(FNS, Compressor::decompressToNewBuffer,
-                               &ParseErrorMessage);
-  }
   if (Result)
     return std::auto_ptr<Module>(Result);
   Error = "Bytecode file '" + FN.toString() + "' could not be loaded";






More information about the llvm-commits mailing list