<div dir="ltr">(please include the fix in the patch for review)<br><br>I think the fix could probably happen at a higher level to avoid the linear search. Perhaps we could get the canonical decl for a using decl - that way a redecl wouldn't be a 'new' thing? I suppose we'd still need a map of them, that perhaps we don't have already.<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 4, 2016 at 4:42 AM, Amjad Aboud via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">aaboud created this revision.<br>
aaboud added reviewers: aprantl, dblaikie.<br>
aaboud added a subscriber: llvm-commits.<br>
<br>
Fixed DIBuilder to verify that same imported entity will not be added twice to the "imports" list of the DICompileUnit.<br>
<br>
<a href="http://reviews.llvm.org/D17884" rel="noreferrer" target="_blank">http://reviews.llvm.org/D17884</a><br>
<br>
Files:<br>
  lib/IR/DIBuilder.cpp<br>
<br>
Index: lib/IR/DIBuilder.cpp<br>
===================================================================<br>
--- lib/IR/DIBuilder.cpp<br>
+++ lib/IR/DIBuilder.cpp<br>
@@ -169,6 +169,11 @@<br>
                      Metadata *NS, unsigned Line, StringRef Name,<br>
                      SmallVectorImpl<TrackingMDNodeRef> &AllImportedModules) {<br>
   auto *M = DIImportedEntity::get(C, Tag, Context, DINodeRef(NS), Line, Name);<br>
+  // Assure no duplications in AllImportedModules list.<br>
+  for (auto IM : AllImportedModules) {<br>
+    if (IM == M)<br>
+      return M;<br>
+  }<br>
   AllImportedModules.emplace_back(M);<br>
   return M;<br>
 }<br>
<br>
<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div></div>