diff options
Diffstat (limited to 'tools/lto')
-rw-r--r-- | tools/lto/Makefile | 2 | ||||
-rw-r--r-- | tools/lto/lto.cpp | 25 |
2 files changed, 5 insertions, 22 deletions
diff --git a/tools/lto/Makefile b/tools/lto/Makefile index 6cb1a7b..1b349f7 100644 --- a/tools/lto/Makefile +++ b/tools/lto/Makefile @@ -24,7 +24,7 @@ else BUILD_ARCHIVE = 1 endif -LINK_COMPONENTS := $(TARGETS_TO_BUILD) ipo scalaropts linker bcreader bcwriter bitreader bitwriter +LINK_COMPONENTS := $(TARGETS_TO_BUILD) ipo scalaropts linker bitreader bitwriter include $(LEVEL)/Makefile.common diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp index f7ea310..3420cdf 100644 --- a/tools/lto/lto.cpp +++ b/tools/lto/lto.cpp @@ -17,9 +17,8 @@ #include "llvm/Linker.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" +#include "llvm/ModuleProvider.h" #include "llvm/Bitcode/ReaderWriter.h" -#include "llvm/Bytecode/Reader.h" -#include "llvm/Bytecode/Writer.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/SystemUtils.h" @@ -40,7 +39,6 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Analysis/LoadValueNumbering.h" #include "llvm/Support/MathExtras.h" -#include "llvm/Support/Streams.h" #include "llvm/LinkTimeOptimizer.h" #include <fstream> #include <ostream> @@ -53,8 +51,6 @@ llvm::LinkTimeOptimizer *createLLVMOptimizer() return l; } -static bool Bitcode = false; - /// If symbol is not used then make it internal and let optimizer takes /// care of it. void LLVMSymbol::mayBeNotUsed() { @@ -121,16 +117,13 @@ LTO::getModule(const std::string &InputFilename) NameToModuleMap::iterator pos = allModules.find(InputFilename.c_str()); if (pos != allModules.end()) m = allModules[InputFilename.c_str()]; - else if (Bitcode) { + else { if (MemoryBuffer *Buffer = MemoryBuffer::getFile(&InputFilename[0], InputFilename.size())) { m = ParseBitcodeFile(Buffer); delete Buffer; } allModules[InputFilename.c_str()] = m; - } else { - m = ParseBytecodeFile(InputFilename); - allModules[InputFilename.c_str()] = m; } return m; } @@ -385,12 +378,7 @@ LTO::optimizeModules(const std::string &OutputFilename, std::string tempFileName(FinalOutputPath.c_str()); tempFileName += "0.bc"; std::ofstream Out(tempFileName.c_str(), io_mode); - if (Bitcode) { - WriteBitcodeToFile(bigOne, Out); - } else { - OStream L(Out); - WriteBytecodeToFile(bigOne, L); - } + WriteBitcodeToFile(bigOne, Out); } // Strip leading underscore because it was added to match names @@ -443,12 +431,7 @@ LTO::optimizeModules(const std::string &OutputFilename, std::string tempFileName(FinalOutputPath.c_str()); tempFileName += "1.bc"; std::ofstream Out(tempFileName.c_str(), io_mode); - if (Bitcode) { - WriteBitcodeToFile(bigOne, Out); - } else { - OStream L(Out); - WriteBytecodeToFile(bigOne, L); - } + WriteBitcodeToFile(bigOne, Out); } targetTriple = bigOne->getTargetTriple(); |