[cfe-dev] [clang-tidy] Some possible contributions
Firat Kasmis via cfe-dev
cfe-dev at lists.llvm.org
Tue Dec 15 03:01:44 PST 2015
>> 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.
Hmm, this won't work, since you can spread the statement over multiple
lines. Anyway, I will prepare the Group-Example for you.
2015-12-15 1:00 GMT+01:00 Firat Kasmis <firat.kasmis at gmail.com>:
> Hi Piotr,
> 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:
> 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.
> 2015-12-14 22:56 GMT+01:00 Richard via cfe-dev <cfe-dev at lists.llvm.org>:
>> [Please reply *only* to the list and do not include my email directly
>> in the To: or Cc: of your reply; otherwise I will not see your reply.
>> In article <566F436A.2080902 at gmail.com>,
>> Piotr Dziwinski via cfe-dev <cfe-dev at lists.llvm.org> writes:
>> > On 14/12/15 20:42, Richard via cfe-dev wrote:
>> > > IMO, the proper place to fix this is in the AST itself. I would like
>> > > to see the AST node should provide an iterator API that allows you to
>> > > walk over all the identifiers (SourceLocation begin/end for each
>> > > identifier) in a single declaration and obtain their actual types:
>> > >
>> > > a -> long int
>> > > b -> long int *
>> > > c -> long int
>> > > [...]
>> > Well, in a way, we do have this information, as part of QualType and
>> > Type components of AST which I can access for these declarations.
>> > But the crux of the problem is the correct generation of removals in
>> > FixIt hints.
>> > [...]
>> > This is where I need to know the locations where the cuts are to be
>> Yes, this is what I tried to find in the parser before, but I was
>> unsuccessful being unfamiliar with the parser code.
>> "The Direct3D Graphics Pipeline" free book <
>> The Computer Graphics Museum <http://ComputerGraphicsMuseum.org>
>> The Terminals Wiki <http://terminals.classiccmp.org>
>> Legalize Adulthood! (my blog) <http://LegalizeAdulthood.wordpress.com>
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev