summaryrefslogtreecommitdiff
path: root/lib/Linker/LinkItems.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-08-16 07:47:30 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-08-16 07:47:30 +0000
commit49068bf31113e9f048bac5eda372835ed63e4f84 (patch)
tree61746ad38f9572fe7799f24762bddf663a9840b3 /lib/Linker/LinkItems.cpp
parenta6db2d3df22ee173e653a441a8be3f0810ce8631 (diff)
downloadllvm-49068bf31113e9f048bac5eda372835ed63e4f84.tar.gz
llvm-49068bf31113e9f048bac5eda372835ed63e4f84.tar.bz2
llvm-49068bf31113e9f048bac5eda372835ed63e4f84.tar.xz
Improve error handling in the linker by:
1. Eliminate redundant error messages. LinkInFile and LinkInArchive already call the error() method in each case so there's no use telling the user again that an item couldn't be linked in. 2. Improve the formatting of error messages (separating content). 3. Change the wording for the warning about unrecognized files. Make it clear that the file is being ignored. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41121 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker/LinkItems.cpp')
-rw-r--r--lib/Linker/LinkItems.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Linker/LinkItems.cpp b/lib/Linker/LinkItems.cpp
index 976dee0353..95050d0750 100644
--- a/lib/Linker/LinkItems.cpp
+++ b/lib/Linker/LinkItems.cpp
@@ -87,7 +87,7 @@ bool Linker::LinkInLibrary(const std::string& Lib, bool& is_native) {
case sys::Bitcode_FileType:
// LLVM ".so" file.
if (LinkInFile(Pathname, is_native))
- return error("Cannot link file '" + Pathname.toString() + "'");
+ return true;
break;
case sys::Archive_FileType:
@@ -180,24 +180,24 @@ bool Linker::LinkInFile(const sys::Path &File, bool &is_native) {
switch (sys::IdentifyFileType(Magic.c_str(), 64)) {
default: assert(0 && "Bad file type identification");
case sys::Unknown_FileType:
- return warning("Supposed object file '" + File.toString() +
- "' not recognized as such");
+ return warning("Ignoring file '" + File.toString() +
+ "' because does not contain bitcode.");
case sys::Archive_FileType:
// A user may specify an ar archive without -l, perhaps because it
// is not installed as a library. Detect that and link the archive.
verbose("Linking archive file '" + File.toString() + "'");
if (LinkInArchive(File, is_native))
- return error("Cannot link archive '" + File.toString() + "'");
+ return true;
break;
case sys::Bitcode_FileType: {
verbose("Linking bitcode file '" + File.toString() + "'");
std::auto_ptr<Module> M(LoadObject(File));
if (M.get() == 0)
- return error("Cannot load file '" + File.toString() + "'" + Error);
+ return error("Cannot load file '" + File.toString() + "': " + Error);
if (LinkInModule(M.get(), &Error))
- return error("Cannot link file '" + File.toString() + "'" + Error);
+ return error("Cannot link file '" + File.toString() + "': " + Error);
verbose("Linked in file '" + File.toString() + "'");
break;