diff options
| author | Martin Storsjo <martin@martin.st> | 2019-01-22 10:57:59 +0000 |
|---|---|---|
| committer | Martin Storsjo <martin@martin.st> | 2019-01-22 10:57:59 +0000 |
| commit | 8010c6beaf638653cb73d8db18c1d9784be5a0de (patch) | |
| tree | 93bae0307cbfc0edb80485ac2a036f7f9515e395 /llvm/tools/llvm-objcopy/ELF | |
| parent | 21abd5df510d45cd7950b8037a0921c8307d3b9d (diff) | |
| download | bcm5719-llvm-8010c6beaf638653cb73d8db18c1d9784be5a0de.tar.gz bcm5719-llvm-8010c6beaf638653cb73d8db18c1d9784be5a0de.zip | |
[llvm-objcopy] Consistently use createStringError instead of make_error<StringError>
This was requested in the review of D57006.
Also add missing quotes around symbol names in error messages.
Differential Revision: https://reviews.llvm.org/D57014
llvm-svn: 351799
Diffstat (limited to 'llvm/tools/llvm-objcopy/ELF')
| -rw-r--r-- | llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp b/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp index db0cd76ced4..a2996395c1f 100644 --- a/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp +++ b/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp @@ -185,9 +185,10 @@ static Error dumpSectionToFile(StringRef SecName, StringRef Filename, for (auto &Sec : Obj.sections()) { if (Sec.Name == SecName) { if (Sec.OriginalData.empty()) - return make_error<StringError>("Can't dump section \"" + SecName + - "\": it has no contents", - object_error::parse_failed); + return createStringError( + object_error::parse_failed, + "Can't dump section \"%s\": it has no contents", + SecName.str().c_str()); Expected<std::unique_ptr<FileOutputBuffer>> BufferOrErr = FileOutputBuffer::create(Filename, Sec.OriginalData.size()); if (!BufferOrErr) @@ -200,8 +201,7 @@ static Error dumpSectionToFile(StringRef SecName, StringRef Filename, return Error::success(); } } - return make_error<StringError>("Section not found", - object_error::parse_failed); + return createStringError(object_error::parse_failed, "Section not found"); } static bool isCompressed(const SectionBase &Section) { |

