<div>FYI</div><br><div class="gmail_quote">On Fri, Mar 15, 2013 at 8:02 AM, Nico Weber <span dir="ltr"><<a href="mailto:nicolasweber@gmx.de" target="_blank">nicolasweber@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: nico<br>
Date: Fri Mar 15 10:02:37 2013<br>
New Revision: 177158<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=177158&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=177158&view=rev</a><br>
Log:<br>
Remove a pointless assertion.<br>
<br>
FindNodeOrInsertPos() is called 10 lines earlier already, and the function<br>
early-returns there if the result is != 0. InsertPos isn't recomputed after<br>
that check, so this assert is always trivially true. (And it has nothing to<br>
do with if T is canonical or not.)<br>
<br>
<br>
Modified:<br>
    cfe/trunk/lib/AST/ASTContext.cpp<br>
<br>
Modified: cfe/trunk/lib/AST/ASTContext.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=177158&r1=177157&r2=177158&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=177158&r1=177157&r2=177158&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/AST/ASTContext.cpp (original)<br>
+++ cfe/trunk/lib/AST/ASTContext.cpp Fri Mar 15 10:02:37 2013<br>
@@ -2026,13 +2026,9 @@ QualType ASTContext::getPointerType(Qual<br>
   // If the pointee type isn't canonical, this won't be a canonical type either,<br>
   // so fill in the canonical type field.<br>
   QualType Canonical;<br>
-  if (!T.isCanonical()) {<br>
+  if (!T.isCanonical())<br>
     Canonical = getPointerType(getCanonicalType(T));<br>
<br>
-    // Get the new insert position for the node we care about.<br>
-    PointerType *NewIP = PointerTypes.FindNodeOrInsertPos(ID, InsertPos);<br></blockquote><div><br></div><div>This was updating InsertPos, which may have been invalidated by the call to getPointerType.</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-    assert(NewIP == 0 && "Shouldn't be in the map!"); (void)NewIP;<br></blockquote><div><br></div><div>... and this was checking that the call to getPointerType didn't fill in that slot in the map, through a bad ID computation or confusion over whether T is canonical.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-  }<br>
   PointerType *New = new (*this, TypeAlignment) PointerType(T, Canonical);<br>
   Types.push_back(New);<br>
   PointerTypes.InsertNode(New, InsertPos);<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br>