<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On Dec 12, 2015, at 4:20 PM, Michael Gottesman via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">In general, we have not been particularly disciplined in this regard. I would suggest following what is being done locally in the file you are modifying, i.e. FuncDecl */TypeChecker &amp; as per the LLVM style guide.</div></div></blockquote><div><br class=""></div>There are common rules at work here that govern most situations. &nbsp;We almost always pass around objects that are part of the language representation as either pointers (e.g. AST/SIL/LLVM nodes) or values (e.g. Type, SILDeclRef); pretty much everything else is passed around as a reference, especially classes that manage the creation or manipulation of the language representation (e.g. IRGenModule, TypeChecker).</div><div><br class=""></div><div>The biggest grey area is for those parts of the language representation that are either globally or contextually singleton, e.g. ASTContext and SILFunction; these are almost always stored as references.</div><div><br class=""></div><div>John.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">Michael<br class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 12, 2015, at 3:15 PM, Jacob Bandes-Storch via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I've noticed a mix of pointers (FuncDecl*) and references (TypeChecker&amp;) in the C++ codebase. Is there a particular reason for this? Perhaps a style guide?<div class=""><br clear="all" class=""><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div class="">Jacob<br class=""></div></div></div></div>
</div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=BsPB5S3Z2usbY-2FzcCsd-2F2r4MihYe9FiKHjzH65yItK42zGIS-2BoUlT20IhcT-2BMoNTJwioULyBGgd3iT1Ge-2BfqKpy9PTC-2BNFZ1LSfqFaLA4EUIrqazQsR52uvMuicqqhAUGjelm9Roux4dW189khi6So0v60SFw4nH0hqnls1jkQzEdNI8ic1kD18LSfvWcrb-2B6CNdYM5Xsvf3-2BjrdCsv5-2BIT-2FOy319BWL6qWLySR-2FSe4-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
_______________________________________________<br class="">swift-dev mailing list<br class=""><a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-dev" class="">https://lists.swift.org/mailman/listinfo/swift-dev</a><br class=""></div></blockquote></div><br class=""></div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=hWKWvOREWCPT32eVzNXOV7yIWXgGOvlMtgjKbOieJnYFY9LtG5Z7MeRP-2BtSh2C6f0rJ09hXed4krrPDcqHYF6NtGMYRZNgAeGrixhNAciP6WiKTsk37dYIZ64F4VGxgjBErxWWMwbQsaBsAIZIEVr2iV9tbFuAwJLUE3rwyASpbFgvrxRuCNpVOqYMLBXAEhGvPLF0j5ZH18CE37aVKnkN7r7fQoujEqLXi13-2BEpgbI-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
</div>
_______________________________________________<br class="">swift-dev mailing list<br class=""><a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-dev<br class=""></div></blockquote></div><br class=""></body></html>