llvm.org GIT mirror llvm / b824684
Fix dangling StringRefs found by clang-tidy misc-dangling-handle check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307085 91177308-0d34-0410-b5e6-96231b3b80d8 Alexander Kornienko 3 years ago
2 changed file(s) with 8 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
382382
383383 for (auto &ModPath : Index.modulePaths()) {
384384 const auto &Filename = ModPath.first();
385 auto CurrentActivity = "loading file '" + Filename + "'";
385 std::string CurrentActivity = ("loading file '" + Filename + "'").str();
386386 auto InputOrErr = MemoryBuffer::getFile(Filename);
387387 error(InputOrErr, "error " + CurrentActivity);
388388 InputBuffers.push_back(std::move(*InputOrErr));
474474 std::vector> InputBuffers;
475475 for (unsigned i = 0; i < InputFilenames.size(); ++i) {
476476 auto &Filename = InputFilenames[i];
477 StringRef CurrentActivity = "loading file '" + Filename + "'";
477 std::string CurrentActivity = "loading file '" + Filename + "'";
478478 auto InputOrErr = MemoryBuffer::getFile(Filename);
479479 error(InputOrErr, "error " + CurrentActivity);
480480 InputBuffers.push_back(std::move(*InputOrErr));
709709 std::vector> InputBuffers;
710710 for (unsigned i = 0; i < InputFilenames.size(); ++i) {
711711 auto &Filename = InputFilenames[i];
712 StringRef CurrentActivity = "loading file '" + Filename + "'";
712 std::string CurrentActivity = "loading file '" + Filename + "'";
713713 auto InputOrErr = MemoryBuffer::getFile(Filename);
714714 error(InputOrErr, "error " + CurrentActivity);
715715 InputBuffers.push_back(std::move(*InputOrErr));
16361636 case COFF::IMAGE_REL_BASED_HIGHADJ: return "HIGHADJ";
16371637 case COFF::IMAGE_REL_BASED_ARM_MOV32T: return "ARM_MOV32(T)";
16381638 case COFF::IMAGE_REL_BASED_DIR64: return "DIR64";
1639 default: return "unknown (" + llvm::utostr(Type) + ")";
1639 default: {
1640 static std::string Result;
1641 Result = "unknown (" + llvm::utostr(Type) + ")";
1642 return Result;
1643 }
16401644 }
16411645 }
16421646