diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-23 22:45:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-23 22:45:37 +0000 |
commit | c521f54198dd90f6f97ada02ae8915af51181c5d (patch) | |
tree | caf5f95bcc3a5b8944c2e60b59f2317deb68a289 /llvm/lib/Linker/Linker.cpp | |
parent | 3441b4f77ed51d4a5a5bf172e370afa4ac048244 (diff) | |
download | bcm5719-llvm-c521f54198dd90f6f97ada02ae8915af51181c5d.tar.gz bcm5719-llvm-c521f54198dd90f6f97ada02ae8915af51181c5d.zip |
Prune #includes from llvm/Linker.h and llvm/System/Path.h,
forcing them down into various .cpp files.
This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
instead.
4. Weans llvm-db off <iostream>
sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.
llvm-svn: 79869
Diffstat (limited to 'llvm/lib/Linker/Linker.cpp')
-rw-r--r-- | llvm/lib/Linker/Linker.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/llvm/lib/Linker/Linker.cpp b/llvm/lib/Linker/Linker.cpp index bd569b50653..aef79d08f42 100644 --- a/llvm/lib/Linker/Linker.cpp +++ b/llvm/lib/Linker/Linker.cpp @@ -14,9 +14,10 @@ #include "llvm/Linker.h" #include "llvm/Module.h" #include "llvm/Bitcode/ReaderWriter.h" -#include "llvm/Config/config.h" +#include "llvm/System/Path.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Config/config.h" using namespace llvm; Linker::Linker(const StringRef &progname, const StringRef &modname, @@ -69,11 +70,8 @@ Linker::addPath(const sys::Path& path) { void Linker::addPaths(const std::vector<std::string>& paths) { - for (unsigned i = 0; i != paths.size(); ++i) { - sys::Path aPath; - aPath.set(paths[i]); - LibPaths.push_back(aPath); - } + for (unsigned i = 0, e = paths.size(); i != e; ++i) + LibPaths.push_back(sys::Path(paths[i])); } void @@ -100,16 +98,15 @@ Linker::LoadObject(const sys::Path &FN) { std::string ParseErrorMessage; Module *Result = 0; - const std::string &FNS = FN.toString(); - std::auto_ptr<MemoryBuffer> Buffer(MemoryBuffer::getFileOrSTDIN(FNS.c_str())); + std::auto_ptr<MemoryBuffer> Buffer(MemoryBuffer::getFileOrSTDIN(FN.c_str())); if (Buffer.get()) Result = ParseBitcodeFile(Buffer.get(), Context, &ParseErrorMessage); else - ParseErrorMessage = "Error reading file '" + FNS + "'"; + ParseErrorMessage = "Error reading file '" + FN.str() + "'"; if (Result) return std::auto_ptr<Module>(Result); - Error = "Bitcode file '" + FN.toString() + "' could not be loaded"; + Error = "Bitcode file '" + FN.str() + "' could not be loaded"; if (ParseErrorMessage.size()) Error += ": " + ParseErrorMessage; return std::auto_ptr<Module>(); |