Index: tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- tools/llvm-objdump/llvm-objdump.cpp +++ tools/llvm-objdump/llvm-objdump.cpp @@ -426,22 +426,22 @@ std::unordered_map> LineCache; private: - bool cacheSource(std::string File); + bool cacheSource(const std::string& File); public: - virtual ~SourcePrinter() {} - SourcePrinter() : Obj(nullptr), Symbolizer(nullptr) {} + SourcePrinter() : Obj(nullptr), Symbolizer(nullptr) = default; SourcePrinter(const ObjectFile *Obj, StringRef DefaultArch) : Obj(Obj) { symbolize::LLVMSymbolizer::Options SymbolizerOpts( DILineInfoSpecifier::FunctionNameKind::None, true, false, false, DefaultArch); Symbolizer.reset(new symbolize::LLVMSymbolizer(SymbolizerOpts)); } + virtual ~SourcePrinter() = default; virtual void printSourceLine(raw_ostream &OS, uint64_t Address, StringRef Delimiter = "; "); }; -bool SourcePrinter::cacheSource(std::string File) { +bool SourcePrinter::cacheSource(const std::string& File) { auto BufferOrError = MemoryBuffer::getFile(File); if (!BufferOrError) return false; @@ -509,7 +509,7 @@ class PrettyPrinter { public: - virtual ~PrettyPrinter(){} + virtual ~PrettyPrinter() = default; virtual void printInst(MCInstPrinter &IP, const MCInst *MI, ArrayRef Bytes, uint64_t Address, raw_ostream &OS, StringRef Annot,