<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 14, 2015 at 12:43 PM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 3/14/2015 1:52 PM, David Blaikie wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, Mar 13, 2015 at 10:26 PM, Shankar Easwaran <<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>><br>
wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: shankare<br>
Date: Sat Mar 14 00:26:55 2015<br>
New Revision: 232251<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=232251&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=232251&view=rev</a><br>
Log:<br>
[ELF] Fix DenseMapInfo for StringRef<br>
<br>
Modified:<br>
     lld/trunk/lib/ReaderWriter/<u></u>ELF/SectionChunks.h<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/<u></u>ELF/SectionChunks.h<br>
URL:<br>
<a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h?rev=232251&r1=232250&r2=232251&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/lib/<u></u>ReaderWriter/ELF/<u></u>SectionChunks.h?rev=232251&r1=<u></u>232250&r2=232251&view=diff</a><br>
<br>
==============================<u></u>==============================<u></u>==================<br>
--- lld/trunk/lib/ReaderWriter/<u></u>ELF/SectionChunks.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/<u></u>ELF/SectionChunks.h Sat Mar 14 00:26:55 2015<br>
@@ -574,7 +574,7 @@ private:<br>
<br>
    struct StringRefMappingInfo {<br>
      static StringRef getEmptyKey() { return StringRef(); }<br>
-    static StringRef getTombstoneKey() { return StringRef(" ", 0); }<br>
+    static StringRef getTombstoneKey() { return StringRef(" ", 1); }<br>
<br>
</blockquote>
These look really questionable/problematic - they're totally valid<br>
StringRef values  - I imagine maybe using the max value for a pointer (or<br>
for the length, or both) might be more suitable, but I haven't looked at a<br>
variety of DenseMap tombstones, etc, to see what's common.<br>
</blockquote></div></div>
In the context of when strings are being added to the StringTable(where the StringRefMappingInfo is used), the empty tombstone key is not valid.</blockquote><div><br>Ah, OK - thanks for the explanation.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
      static unsigned getHashValue(StringRef const val) {<br>
        return llvm::HashString(val);<br>
      }<br>
<br>
<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
<br>
</blockquote></blockquote>
<br>
<br></div></div><span class="HOEnZb"><font color="#888888">
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation<br>
<br>
</font></span></blockquote></div><br></div></div>