switch this to bitcode instead of bytecode
authorChris Lattner <sabre@nondot.org>
Sun, 6 May 2007 09:29:13 +0000 (09:29 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 May 2007 09:29:13 +0000 (09:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36867 91177308-0d34-0410-b5e6-96231b3b80d8

examples/ModuleMaker/Makefile
examples/ModuleMaker/ModuleMaker.cpp
lib/Debugger/Debugger.cpp
lib/Linker/LinkArchives.cpp
lib/Linker/Linker.cpp

index f669bf2593043150c96dad90fc38e1c2253d094a..8bb934f873f19da703a5664edbc0543419a9cbc9 100644 (file)
@@ -9,6 +9,6 @@
 LEVEL=../..
 TOOLNAME=ModuleMaker
 EXAMPLE_TOOL = 1
-LINK_COMPONENTS := bcwriter
+LINK_COMPONENTS := bitwriter
 
 include $(LEVEL)/Makefile.common
index 4983597952b2b55df84e2062c32410770a7b8c3e..ec7398c97ff9c59061001de7dc0e3c7910ae1467 100644 (file)
@@ -17,8 +17,8 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Constants.h"
 #include "llvm/Instructions.h"
-#include "llvm/Bytecode/Writer.h"
-#include "llvm/Support/Streams.h"
+#include "llvm/Bitcode/ReaderWriter.h"
+#include <iostream>
 using namespace llvm;
 
 int main() {
@@ -53,7 +53,7 @@ int main() {
   BB->getInstList().push_back(new ReturnInst(Add));
 
   // Output the bytecode file to stdout
-  WriteBytecodeToFile(M, cout);
+  WriteBitcodeToFile(M, std::cout);
 
   // Delete the module and all of its contents.
   delete M;
index 90741afc8e012115f2030b7fc6b3c609d94c53c2..a38bde7cc36061f9f085ad67b930fcf8101deba4 100644 (file)
@@ -14,7 +14,6 @@
 #include "llvm/Debugger/Debugger.h"
 #include "llvm/Module.h"
 #include "llvm/ModuleProvider.h"
-#include "llvm/Bytecode/Reader.h"
 #include "llvm/Bitcode/ReaderWriter.h"
 #include "llvm/Debugger/InferiorProcess.h"
 #include "llvm/Support/MemoryBuffer.h"
@@ -22,8 +21,6 @@
 #include <memory>
 using namespace llvm;
 
-static bool Bitcode = false;
-
 /// Debugger constructor - Initialize the debugger to its initial, empty, state.
 ///
 Debugger::Debugger() : Environment(0), Program(0), Process(0) {
@@ -49,15 +46,11 @@ std::string Debugger::getProgramPath() const {
 
 static Module *
 getMaterializedModuleProvider(const std::string &Filename) {
-  if (Bitcode) {
-    return ParseBytecodeFile(Filename);
-  } else {
-    std::auto_ptr<MemoryBuffer> Buffer;
-    Buffer.reset(MemoryBuffer::getFileOrSTDIN(&Filename[0], Filename.size()));
-    if (Buffer.get())
-      return ParseBitcodeFile(Buffer.get());
-    return 0;
-  }
+  std::auto_ptr<MemoryBuffer> Buffer;
+  Buffer.reset(MemoryBuffer::getFileOrSTDIN(&Filename[0], Filename.size()));
+  if (Buffer.get())
+    return ParseBitcodeFile(Buffer.get());
+  return 0;
 }
 
 /// loadProgram - If a program is currently loaded, unload it.  Then search
index e6a3b8a52309673fe3b0821f38e20bd9d9630f9b..416b2857db72d2379a91cc0e3c433aa897d2e9af 100644 (file)
@@ -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 @@ Linker::LinkInArchive(const sys::Path &Filename, bool &is_native) {
   // 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 bfa30044dcf61b060ddc4f2e25181d70c98f99c2..077bcd7ba68fe9f1a6a570e12c6002bca52aec6f 100644 (file)
 
 #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 @@ Linker::LoadObject(const sys::Path &FN) {
   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";