<div dir="ltr">On Fri, May 3, 2013 at 7:09 PM, Edwin Vane <span dir="ltr"><<a href="mailto:edwin.vane@intel.com" target="_blank">edwin.vane@intel.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
  Small suggestions addressed. Thank you.<br>
<br>
  As for Lexer::makeFileCharRange(), it is accomplishing something different using the same mechanisms as I'm using here, hence the similarity. Perhaps there's some refactoring that could be done to get functions like Lexer::getImmediateMacroName() (which I based much of my understanding on), Lexer::makeFileCharRange(), and numerous SourceManager functions to avoid repeated code. I do see similar tasks happening:<br>

<br>
    if macro arg expansion:<br>
      do something<br>
    else<br>
      do something else<br>
<br>
  Generally this is all done in digging out of (or in to, depending how you look at it) macro expansions. Whereas makeFileCharRange() is attempting to produce a SourceRange with file locations, the new functionality in this patch is trying to answer this question: given a NullTo(Member)Pointer cast that expands from a macro arg, do all uses of that arg result in NullTo(Member)Pointer casts. The three steps to accomplish this are described in allArgUsesValid():<br>

<br>
    # Get the SourceLocation of the arg and the macro to which that arg is given.<br>
    # Find the first ancestor of the cast that doesn't expand from the macro found in step 1. This is just to limit our search through the AST in step 3.<br>
    # Look at all descendants of node from step 2. Any that have source locations matching the arg from step 1 must have a NullTo(Member)Pointer cast somewhere along the descendant chain. This is taken to suffice as "all uses of the arg result in NullTo(Member)Pointer casts".<br>
</blockquote><div><br></div><div style>Ok, I just wanted to make sure we're not missing something. I'm convinced enough we don't have a simpler way (hopefully "yet" :), so LG.</div><div style><br></div>
<div style>Cheers,</div><div style>/Manuel</div></div></div></div>