<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 21, 2013 at 1:28 PM, Thompson, John <span dir="ltr"><<a href="mailto:John_Thompson@playstation.sony.com" target="_blank">John_Thompson@playstation.sony.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Argyrios,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Yeah, your comment made me think that perhaps I should just track macro expansions in general, not limiting it to conditional directives, as macro instances
anywhere with different values could be problematic as well for modules. Is that what you meant as well?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">What do you think, Sean?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The program structure doesn’t change a whole lot. Instead of storing the condition location and values, I store the macro information.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> </span></p></div></div></blockquote><div><br></div><div style>I think the program structure will have to change a good amount anyway in order to make it clear what the algorithm is doing. Unless it is unable to express the check that is desired (but I think it can), I strongly believe that the pseudocode I suggested is the right approach, which nicely models the problem as:</div>
<div style><br></div><div style>1) Defining an equivalence relation on macro expansions or preprocessor conditions or whatever (call this type T)</div><div style>2) Maintaining a map keyed on the physical source file location of the T and having T as values, and using that to ensure that all physical source locations expand to the same thing across TU's.</div>
<div style><br></div><div style>This approach should work for either of the scenarios. Moreover, it has obvious time and space complexity and it's easy to see how to parallelize it (operate on independent maps in independent threads and at the end perform a "union" operation on the maps).</div>
<div style><br></div><div style>-- Sean Silva</div></div></div></div>