switch tools to bitcode instead of bytecode

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36868 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2007-05-06 09:29:57 +00:00
parent 4bcca0f2ac
commit 44dadffe4b
22 changed files with 69 additions and 235 deletions

View File

@@ -15,8 +15,8 @@
#include "CompilerDriver.h"
#include "ConfigLexer.h"
#include "llvm/Module.h"
#include "llvm/ModuleProvider.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Bytecode/Reader.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Timer.h"
#include "llvm/System/Signals.h"
@@ -27,8 +27,6 @@
using namespace llvm;
static bool Bitcode = false;
namespace {
void WriteAction(CompilerDriver::Action* action ) {
@@ -69,17 +67,12 @@ void DumpConfigData(CompilerDriver::ConfigData* cd, const std::string& type ){
static bool GetBytecodeDependentLibraries(const std::string &fname,
Module::LibraryListType& deplibs,
BCDecompressor_t *BCDC,
std::string* ErrMsg) {
ModuleProvider *MP = 0;
if (Bitcode) {
if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(&fname[0],
fname.size())) {
MP = getBitcodeModuleProvider(Buffer);
if (MP == 0) delete Buffer;
}
} else {
MP = getBytecodeModuleProvider(fname, BCDC, ErrMsg);
if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(&fname[0],
fname.size())) {
MP = getBitcodeModuleProvider(Buffer);
if (MP == 0) delete Buffer;
}
if (!MP) {
deplibs.clear();
@@ -598,9 +591,7 @@ private:
if (fullpath.isBytecodeFile()) {
// Process the dependent libraries recursively
Module::LibraryListType modlibs;
if (GetBytecodeDependentLibraries(fullpath.toString(),modlibs,
Compressor::decompressToNewBuffer,
&err)) {
if (GetBytecodeDependentLibraries(fullpath.toString(),modlibs, &err)) {
// Traverse the dependent libraries list
Module::lib_iterator LI = modlibs.begin();
Module::lib_iterator LE = modlibs.end();