<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body 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="moz-cite-prefix">On 06/07/2018 11:03 AM, Manuel Klimek
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAOsfVv=mJn7D1vwR=sdtRERzDSjb3aEFzOm8TH5GPoLg6d3TpA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <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"
            moz-do-not-send="true">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_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" target="_blank"
            rel="noreferrer" moz-do-not-send="true">cfe-dev@lists.llvm.org</a><br>
          <a
            href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev"
            rel="noreferrer noreferrer" target="_blank"
            moz-do-not-send="true">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>