summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/Error.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-05-06 20:16:28 +0000
committerKevin Enderby <enderby@apple.com>2016-05-06 20:16:28 +0000
commitd4e075be63c6b654147b91d363ee16f74ad744bf (patch)
tree1882d375fa5913136c72653f9fa24acb09d7037a /llvm/lib/Object/Error.cpp
parent62023f24edb38a642cbceb5cb80e5c4ae01a2c05 (diff)
downloadbcm5719-llvm-d4e075be63c6b654147b91d363ee16f74ad744bf.tar.gz
bcm5719-llvm-d4e075be63c6b654147b91d363ee16f74ad744bf.zip
Change GenericBinaryError to no longer include a FileName, which is then not
part of the error message. As the caller is the one that needs to add the name of where the "object file" comes from to the error message as the object file could be in an archive, or coming from a slice of a Mach-O universal file or a buffer created by a JIT. In the cases of a Mach-O universal file the architecture name may or may not also need to be printed which is up to the tool code. For example if the tool code is only selecting the host architecture slice then that architecture name is never printed. This patch is the change to the libObject code and there will be follow on commits for changes to the code for each tool. llvm-svn: 268789
Diffstat (limited to 'llvm/lib/Object/Error.cpp')
-rw-r--r--llvm/lib/Object/Error.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Object/Error.cpp b/llvm/lib/Object/Error.cpp
index 1ec9d26e941..15bce7727dc 100644
--- a/llvm/lib/Object/Error.cpp
+++ b/llvm/lib/Object/Error.cpp
@@ -55,16 +55,15 @@ std::string _object_error_category::message(int EV) const {
char BinaryError::ID = 0;
char GenericBinaryError::ID = 0;
-GenericBinaryError::GenericBinaryError(std::string FileName, Twine Msg)
- : FileName(std::move(FileName)), Msg(Msg.str()) {}
+GenericBinaryError::GenericBinaryError(Twine Msg) : Msg(Msg.str()) {}
-GenericBinaryError::GenericBinaryError(std::string FileName, Twine Msg, object_error ECOverride)
- : FileName(std::move(FileName)), Msg(Msg.str()) {
+GenericBinaryError::GenericBinaryError(Twine Msg, object_error ECOverride)
+ : Msg(Msg.str()) {
setErrorCode(make_error_code(ECOverride));
}
void GenericBinaryError::log(raw_ostream &OS) const {
- OS << "Error in " << FileName << ": " << Msg;
+ OS << Msg;
}
static ManagedStatic<_object_error_category> error_category;
OpenPOWER on IntegriCloud