From 8a789e0204a2e03b6907ee0da45fb68fba2e0841 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 2 Feb 2016 20:24:31 +0000 Subject: [PATCH] ELF: Use StringRef instead of std::string. All MemoryBuffers for archive files are guaranteed to exist as long as their children are used in the linker. So we don't need to copy strings here. Thanks to Sean Silva for pointing this out. llvm-svn: 259554 --- lld/ELF/InputFiles.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h index 8ed49b9d3932..374bdd8c9aaf 100644 --- a/lld/ELF/InputFiles.h +++ b/lld/ELF/InputFiles.h @@ -41,7 +41,7 @@ public: // Filename of .a which contained this file. If this file was // not in an archive file, it is the empty string. We use this // string for creating error messages. - std::string ArchiveName; + StringRef ArchiveName; protected: InputFile(Kind K, MemoryBufferRef M) : MB(M), FileKind(K) {}