<div dir="auto"><div>Thanks! You can pay that back by giving a talk about clang tooling from a user's point of view at some point, as you seem to have mastered the subject :)<br><br><div class="gmail_quote"><div dir="ltr">On Sat, 7 Jul 2018, 17:23 Michael Jabbour, <<a href="mailto:micjabbour@gmail.com">micjabbour@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Thanks for the confirmation. I have learned a lot from your great
      talks/presentations :-)</p>
    <p>Thanks,</p>
    <p>Mike<br>
    </p>
    <br>
    <div class="m_8325414720516619607moz-cite-prefix">On 06/07/2018 11:03 AM, Manuel Klimek
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="auto">That's what I'd do, too.</div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Fri, 6 Jul 2018, 00:50 Michael Jabbour via
          cfe-dev, <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</a>> wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div text="#000000" bgcolor="#FFFFFF">
            <p>I ended up writing my matcher like this:</p>
            <p><tt>integerLiteral(</tt><tt><br>
              </tt><tt>  expr().bind("literal"),</tt><tt>       //inline
                bind call using a redundant node matcher<br>
              </tt><tt>  hasAncestor(                  //climb up the
                AST to the nearest varDecl</tt><tt> ancestor<br>
              </tt><tt>   
varDecl(hasInitializer(ignoringParenCasts(equalsBoundNode("literal"))))   
                //check that this varDecl satisfies the original
                condition</tt><tt><br>
              </tt><tt>  )</tt><tt><br>
              </tt><tt>)</tt></p>
            <p>Any feedback is appreciated, as I am completely new to
              LibTooling...</p>
            <p>P.S.: The actual matcher I am working on is far more
              complicated. Inverting it (i.e. using my very first
              example) would result in much more difficult problems.
              Although this seems like a roundabout hack, it might be
              effective when nested inside matchers that have already
              been tested</p>
            <p>Thanks,</p>
            <p>Mike<br>
            </p>
            <br>
            <div class="m_8325414720516619607m_8964194433787506763moz-cite-prefix">On
              05/07/2018 7:31 PM, Michael Jabbour wrote:<br>
            </div>
            <blockquote type="cite">
              <p>Hello all,<br>
              </p>
              <p>When using has*() it is sometimes desirable to use
                ignoringParenCasts(), for example (from the docs):</p>
              <pre style="color:rgb(34,34,34);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">varDecl(hasInitializer(ignoringParenCasts(integerLiteral())))</pre>
              <p>Is there any way to get the same effect when
                hasParent(), e.g.:</p>
              <pre style="color:rgb(34,34,34);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">integerLiteral(hasParent(ignoringParenCasts(varDecl())))</pre>
              <p>Obviously this does not work, but what is the best way
                to achieve a similar effect?</p>
              <p>cheers,</p>
              <p>Mike<br>
              </p>
            </blockquote>
            <br>
          </div>
          _______________________________________________<br>
          cfe-dev mailing list<br>
          <a href="mailto:cfe-dev@lists.llvm.org" rel="noreferrer noreferrer" target="_blank">cfe-dev@lists.llvm.org</a><br>
          <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer noreferrer noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div></div></div>