<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 href="http://lists.llvm.org/pipermail/cfe-dev/2015-November/046262.html">http://lists.llvm.org/pipermail/cfe-dev/2015-November/046262.html</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="gmail_extra"><br><div class="gmail_quote">2015-12-14 22:56 GMT+01:00 Richard via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><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 href="mailto:566F436A.2080902@gmail.com">566F436A.2080902@gmail.com</a>>,<br>
<span class="">    Piotr Dziwinski via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> writes:<br>
<br>
> On 14/12/15 20:42, Richard via cfe-dev wrote:<br>
</span><span class="">> > 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 class="">><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 class=""><br>
> But the crux of the problem is the correct generation of removals in<br>
> FixIt hints.<br>
</span>> [...]<br>
<span class="">> 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 class="im HOEnZb">--<br>
"The Direct3D Graphics Pipeline" free book <<a href="http://tinyurl.com/d3d-pipeline" rel="noreferrer" target="_blank">http://tinyurl.com/d3d-pipeline</a>><br>
     The Computer Graphics Museum <<a href="http://ComputerGraphicsMuseum.org" rel="noreferrer" target="_blank">http://ComputerGraphicsMuseum.org</a>><br>
         The Terminals Wiki <<a href="http://terminals.classiccmp.org" rel="noreferrer" target="_blank">http://terminals.classiccmp.org</a>><br>
  Legalize Adulthood! (my blog) <<a href="http://LegalizeAdulthood.wordpress.com" rel="noreferrer" target="_blank">http://LegalizeAdulthood.wordpress.com</a>><br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a 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>