[cfe-dev] ASTMatcher for assert()
Manuel Klimek
klimek at google.com
Tue Jun 10 03:12:52 PDT 2014
On Fri, Jun 6, 2014 at 9:04 PM, Richard <legalize at xmission.com> wrote:
>
> In article <
> CAN1LFUMPxQHi8rzft-j50NDPJkJeet6zkPqLGhxfV35wM3LW+w at mail.gmail.com>,
> Alex Horn <alex.horn at cs.ox.ac.uk> writes:
>
> > A few notes:
> >
> > Each ASTMatcher checks whether
> > Result.Context->getSourceManager().isInWrittenMainFile(); otherwise,
> > the tool would try to rewrite system headers etc.
>
> I'm thinking of contributing a matcher that allows you to match nodes
> based on the associated source file so that you can easily discard
> matches outside the directory hierarchy(ies) of interest. This seems
> like a common problem that all refactoring tool authors will encounter
> sooner or later.
>
I think it's a good idea, but will not solve the general problem of
surprise when encountering source locations. They are quite hard to
understand, and the problem that one needs to decide whether to do
something with the expansion of spelling location (or something in between)
remains.
Cheers,
/Manuel
> --
> "The Direct3D Graphics Pipeline" free book <
> http://tinyurl.com/d3d-pipeline>
> 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 cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140610/d10b6efc/attachment.html>
More information about the cfe-dev
mailing list