<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body>
    <div class="moz-cite-prefix">Deepack, <br>
      Yes, it's enough to have "vanilla clang/LLVM" for parsing OpenMP
      code.<br>
      But you have to porovide proper driver options to parse OpenMP
      nodes. In your case these options are (for clang built from
      trunk):<br>
      <br>
      clang -c -Xclang -ast-dump -Xclang -fopenmp=libiomp5
      <FileName><br>
      <br>
      Try this.<br>
      <pre class="moz-signature" cols="72">Best regards,
Alexey Bataev
=============
Software Engineer
Intel Compiler Team</pre>
      26.02.2015 8:40, Deepak Rajendrakumaran пишет:<br>
    </div>
    <blockquote
cite="mid:CALLs9tu1aDO8mzQr_a9Z_M3pkZgm_gv4Fj-eb6emAF-CKjiA+Q@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hello,
        <div><br>
        </div>
        <div>Thank you for replying. </div>
        <div><br>
        </div>
        <div>Yes,you are right. I am not getting the <span
            style="font-size:13px">OMPThreadPrivateDecl nodes at all.</span></div>
        <div><span style="font-size:13px"><br>
          </span></div>
        <div><span style="font-size:13px">I tried printing out the AST
            for a small microbenchmark with OpenMP calls using '</span> clang
          -Xclang -ast-dump -fopenmp <FileName>".  And if I have
          omp.h header file included, it throws an error. Now I dug
          around a little bit more, and have a couple  of questions.
          Based on what I see here-<a moz-do-not-send="true"
            href="http://llvm.org/devmtg/2014-10/Slides/Bataev-OpenMP.pdf">http://llvm.org/devmtg/2014-10/Slides/Bataev-OpenMP.pdf</a>,
          you seem to be the right person to ask. Hope you do not mind.</div>
        <div><br>
        </div>
        <div>I have build llvm from trunk(version 3.6.0).  Now to parse
          nodes, is the normal vanilla llvm enough or do I need to make
          any omp specific changes/build(like <a moz-do-not-send="true"
            href="http://clang-omp.github.io/%29">http://clang-omp.github.io/)</a>??</div>
        <div><br>
        </div>
        <div>p.s. My llvm build is fine for all other purposes. i have
          been using it for a source-to-source compiler with libtooling
          and I have been running the tool on NAS benchmarks(OpenMP
          NPB-C version). The only issue I am seeing is with openMP
          pragmas.So what I am trying to say is that the llvm build
          works fine for other cases and it is tested.</div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Deepak</div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, Feb 25, 2015 at 3:54 AM,
          Bataev, Alexey <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:a.bataev@hotmail.com" target="_blank">a.bataev@hotmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>Hi,<br>
                are you sure that you have OMPThreadPrivateDecl nodes at
                all? Check that the code is compiled with -Xclang
                -fopenmp=libiomp5 option.<br>
                <pre cols="72">Best regards,
Alexey Bataev
=============
Software Engineer
Intel Compiler Team
Intel Corp. </pre>
                25.02.2015 5:00, Deepak Rajendrakumaran пишет:<br>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">This might sound silly. But I have
                      been trying to match OMPThreadPrivateDecl' nodes
                      using ASTMatcher. But I have been running into
                      deadends.
                      <div><br>
                      </div>
                      <div>What I am doing now is using ASTMatcher to
                        match 'Decl' nodes and check if its a
                        'OMPThreadPrivateDecl'  by using a dyn_cast. But
                        this does not work.</div>
                      <div><br>
                      </div>
                      <div>Alternatively I tried with <span
                          style="color:rgb(0,0,0);white-space:pre-wrap">isa<OMPThreadPrivateDecl>(*D)

                          (which kind of does the same thing)</span></div>
                      <div><br>
                      </div>
                      <div> Can anyone point out how I can access the
                        'OMPThreadPrivateDecl nodes using ASTMAtcher or
                        what I am doing wrong?</div>
                      <div><br>
                      </div>
                      <div>-Deepak</div>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>