<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Thanks, I could use your code. My checker only handles local
    variables declared in functions so that parser or transformer
    doesn't have to work for globals necessarily.<br>
    <br>
    Best regards,<br>
    Piotr Dziwinski<br>
    <br>
    <div class="moz-cite-prefix">On 15/12/15 11:01, Firat Kasmis via
      cfe-dev wrote:<br>
    </div>
    <blockquote
cite="mid:CAC8rT18niy2ire4RRFoNw-e-ip1n4Db=OoEDkn5q3mYBiNCbRw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>>> <span style="font-size:12.8px">I am going to debug
            this. Meanwhile, I think instead of matching for DeclStmt
            and iterating through the DeclGroup, looking for all
            VarDecl's with the same line location should work too.<br>
          </span><br>
        </div>
        <div>Hmm, this won't work, since you can spread the statement
          over multiple lines. Anyway, I will prepare the Group-Example
          for you.</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2015-12-15 1:00 GMT+01:00 Firat Kasmis
          <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:firat.kasmis@gmail.com" target="_blank">firat.kasmis@gmail.com</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Hi Piotr,
              <div><br>
              </div>
              <div>regarding your issue #1: I have already implemented a
                transformer which performs exactly this, including a
                possible initializer. I can provide you tomorrow with a
                simple snippet guiding you in the right direction.
                Basically, I am matching for DeclStmt and iterating
                through its DeclGroup. The group members are VarDecl as
                you can see by using "clang-check -ast-dump file.c --".
                Once you have the VarDecl there is any type and
                initialzer information you need. Unfortunately, this
                works only for init-declarator lists, which are defined
                in a scope and not globally (a DeclStmt/Statement just
                exists in a scope). See my post: <a
                  moz-do-not-send="true"
                  href="http://lists.llvm.org/pipermail/cfe-dev/2015-November/046262.html"
                  target="_blank"><a class="moz-txt-link-freetext" href="http://lists.llvm.org/pipermail/cfe-dev/2015-November/046262.html">http://lists.llvm.org/pipermail/cfe-dev/2015-November/046262.html</a></a></div>
              <div><br>
              </div>
              <div>I am going to debug this. Meanwhile, I think instead
                of matching for DeclStmt and iterating through the
                DeclGroup, looking for all VarDecl's with the same line
                location should work too.</div>
            </div>
            <div class="HOEnZb">
              <div class="h5">
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">2015-12-14 22:56 GMT+01:00
                    Richard via cfe-dev <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:cfe-dev@lists.llvm.org"
                        target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a></a>></span>:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
                        [Please reply *only* to the list and do not
                        include my email directly<br>
                        in the To: or Cc: of your reply; otherwise I
                        will not see your reply.<br>
                        Thanks.]<br>
                        <br>
                      </span>In article <<a moz-do-not-send="true"
                        href="mailto:566F436A.2080902@gmail.com"
                        target="_blank">566F436A.2080902@gmail.com</a>>,<br>
                      <span>    Piotr Dziwinski via cfe-dev <<a
                          moz-do-not-send="true"
                          href="mailto:cfe-dev@lists.llvm.org"
                          target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a></a>>
                        writes:<br>
                        <br>
                        > On 14/12/15 20:42, Richard via cfe-dev
                        wrote:<br>
                      </span><span>> > IMO, the proper place to
                        fix this is in the AST itself.  I would like<br>
                        > > to see the AST node should provide an
                        iterator API that allows you to<br>
                        > > walk over all the identifiers
                        (SourceLocation begin/end for each<br>
                        > > identifier) in a single declaration
                        and obtain their actual types:<br>
                        > ><br>
                        > > a -> long int<br>
                        > > b -> long int *<br>
                        > > c -> long int[10]<br>
                      </span>> > [...]<br>
                      <span>><br>
                        > Well, in a way, we do have this
                        information, as part of QualType and<br>
                        > Type components of AST which I can access
                        for these declarations.<br>
                        <br>
                      </span>Great!<br>
                      <span><br>
                        > But the crux of the problem is the correct
                        generation of removals in<br>
                        > FixIt hints.<br>
                      </span>> [...]<br>
                      <span>> This is where I need to know the
                        locations where the cuts are to be made.<br>
                        <br>
                      </span>Yes, this is what I tried to find in the
                      parser before, but I was<br>
                      unsuccessful being unfamiliar with the parser
                      code.<br>
                      <span>--<br>
                        "The Direct3D Graphics Pipeline" free book <<a
                          moz-do-not-send="true"
                          href="http://tinyurl.com/d3d-pipeline"
                          rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="http://tinyurl.com/d3d-pipeline">http://tinyurl.com/d3d-pipeline</a></a>><br>
                             The Computer Graphics Museum <<a
                          moz-do-not-send="true"
                          href="http://ComputerGraphicsMuseum.org"
                          rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="http://ComputerGraphicsMuseum.org">http://ComputerGraphicsMuseum.org</a></a>><br>
                                 The Terminals Wiki <<a
                          moz-do-not-send="true"
                          href="http://terminals.classiccmp.org"
                          rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="http://terminals.classiccmp.org">http://terminals.classiccmp.org</a></a>><br>
                          Legalize Adulthood! (my blog) <<a
                          moz-do-not-send="true"
                          href="http://LegalizeAdulthood.wordpress.com"
                          rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="http://LegalizeAdulthood.wordpress.com">http://LegalizeAdulthood.wordpress.com</a></a>><br>
                      </span>
                      <div>
                        <div>_______________________________________________<br>
                          cfe-dev mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:cfe-dev@lists.llvm.org"
                            target="_blank">cfe-dev@lists.llvm.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev"
                            rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>