<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Constructors/destructors that link/unlink objects could be better at eliminating dead objects"
   href="http://llvm.org/bugs/show_bug.cgi?id=17577">17577</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Constructors/destructors that link/unlink objects could be better at eliminating dead objects
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Common Code Generator Code
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>erik@arbat.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=11374" name="attach_11374" title="Example of smart pointers for keeping track of GC roots on the stack">attachment 11374</a> <a href="attachment.cgi?id=11374&action=edit" title="Example of smart pointers for keeping track of GC roots on the stack">[details]</a></span>
Example of smart pointers for keeping track of GC roots on the stack

Currently experimenting with smart pointer for the oilpan project in Blink. 
This is a project to move Blink from reference counting to a traced heap. 
Reachability of objects is determined transitively from roots, including roots
related to local variables on the stack.  This is done with smart pointers.  We
are trying different smart pointer models.  This one is one where the compiler
ought to be able to eliminate much of the smart pointering.  Clang partially
succeeds, eliminating the destructors, but still performing the linking up in
the constructor.

Is there any way we could restructure the code to make this easier for the
compiler, or is there a fix for the compiler that would help?

See attached code.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>