[cfe-commits] Simplify Parser constructor arguments

Sean Silva silvas at purdue.edu
Mon Feb 13 21:03:28 PST 2012

This is a small patch (my first) which I'm using to test the water for some
other changes in the same vein.

Basically, the Parser constructor was taking a spurious Preprocessor
parameter because the Sema already has a Preprocessor. This is a bug
waiting to happen if a user of this API passes a Preprocessor different
from the one owned by the Sema.

As I am using Clang's APIs for one-off tools (and binding to Lua), I found
a similar situation occurring in a couple other places. The red arrows in
this graph represent the spurious constructor parameters of other classes
http://web.ics.purdue.edu/~silvas/deps.svg . If this patch gets good
feedback I will fix up the other "red arrows" and submit another patch.
Hopefully this will simplify the API for making one-off tools (which is
currently pretty hairy and hard to use).

I basically changed the constructor and then fixed the compilation errors
that resulted from the signature change.

Note: patch produced by `git diff`.

--Sean Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120214/ce3f825a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 1689 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120214/ce3f825a/attachment.bin>

More information about the cfe-commits mailing list