diff options
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/bugpoint/BugDriver.h | 4 | ||||
-rw-r--r-- | llvm/tools/bugpoint/ExecutionDriver.cpp | 2 | ||||
-rw-r--r-- | llvm/tools/dsymutil/DwarfLinker.cpp | 9 | ||||
-rw-r--r-- | llvm/tools/llvm-cov/CodeCoverage.cpp | 2 | ||||
-rw-r--r-- | llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | 2 | ||||
-rw-r--r-- | llvm/tools/llvm-nm/llvm-nm.cpp | 12 |
6 files changed, 16 insertions, 15 deletions
diff --git a/llvm/tools/bugpoint/BugDriver.h b/llvm/tools/bugpoint/BugDriver.h index 20efff3fda5..56ed8ab712e 100644 --- a/llvm/tools/bugpoint/BugDriver.h +++ b/llvm/tools/bugpoint/BugDriver.h @@ -76,7 +76,7 @@ public: // command line arguments into instance variables of BugDriver. // bool addSources(const std::vector<std::string> &FileNames); - void addPass(std::string p) { PassesToRun.push_back(p); } + void addPass(std::string p) { PassesToRun.push_back(std::move(p)); } void setPassesToRun(const std::vector<std::string> &PTR) { PassesToRun = PTR; } @@ -183,7 +183,7 @@ public: /// Error. /// std::string executeProgramSafely(const Module *Program, - std::string OutputFile, + const std::string &OutputFile, std::string *Error) const; /// createReferenceFile - calls compileProgram and then records the output diff --git a/llvm/tools/bugpoint/ExecutionDriver.cpp b/llvm/tools/bugpoint/ExecutionDriver.cpp index 41b8ccc18e8..ab9c05fa924 100644 --- a/llvm/tools/bugpoint/ExecutionDriver.cpp +++ b/llvm/tools/bugpoint/ExecutionDriver.cpp @@ -384,7 +384,7 @@ std::string BugDriver::executeProgram(const Module *Program, /// backend, if reference output is not provided. /// std::string BugDriver::executeProgramSafely(const Module *Program, - std::string OutputFile, + const std::string &OutputFile, std::string *Error) const { return executeProgram(Program, OutputFile, "", "", SafeInterpreter, Error); } diff --git a/llvm/tools/dsymutil/DwarfLinker.cpp b/llvm/tools/dsymutil/DwarfLinker.cpp index 3a5718b2b20..bea30ded591 100644 --- a/llvm/tools/dsymutil/DwarfLinker.cpp +++ b/llvm/tools/dsymutil/DwarfLinker.cpp @@ -531,7 +531,7 @@ public: /// original \p Entries. void emitRangesEntries( int64_t UnitPcOffset, uint64_t OrigLowPc, - FunctionIntervals::const_iterator FuncRange, + const FunctionIntervals::const_iterator &FuncRange, const std::vector<DWARFDebugRangeList::RangeListEntry> &Entries, unsigned AddressSize); @@ -715,7 +715,7 @@ void DwarfStreamer::emitStrings(const NonRelocatableStringpool &Pool) { /// sized addresses describing the ranges. void DwarfStreamer::emitRangesEntries( int64_t UnitPcOffset, uint64_t OrigLowPc, - FunctionIntervals::const_iterator FuncRange, + const FunctionIntervals::const_iterator &FuncRange, const std::vector<DWARFDebugRangeList::RangeListEntry> &Entries, unsigned AddressSize) { MS->SwitchSection(MC->getObjectFileInfo()->getDwarfRangesSection()); @@ -1416,7 +1416,7 @@ private: /// \defgroup Helpers Various helper methods. /// /// @{ - bool createStreamer(Triple TheTriple, StringRef OutputFilename); + bool createStreamer(const Triple &TheTriple, StringRef OutputFilename); /// \brief Attempt to load a debug object from disk. ErrorOr<const object::ObjectFile &> loadObject(BinaryHolder &BinaryHolder, @@ -1744,7 +1744,8 @@ void DwarfLinker::reportWarning(const Twine &Warning, const DWARFUnit *Unit, 6 /* Indent */); } -bool DwarfLinker::createStreamer(Triple TheTriple, StringRef OutputFilename) { +bool DwarfLinker::createStreamer(const Triple &TheTriple, + StringRef OutputFilename) { if (Options.NoOutput) return true; diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp index cd786edc25d..1d40a28e286 100644 --- a/llvm/tools/llvm-cov/CodeCoverage.cpp +++ b/llvm/tools/llvm-cov/CodeCoverage.cpp @@ -72,7 +72,7 @@ public: int run(Command Cmd, int argc, const char **argv); - typedef std::function<int(int, const char **)> CommandLineParserType; + typedef llvm::function_ref<int(int, const char **)> CommandLineParserType; int show(int argc, const char **argv, CommandLineParserType commandLineParser); diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp index b0facfb294d..7079ed215c0 100644 --- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp +++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp @@ -114,7 +114,7 @@ static void DumpInput(StringRef Filename) { /// If the input path is a .dSYM bundle (as created by the dsymutil tool), /// replace it with individual entries for each of the object files inside the /// bundle otherwise return the input path. -static std::vector<std::string> expandBundle(std::string InputPath) { +static std::vector<std::string> expandBundle(const std::string &InputPath) { std::vector<std::string> BundlePaths; SmallString<256> BundlePath(InputPath); // Manually open up the bundle to avoid introducing additional dependencies. diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index d838ad870ba..1e4a7eee373 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -597,8 +597,8 @@ static void darwinPrintStab(MachOObjectFile *MachO, SymbolListT::iterator I) { } static void sortAndPrintSymbolList(SymbolicFile &Obj, bool printName, - std::string ArchiveName, - std::string ArchitectureName) { + const std::string &ArchiveName, + const std::string &ArchitectureName) { if (!NoSort) { std::function<bool(const NMSymbol &, const NMSymbol &)> Cmp; if (NumericSort) @@ -963,10 +963,10 @@ static unsigned getNsectInMachO(MachOObjectFile &Obj, BasicSymbolRef Sym) { return (STE.n_type & MachO::N_TYPE) == MachO::N_SECT ? STE.n_sect : 0; } -static void dumpSymbolNamesFromObject(SymbolicFile &Obj, bool printName, - std::string ArchiveName = std::string(), - std::string ArchitectureName = - std::string()) { +static void +dumpSymbolNamesFromObject(SymbolicFile &Obj, bool printName, + const std::string &ArchiveName = std::string(), + const std::string &ArchitectureName = std::string()) { auto Symbols = Obj.symbols(); if (DynamicSyms) { const auto *E = dyn_cast<ELFObjectFileBase>(&Obj); |