[lld] r230219 - [ELF][Writer] Use llvm::StringMap instead

David Blaikie dblaikie at gmail.com
Mon Feb 23 08:56:46 PST 2015


On Mon, Feb 23, 2015 at 5:50 AM, Shankar Easwaran <shankare at codeaurora.org>
wrote:

> Author: shankare
> Date: Mon Feb 23 07:50:23 2015
> New Revision: 230219
>
> URL: http://llvm.org/viewvc/llvm-project?rev=230219&view=rev
> Log:
> [ELF][Writer] Use llvm::StringMap instead
>

This does change the semantics somewhat - StringMaps own their strings. do
you need that? (if so, is there a test case for where the map<StringRef was
insufficient?) Or does this use case neither require nor forbid copying the
strings, and just benefit from the StringMap optimizations in memory, etc?


>
> Cleanup.
>
> Modified:
>     lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h
>
> Modified: lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h?rev=230219&r1=230218&r2=230219&view=diff
>
> ==============================================================================
> --- lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h (original)
> +++ lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h Mon Feb 23 07:50:23 2015
> @@ -148,7 +148,7 @@ public:
>
>    // Output Sections contain the map of Sectionnames to a vector of
> sections,
>    // that have been merged to form a single section
> -  typedef std::map<StringRef, OutputSection<ELFT> *> OutputSectionMapT;
> +  typedef llvm::StringMap<OutputSection<ELFT> *> OutputSectionMapT;
>    typedef
>        typename std::vector<OutputSection<ELFT> *>::iterator
> OutputSectionIter;
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150223/6a6db706/attachment.html>


More information about the llvm-commits mailing list