From d1d7cfcd520ec67f6ce0dd284980c040d98b9fbb Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 20 Sep 2016 00:02:06 +0000 Subject: [PATCH] Remove a use of std::list. llvm-svn: 281951 --- lld/ELF/LinkerScript.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h index 373e98e..edd098d 100644 --- a/lld/ELF/LinkerScript.h +++ b/lld/ELF/LinkerScript.h @@ -21,7 +21,6 @@ #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Regex.h" #include -#include namespace lld { namespace elf { @@ -101,6 +100,15 @@ struct OutputSectionCommand : BaseCommand { // This struct represents one section match pattern in SECTIONS() command. // It can optionally have negative match pattern for EXCLUDED_FILE command. struct SectionPattern { + SectionPattern(llvm::Regex &&Re1, llvm::Regex &&Re2) + : ExcludedFileRe(std::forward(Re1)), + SectionRe(std::forward(Re2)) {} + + SectionPattern(SectionPattern &&Other) { + std::swap(ExcludedFileRe, Other.ExcludedFileRe); + std::swap(SectionRe, Other.SectionRe); + } + llvm::Regex ExcludedFileRe; llvm::Regex SectionRe; }; @@ -116,9 +124,7 @@ struct InputSectionDescription : BaseCommand { // Input sections that matches at least one of SectionPatterns // will be associated with this InputSectionDescription. - // We use std::list instead of std::vector because SectionPattern - // do not support move assignment. - std::list SectionPatterns; + std::vector SectionPatterns; std::vector Sections; }; -- 2.7.4