[llvm] r299993 - Avoid some string copies, NFC
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 11 15:11:46 PDT 2017
Author: vedantk
Date: Tue Apr 11 17:11:46 2017
New Revision: 299993
URL: http://llvm.org/viewvc/llvm-project?rev=299993&view=rev
Log:
Avoid some string copies, NFC
Modified:
llvm/trunk/tools/llvm-cat/llvm-cat.cpp
Modified: llvm/trunk/tools/llvm-cat/llvm-cat.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cat/llvm-cat.cpp?rev=299993&r1=299992&r2=299993&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cat/llvm-cat.cpp (original)
+++ llvm/trunk/tools/llvm-cat/llvm-cat.cpp Tue Apr 11 17:11:46 2017
@@ -40,7 +40,7 @@ int main(int argc, char **argv) {
SmallVector<char, 0> Buffer;
BitcodeWriter Writer(Buffer);
if (BinaryCat) {
- for (std::string InputFilename : InputFilenames) {
+ for (const auto &InputFilename : InputFilenames) {
std::unique_ptr<MemoryBuffer> MB = ExitOnErr(
errorOrToExpected(MemoryBuffer::getFileOrSTDIN(InputFilename)));
std::vector<BitcodeModule> Mods = ExitOnErr(getBitcodeModuleList(*MB));
@@ -49,7 +49,7 @@ int main(int argc, char **argv) {
BitcodeMod.getBuffer().end());
}
} else {
- for (std::string InputFilename : InputFilenames) {
+ for (const auto &InputFilename : InputFilenames) {
SMDiagnostic Err;
std::unique_ptr<Module> M = parseIRFile(InputFilename, Err, Context);
if (!M) {
More information about the llvm-commits
mailing list