diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2021-01-07 12:34:11 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2021-01-07 12:53:29 +0000 |
commit | a9a8caf2ce2ff08a20cc145d23270e6c91709baa (patch) | |
tree | e991582e0f8009f17aac0b6db9e5be62ce239653 /llvm/tools/llvm-objdump/llvm-objdump.cpp | |
parent | 028091195d763190d9b57ae316c8601fe223c02c (diff) | |
download | llvm-a9a8caf2ce2ff08a20cc145d23270e6c91709baa.zip llvm-a9a8caf2ce2ff08a20cc145d23270e6c91709baa.tar.gz llvm-a9a8caf2ce2ff08a20cc145d23270e6c91709baa.tar.bz2 |
[llvm-objdump] Pass Twine by const reference instead of by value. NFCI.
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/llvm-objdump.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 5ac25d7..3134f98 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -29,6 +29,7 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringSet.h" #include "llvm/ADT/Triple.h" +#include "llvm/ADT/Twine.h" #include "llvm/CodeGen/FaultMaps.h" #include "llvm/DebugInfo/DWARF/DWARFContext.h" #include "llvm/DebugInfo/Symbolize/Symbolize.h" @@ -448,7 +449,7 @@ std::string objdump::getFileNameForError(const object::Archive::Child &C, return "<file index: " + std::to_string(Index) + ">"; } -void objdump::reportWarning(Twine Message, StringRef File) { +void objdump::reportWarning(const Twine &Message, StringRef File) { // Output order between errs() and outs() matters especially for archive // files where the output is per member object. outs().flush(); @@ -457,7 +458,7 @@ void objdump::reportWarning(Twine Message, StringRef File) { } LLVM_ATTRIBUTE_NORETURN void objdump::reportError(StringRef File, - Twine Message) { + const Twine &Message) { outs().flush(); WithColor::error(errs(), ToolName) << "'" << File << "': " << Message << "\n"; exit(1); @@ -480,11 +481,11 @@ LLVM_ATTRIBUTE_NORETURN void objdump::reportError(Error E, StringRef FileName, exit(1); } -static void reportCmdLineWarning(Twine Message) { +static void reportCmdLineWarning(const Twine &Message) { WithColor::warning(errs(), ToolName) << Message << "\n"; } -LLVM_ATTRIBUTE_NORETURN static void reportCmdLineError(Twine Message) { +LLVM_ATTRIBUTE_NORETURN static void reportCmdLineError(const Twine &Message) { WithColor::error(errs(), ToolName) << Message << "\n"; exit(1); } |