[cfe-commits] [PATCH] TableGen'ize documentation command lists (and break binary compatibility of CXComment)

Dmitri Gribenko gribozavr at gmail.com
Wed Sep 5 12:53:35 PDT 2012


On Wed, Sep 5, 2012 at 8:18 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> On Wed, Sep 5, 2012 at 8:13 PM, Ted Kremenek <kremenek at apple.com> wrote:
>> On Sep 5, 2012, at 10:09 AM, Matthieu Monrocq <matthieu.monrocq at gmail.com>
>> wrote:
>>
>> If you need to break binary compatibility, I would encourage you to go all
>> the way and make CXComment an opaque pointer. This way further changes will
>> never again require breaking binary compatibility (for this).
>>
>>
>> Agreed.  We have typically not exposed details of CX* data structures in the
>> past that we wanted to extend over time.
>
> Matthieu and Ted: thank you for the idea.  I was feeling the same way,
> but Index.h has lots of structures with exposed internals (with a "do
> not touch" warning for users).  I will rework the patch and resubmit.

Unfortunately, this approach has its downsides.  Now I can see the
rationale behind structures with exposed internals -- they are value
types and don't need a special dispose API.  Opaque pointer approach
leads to a source incompatible change since then CXComment objects
would need to be disposed of properly.

So, I think that my initial approach is better since CXComment being a
value type is a very nice property.  I can not guarantee that it is
completely future-proof, though.  But since this change adds an
ASTContext pointer to CXComment, we can reach almost anything from
there.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list